Skip to content

Commit 3ffee67

Browse files
authored
[libspirv] Don't force fp16/fp64 OpenCL extensions (#18961)
Enabling these (or any extensions, really) by default is incorrect and prevents the r600 OpenCL builtins from being built. Each clang target reports which OpenCL extensions it does or doesn't support. This commit also moves the flag enabling SPIR-V builtin declarations to the SPIR-V options. They are not needed for the compilation of CLC or OpenCL builtins. There is no change to any builtins file.
1 parent 57e2877 commit 3ffee67

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libclc/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,12 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
489489
set( MACRO_ARCH ${ARCH} )
490490
endif()
491491

492-
# Enable SPIR-V builtin function declarations, so they don't
493-
# have to be explicity declared in the soruce.
494-
list( APPEND build_flags -Xclang -fdeclare-spirv-builtins)
495492
set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" )
496493
file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} )
497494

498495
# OpenCL 3.0 extensions
499496
string(CONCAT CL_3_0_EXTENSIONS
500497
"-cl-ext="
501-
"+cl_khr_fp64,"
502-
"+cl_khr_fp16,"
503498
"+__opencl_c_3d_image_writes,"
504499
"+__opencl_c_images,"
505500
"+cl_khr_3d_image_writes")
@@ -573,6 +568,9 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
573568
if( BUILD_LIBSPIRV_${t} )
574569
set( spirv_build_flags ${build_flags} )
575570
list( APPEND spirv_build_flags
571+
# Enable SPIR-V builtin function declarations, so they don't have to be
572+
# explicity declared in the soruce.
573+
-Xclang -fdeclare-spirv-builtins
576574
-I${CMAKE_CURRENT_SOURCE_DIR}/opencl/include
577575
-I${CMAKE_CURRENT_SOURCE_DIR}/libspirv/include/
578576
)

0 commit comments

Comments
 (0)