Skip to content

Commit

Permalink
[OpenCL] Add cl_ext_image_raw10_raw12 extension
Browse files Browse the repository at this point in the history
Add the defines for the `cl_ext_image_raw10_raw12` extension.

Differential Revision: https://reviews.llvm.org/D151339
  • Loading branch information
svenvh committed Jul 26, 2023
1 parent 05aae08 commit 5e8b44c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/Headers/opencl-c-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#define __opencl_c_ext_fp32_local_atomic_add 1
#define __opencl_c_ext_fp32_global_atomic_min_max 1
#define __opencl_c_ext_fp32_local_atomic_min_max 1
#define __opencl_c_ext_image_raw10_raw12 1

#endif // defined(__SPIR__) || defined(__SPIRV__)
#endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
Expand Down Expand Up @@ -477,6 +478,10 @@ typedef enum memory_order
#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0
#define CLK_UNORM_INT_101010_2 0x10E0
#endif // __OPENCL_C_VERSION__ >= CL_VERSION_3_0
#ifdef __opencl_c_ext_image_raw10_raw12
#define CLK_UNSIGNED_INT_RAW10_EXT 0x10E3
#define CLK_UNSIGNED_INT_RAW12_EXT 0x10E4
#endif // __opencl_c_ext_image_raw10_raw12

// Channel order, numbering must be aligned with cl_channel_order in cl.h
//
Expand Down
6 changes: 6 additions & 0 deletions clang/test/Headers/opencl-c-header.cl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
#if __opencl_c_ext_fp64_local_atomic_min_max != 1
#error "Incorrectly defined __opencl_c_ext_fp64_local_atomic_min_max"
#endif
#if __opencl_c_ext_image_raw10_raw12 != 1
#error "Incorrectly defined __opencl_c_ext_image_raw10_raw12"
#endif

#else

Expand Down Expand Up @@ -271,6 +274,9 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
#ifdef __opencl_c_ext_fp64_local_atomic_min_max
#error "Incorrectly __opencl_c_ext_fp64_local_atomic_min_max defined"
#endif
#ifdef __opencl_c_ext_image_raw10_raw12
#error "Incorrect __opencl_c_ext_image_raw10_raw12 define"
#endif

#endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)

Expand Down

0 comments on commit 5e8b44c

Please sign in to comment.