[libclc] [libclc] Set OpenCL C version for each target (PR #135733)
Fraser Cormack via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 16 01:21:33 PDT 2025
================
@@ -387,21 +387,39 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
message( STATUS " device: ${d} ( ${${d}_aliases} )" )
- if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 )
+ # 1.2 is Clang's default OpenCL C language standard to compile for.
+ set( opencl_lang_std "CL1.2" )
+
+ if ( ${DARCH} STREQUAL spirv )
+ set( opencl_lang_std "CL3.0" )
set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV )
set( opt_flags )
set( spvflags --spirv-max-version=1.1 )
set( MACRO_ARCH SPIRV32 )
if( ARCH STREQUAL spirv64 )
set( MACRO_ARCH SPIRV64 )
endif()
- elseif( ARCH STREQUAL clspv OR ARCH STREQUAL clspv64 )
+ elseif( ${DARCH} STREQUAL clspv )
+ # Refer to https://github.com/google/clspv for OpenCL version.
+ set( opencl_lang_std "CL3.0" )
----------------
frasercrmck wrote:
Does this look okay, @rjodinchr?
https://github.com/llvm/llvm-project/pull/135733
More information about the cfe-commits
mailing list