Skip to content

Commit 64d7bfd

Browse files
committed
[libclc] Set OpenCL version to 3.0
This PR is cherry-pick of intel/llvm@cba338e5fb1c This allows adding OpenCL 2.0 built-ins, e.g. ctz, and OpenCL 3.0 extension built-ins, including generic address space variants. llvm-diff shows this PR has no change in amdgcn--amdhsa.bc.
1 parent 68806b9 commit 64d7bfd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libclc/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,16 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
411411
set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" )
412412
file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
413413

414+
# OpenCL 3.0 extensions
415+
string(CONCAT CL_3_0_EXTENSIONS
416+
"-cl-ext="
417+
"+cl_khr_fp64,"
418+
"+cl_khr_fp16,"
419+
"+__opencl_c_3d_image_writes,"
420+
"+__opencl_c_images,"
421+
"+cl_khr_3d_image_writes")
422+
list( APPEND build_flags -cl-std=CL3.0 "-Xclang" ${CL_3_0_EXTENSIONS} )
423+
414424
string( TOUPPER "CLC_${MACRO_ARCH}" CLC_TARGET_DEFINE )
415425

416426
list( APPEND build_flags

0 commit comments

Comments
 (0)