Skip to content

Commit c1aebd4

Browse files
authored
[Clang][OpenCL] Wrap image functions with the macro (#129177)
According to the OpenCL C spec, the image functions are optional. For OpenCL C 1.2, the image functions are guarded by the `__IMAGE_SUPPORT__` macro. For the OpenCL C 3.0 and later, the `__opencl_c_images` macro is used.
1 parent 4bd3427 commit c1aebd4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Headers/opencl-c.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15082,6 +15082,7 @@ half16 __ovld __cnfn shuffle2(half16, half16, ushort16);
1508215082
#pragma OPENCL EXTENSION cl_khr_gl_msaa_sharing : enable
1508315083
#endif //cl_khr_gl_msaa_sharing
1508415084

15085+
#if (defined(__opencl_c_images) || defined(__IMAGE_SUPPORT__))
1508515086
/**
1508615087
* Use the coordinate (coord.xy) to do an element lookup in
1508715088
* the 2D image object specified by image.
@@ -16143,6 +16144,8 @@ int __ovld __cnfn get_image_num_samples(read_write image2d_array_msaa_depth_t);
1614316144
#endif //defined(__opencl_c_read_write_images)
1614416145
#endif
1614516146

16147+
#endif // (defined(__opencl_c_images) || defined(__IMAGE_SUPPORT__))
16148+
1614616149
// OpenCL v2.0 s6.13.15 - Work-group Functions
1614716150

1614816151
#if defined(__opencl_c_work_group_collective_functions)

0 commit comments

Comments
 (0)