@@ -387,39 +387,21 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
387
387
388
388
message ( STATUS " device: ${d} ( ${${d} _aliases} )" )
389
389
390
- # 1.2 is Clang's default OpenCL C language standard to compile for.
391
- set ( opencl_lang_std "CL1.2" )
392
-
393
- if ( DARCH STREQUAL spirv )
394
- set ( opencl_lang_std "CL3.0" )
390
+ if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
395
391
set ( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
396
392
set ( opt_flags )
397
393
set ( spvflags --spirv-max-version=1.1 )
398
394
set ( MACRO_ARCH SPIRV32 )
399
395
if ( ARCH STREQUAL spirv64 )
400
396
set ( MACRO_ARCH SPIRV64 )
401
397
endif ()
402
- elseif ( DARCH STREQUAL clspv )
403
- # Refer to https://github.com/google/clspv for OpenCL version.
404
- set ( opencl_lang_std "CL3.0" )
398
+ elseif ( ARCH STREQUAL clspv OR ARCH STREQUAL clspv64 )
405
399
set ( build_flags "-Wno-unknown-assumption" -DCLC_CLSPV )
406
400
set ( opt_flags -O3 )
407
401
set ( MACRO_ARCH CLSPV32 )
408
402
if ( ARCH STREQUAL clspv64 )
409
403
set ( MACRO_ARCH CLSPV64 )
410
404
endif ()
411
- elseif ( DARCH STREQUAL nvptx )
412
- # Refer to https://developer.nvidia.com/opencl for OpenCL version.
413
- set ( opencl_lang_std "CL3.0" )
414
- set ( build_flags )
415
- set ( opt_flags -O3 )
416
- set ( MACRO_ARCH ${ARCH} )
417
- elseif ( DARCH STREQUAL amdgcn OR DARCH STREQUAL amdgcn-amdhsa )
418
- # Refer to https://github.com/ROCm/clr/tree/develop/opencl for OpenCL version.
419
- set ( opencl_lang_std "CL2.0" )
420
- set ( build_flags )
421
- set ( opt_flags -O3 )
422
- set ( MACRO_ARCH ${ARCH} )
423
405
else ()
424
406
set ( build_flags )
425
407
set ( opt_flags -O3 )
@@ -429,7 +411,9 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
429
411
set ( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR} /${arch_suffix} " )
430
412
file ( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
431
413
432
- list ( APPEND build_flags -cl-std=${opencl_lang_std} )
414
+ # Build for OpenCL 3.0 and enable all extensions and features independently
415
+ # of the target or device.
416
+ list ( APPEND build_flags -cl-std=CL3.0 -Xclang -cl-ext=+all )
433
417
434
418
string ( TOUPPER "CLC_${MACRO_ARCH} " CLC_TARGET_DEFINE )
435
419
0 commit comments