Skip to content

Commit 8847c11

Browse files
authored
[SYCL][NATIVECPU][libclc]Mark opencl_c_generic_address_space as unsupported on Native CPU (#13109)
Similarly to what is done for `nvptx` in #13015, Native CPU maps `private` and `generic` to the same address spaces, so we need to avoid getting multiple definitions for the libclc builtins that use `generic`.
1 parent 1e894d1 commit 8847c11

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libclc/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
435435
set( t "spir64--" )
436436
set( build_flags "-Wno-unknown-assumption")
437437
set( opt_flags -O3 )
438+
elseif( ${ARCH} STREQUAL "x86_64")
439+
set( supports_generic_addrspace FALSE )
438440
else()
439441
set( build_flags )
440442
set( opt_flags -O3 )
@@ -455,6 +457,13 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
455457
"+cl_khr_3d_image_writes")
456458
if(supports_generic_addrspace)
457459
string( APPEND CL_3_0_EXTENSIONS ",+__opencl_c_generic_address_space" )
460+
else()
461+
# Explictly disable opencl_c_generic_address_space (it may be enabled
462+
# by default on some targets). We also disable opencl_c_pipes and
463+
# opencl_c_device_enqueue since they require generic address space.
464+
string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_generic_address_space" )
465+
string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_pipes" )
466+
string( APPEND CL_3_0_EXTENSIONS ",-__opencl_c_device_enqueue" )
458467
endif()
459468
list( APPEND flags ${CL_3_0_EXTENSIONS})
460469

0 commit comments

Comments
 (0)