Skip to content

Commit

Permalink
[OpenCL] Add device enqueue guards for DSE builtins
Browse files Browse the repository at this point in the history
Align guards of these builtins with opencl-c.h.
  • Loading branch information
svenvh committed Apr 11, 2022
1 parent 058a33d commit bb6f8d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/Sema/OpenCLBuiltins.td
Expand Up @@ -104,6 +104,7 @@ def FuncExtKhrMipmapImageWrites : FunctionExtension<"cl_khr_mipmap_imag
def FuncExtKhrGlMsaaSharing : FunctionExtension<"cl_khr_gl_msaa_sharing">;
def FuncExtKhrGlMsaaSharingReadWrite : FunctionExtension<"cl_khr_gl_msaa_sharing __opencl_c_read_write_images">;

def FuncExtOpenCLCDeviceEnqueue : FunctionExtension<"__opencl_c_device_enqueue">;
def FuncExtOpenCLCGenericAddressSpace : FunctionExtension<"__opencl_c_generic_address_space">;
def FuncExtOpenCLCNamedAddressSpaceBuiltins : FunctionExtension<"__opencl_c_named_address_space_builtins">;
def FuncExtOpenCLCPipes : FunctionExtension<"__opencl_c_pipes">;
Expand Down Expand Up @@ -1454,7 +1455,7 @@ let Extension = FuncExtOpenCLCPipes in {
// Defined in Builtins.def

// --- Table 33 ---
let MinVersion = CL20 in {
let Extension = FuncExtOpenCLCDeviceEnqueue in {
def : Builtin<"enqueue_marker",
[Int, Queue, UInt, PointerType<ConstType<ClkEvent>, GenericAS>, PointerType<ClkEvent, GenericAS>]>;

Expand Down
1 change: 1 addition & 0 deletions clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
Expand Up @@ -73,6 +73,7 @@ typedef struct {int a;} ndrange_t;

// Enable extensions that are enabled in opencl-c-base.h.
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
#define __opencl_c_device_enqueue 1
#define __opencl_c_generic_address_space 1
#define cl_khr_subgroup_extended_types 1
#define cl_khr_subgroup_ballot 1
Expand Down

0 comments on commit bb6f8d9

Please sign in to comment.