[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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user