[AMDGPU] Support the OpenCL generic addrspace feature by default (#137636)

This feature should be supported on AMDGCN architectures with flat
addressing.
This commit is contained in:
Fraser Cormack
2025-04-29 14:14:00 +01:00
committed by GitHub
parent 78d95cc544
commit 1e31f4b5eb
3 changed files with 16 additions and 0 deletions

View File

@@ -318,6 +318,9 @@ public:
Opts["__opencl_c_images"] = true;
Opts["__opencl_c_3d_image_writes"] = true;
Opts["cl_khr_3d_image_writes"] = true;
Opts["__opencl_c_generic_address_space"] =
GPUKind >= llvm::AMDGPU::GK_GFX700;
}
}

View File

@@ -155,3 +155,11 @@
#endif
#pragma OPENCL EXTENSION cl_amd_media_ops2: enable
#if (__OPENCL_C_VERSION__ >= 300)
#ifndef __opencl_c_generic_address_space
#error "Missing __opencl_c_generic_address_space define"
#else
#error "Incorrect __opencl_c_generic_address_space define"
#endif
#pragma OPENCL EXTENSION __opencl_c_generic_address_space: enable
#endif

View File

@@ -146,3 +146,8 @@
#pragma OPENCL EXTENSION cl_khr_subgroups: enable
// expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}}
#ifdef __opencl_c_generic_address_space
#error "Incorrect __opencl_c_generic_address_space define"
#endif
#pragma OPENCL EXTENSION __opencl_c_generic_address_space: enable
// expected-warning@-1{{OpenCL extension '__opencl_c_generic_address_space' unknown or does not require pragma - ignoring}}