Skip to content

Commit e5a1821

Browse files
authored
[OpenCL] Add missing Intel extensions to OpenCLExtensions.def (#169875)
Add following extensions: cl_intel_bfloat16_conversion cl_intel_subgroup_buffer_prefetch cl_intel_subgroup_local_block_io cl_intel_subgroups_char cl_intel_subgroups_long This allows targets to expose these extensions via getSupportedOpenCLOpts and ensures macros are defined when enabled.
1 parent 893479a commit e5a1821

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

clang/include/clang/Basic/OpenCLExtensions.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,13 @@ OPENCL_EXTENSION(cl_amd_media_ops, true, 100)
140140
OPENCL_EXTENSION(cl_amd_media_ops2, true, 100)
141141

142142
// Intel OpenCL extensions
143+
OPENCL_EXTENSION(cl_intel_bfloat16_conversion, false, 100)
143144
OPENCL_EXTENSION(cl_intel_subgroups, true, 120)
145+
OPENCL_EXTENSION(cl_intel_subgroups_char, true, 120)
146+
OPENCL_EXTENSION(cl_intel_subgroups_long, true, 120)
144147
OPENCL_EXTENSION(cl_intel_subgroups_short, true, 120)
148+
OPENCL_EXTENSION(cl_intel_subgroup_buffer_prefetch, false, 120)
149+
OPENCL_EXTENSION(cl_intel_subgroup_local_block_io, false, 120)
145150
OPENCL_EXTENSION(cl_intel_device_side_avc_motion_estimation, true, 120)
146151

147152
// OpenCL C 3.0 features (6.2.1. Features)

clang/test/SemaOpenCL/extension-version.cl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@
331331
#endif
332332
#pragma OPENCL EXTENSION cl_khr_depth_images : enable
333333

334+
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 100)
335+
#ifndef cl_intel_bfloat16_conversion
336+
#error "Missing cl_intel_bfloat16_conversion define"
337+
#endif
338+
#endif
339+
334340
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
335341
#ifndef cl_intel_subgroups
336342
#error "Missing cl_intel_subgroups define"
@@ -340,6 +346,24 @@
340346
#endif
341347
#pragma OPENCL EXTENSION cl_intel_subgroups : enable
342348

349+
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
350+
#ifndef cl_intel_subgroups_char
351+
#error "Missing cl_intel_subgroups_char define"
352+
#endif
353+
#else
354+
// expected-warning@+2{{unsupported OpenCL extension 'cl_intel_subgroups_char' - ignoring}}
355+
#endif
356+
#pragma OPENCL EXTENSION cl_intel_subgroups_char : enable
357+
358+
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
359+
#ifndef cl_intel_subgroups_long
360+
#error "Missing cl_intel_subgroups_long define"
361+
#endif
362+
#else
363+
// expected-warning@+2{{unsupported OpenCL extension 'cl_intel_subgroups_long' - ignoring}}
364+
#endif
365+
#pragma OPENCL EXTENSION cl_intel_subgroups_long : enable
366+
343367
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
344368
#ifndef cl_intel_subgroups_short
345369
#error "Missing cl_intel_subgroups_short define"
@@ -349,6 +373,18 @@
349373
#endif
350374
#pragma OPENCL EXTENSION cl_intel_subgroups_short : enable
351375

376+
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
377+
#ifndef cl_intel_subgroup_buffer_prefetch
378+
#error "Missing cl_intel_subgroup_buffer_prefetch define"
379+
#endif
380+
#endif
381+
382+
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
383+
#ifndef cl_intel_subgroup_local_block_io
384+
#error "Missing cl_intel_subgroup_local_block_io define"
385+
#endif
386+
#endif
387+
352388
#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 120)
353389
#ifndef cl_intel_device_side_avc_motion_estimation
354390
#error "Missing cl_intel_device_side_avc_motion_estimation define"

0 commit comments

Comments
 (0)