Skip to content

[OpenCL] Add cl_ext_image_unsigned_10x6_12x4_14x2 extension #134216

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

svenvh
Copy link
Member

@svenvh svenvh commented Apr 3, 2025

Add the defines for the cl_ext_image_unsigned_10x6_12x4_14x2 extension.

Add the defines for the `cl_ext_image_unsigned_10x6_12x4_14x2`
extension.
@svenvh svenvh added the OpenCL label Apr 3, 2025
@svenvh
Copy link
Member Author

svenvh commented Apr 3, 2025

Extension specification: KhronosGroup/OpenCL-Docs#1352

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:headers Headers provided by Clang, e.g. for intrinsics labels Apr 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-x86

Author: Sven van Haastregt (svenvh)

Changes

Add the defines for the cl_ext_image_unsigned_10x6_12x4_14x2 extension.


Full diff: https://github.com/llvm/llvm-project/pull/134216.diff

2 Files Affected:

  • (modified) clang/lib/Headers/opencl-c-base.h (+9)
  • (modified) clang/test/Headers/opencl-c-header.cl (+6)
diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
index b6bcf32c09c08..2b7f5043e09e4 100644
--- a/clang/lib/Headers/opencl-c-base.h
+++ b/clang/lib/Headers/opencl-c-base.h
@@ -47,6 +47,7 @@
 #define __opencl_c_ext_fp32_local_atomic_min_max 1
 #define __opencl_c_ext_image_raw10_raw12 1
 #define __opencl_c_ext_image_unorm_int_2_101010 1
+#define __opencl_c_ext_image_unsigned_10x6_12x4_14x2 1
 #define cl_khr_kernel_clock 1
 #define __opencl_c_kernel_clock_scope_device 1
 #define __opencl_c_kernel_clock_scope_work_group 1
@@ -490,6 +491,14 @@ typedef enum memory_order
 #ifdef __opencl_c_ext_image_unorm_int_2_101010
 #define CLK_UNORM_INT_2_101010_EXT 0x10E5
 #endif // __opencl_c_ext_image_unorm_int_2_101010
+#ifdef __opencl_c_ext_image_unsigned_10x6_12x4_14x2
+#define CLK_UNSIGNED_INT10X6_EXT 0x10E6
+#define CLK_UNSIGNED_INT12X4_EXT 0x10E7
+#define CLK_UNSIGNED_INT14X2_EXT 0x10E8
+#define CLK_UNORM_10X6_EXT 0x10E1
+#define CLK_UNORM_12X4_EXT 0x10E9
+#define CLK_UNORM_14X2_EXT 0x10EA
+#endif // __opencl_c_ext_image_unsigned_10x6_12x4_14x2
 
 // Channel order, numbering must be aligned with cl_channel_order in cl.h
 //
diff --git a/clang/test/Headers/opencl-c-header.cl b/clang/test/Headers/opencl-c-header.cl
index 7317ff0adaafb..17cbb67f26038 100644
--- a/clang/test/Headers/opencl-c-header.cl
+++ b/clang/test/Headers/opencl-c-header.cl
@@ -193,6 +193,9 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
 #if __opencl_c_ext_image_unorm_int_2_101010 != 1
 #error "Incorrectly defined __opencl_c_ext_image_unorm_int_2_101010"
 #endif
+#if __opencl_c_ext_image_unsigned_10x6_12x4_14x2 != 1
+#error "Incorrectly defined __opencl_c_ext_image_unsigned_10x6_12x4_14x2"
+#endif
 
 #else
 
@@ -283,6 +286,9 @@ global atomic_int z = ATOMIC_VAR_INIT(99);
 #ifdef __opencl_c_ext_image_unorm_int_2_101010
 #error "Incorrect __opencl_c_ext_image_unorm_int_2_101010 define"
 #endif
+#ifdef __opencl_c_ext_image_unsigned_10x6_12x4_14x2
+#error "Incorrect __opencl_c_ext_image_unsigned_10x6_12x4_14x2 define"
+#endif
 
 #endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
 

Copy link
Collaborator

@kpet kpet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! (The definitions match the specification, tests ran, CI failures look unrelated.)

@kpet kpet merged commit 47c892a into llvm:main May 14, 2025
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:headers Headers provided by Clang, e.g. for intrinsics clang Clang issues not falling into any other category OpenCL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants