Skip to content

Commit 98ae863

Browse files
committed
[Clang][OpenCL] Wrap image functions with the macro
According to the OpenCL C 3.0 spec, the image functions are optional. If they are supported, the `__opencl_c_images` macro is defined. This patch wraps the image functions with the macro. Without the wrapping, the frontend emit errors, when a user tries to disable the images support.
1 parent 0e56f6d commit 98ae863

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)
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)
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)