Skip to content

[CUDA] __constant__ aggregate initializer values return undef in host compilation #142504

Open
@Artem-B

Description

@Artem-B

__constant__ aggregate initializer values return undef in host compilation, but things work when we access individual field values or make a local copy.

Reproducer:

struct S { int s; };
const __constant__ S const_s = { 77 };

__host__ S works () {
    S s = const_s;
    return s;  // returns {77}
}

__host__ S broken () {
    return const_s;  // returns undef
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions