Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU] Using OpenCL address spaces violates assertion #65069

Closed
jhuber6 opened this issue Aug 29, 2023 · 2 comments · Fixed by #66205
Closed

[AMDGPU] Using OpenCL address spaces violates assertion #65069

jhuber6 opened this issue Aug 29, 2023 · 2 comments · Fixed by #66205
Labels
backend:AMDGPU clang Clang issues not falling into any other category OpenCL

Comments

@jhuber6
Copy link
Contributor

jhuber6 commented Aug 29, 2023

The following code snippet causes an assertion to be hit when compiling for AMDGPU. This works as expected when using the numerical address spaces or when compiling for the NVPTX architecture.

int [[clang::opencl_constant]] x = 0;

See the compiler explorer link for a reproducer https://godbolt.org/z/x9PWr76qq.

@jhuber6 jhuber6 added clang Clang issues not falling into any other category backend:AMDGPU OpenCL labels Aug 29, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2023

@llvm/issue-subscribers-opencl

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 29, 2023

@llvm/issue-subscribers-backend-amdgpu

jhuber6 added a commit to jhuber6/llvm-project that referenced this issue Sep 13, 2023
Summary:
Currently, there is an assertion that prevents us from emitting an
AMDGPU global with a non-target specific address space (i.e. numerical
attribute). I'm unsure what the original intentions of this assertion
were, but we should be able to use OpenCL address spaces when compiling
directly to AMDGPU from C++. This is permitted on NVPTX so I'm unsure
what this assertion is guarding. The patch simply removes the assertion
and adds a test to ensure that these emit the expected address spaces.

Fixes llvm#65069
jhuber6 added a commit that referenced this issue Sep 13, 2023
…6205)

Summary:
Currently, there is an assertion that prevents us from emitting an
AMDGPU global with a non-target specific address space (i.e. numerical
attribute). I'm unsure what the original intentions of this assertion
were, but we should be able to use OpenCL address spaces when compiling
directly to AMDGPU from C++. This is permitted on NVPTX so I'm unsure
what this assertion is guarding. The patch simply removes the assertion
and adds a test to ensure that these emit the expected address spaces.

Fixes #65069
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this issue Sep 19, 2023
…vm#66205)

Summary:
Currently, there is an assertion that prevents us from emitting an
AMDGPU global with a non-target specific address space (i.e. numerical
attribute). I'm unsure what the original intentions of this assertion
were, but we should be able to use OpenCL address spaces when compiling
directly to AMDGPU from C++. This is permitted on NVPTX so I'm unsure
what this assertion is guarding. The patch simply removes the assertion
and adds a test to ensure that these emit the expected address spaces.

Fixes llvm#65069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AMDGPU clang Clang issues not falling into any other category OpenCL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants