Skip to content

Commit cba338e

Browse files
authored
[SYCL] Bump libclc to OpenCL 3.0 (#8100)
This is needed to enable the generic AS in libclc which is useful for atomic ops
1 parent 2b00cf9 commit cba338e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

libclc/CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
336336
# Disables NVVM reflection to defer to after linking
337337
set( flags "SHELL:-Xclang -target-feature" "SHELL:-Xclang +ptx72"
338338
"SHELL:-march=sm_86" "SHELL:-mllvm --nvvm-reflect-enable=false")
339-
elseif( ${ARCH} STREQUAL amdgcn )
340-
# AMDGCN needs generic address space for atomics
341-
set( flags "SHELL:-Xclang -cl-std=CL2.0")
342339
else()
343340
set ( flags )
344341
endif()
@@ -378,6 +375,21 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
378375
# have to be explicity declared in the soruce.
379376
list( APPEND flags -Xclang -fdeclare-spirv-builtins)
380377

378+
# OpenCL 3.0 extensions
379+
list( APPEND flags -cl-std=CL3.0 "SHELL:-Xclang" )
380+
string(CONCAT CL_3_0_EXTENSIONS
381+
"-cl-ext="
382+
"+cl_khr_fp64,"
383+
"+__opencl_c_3d_image_writes,"
384+
"+__opencl_c_images,"
385+
"+cl_khr_3d_image_writes,"
386+
"+__opencl_c_generic_address_space")
387+
if ( NOT ${ARCH} STREQUAL amdgcn )
388+
string(APPEND CL_3_0_EXTENSIONS
389+
",+cl_khr_fp16")
390+
endif()
391+
list( APPEND flags ${CL_3_0_EXTENSIONS})
392+
381393
add_libclc_builtin_set(libspirv-${arch_suffix}
382394
TRIPLE ${t}
383395
TARGET_ENV libspirv

0 commit comments

Comments
 (0)