Skip to content

Commit

Permalink
fix handling of user specified SYCL link flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosborn committed Nov 2, 2023
1 parent 2918ed9 commit e0afb86
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/targets/sycl/target_sycl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,28 @@ endif()

if(DEFINED ENV{SYCL_FLAGS})
set(SYCL_FLAGS $ENV{SYCL_FLAGS})
string(APPEND CMAKE_SYCL_FLAGS " ${SYCL_FLAGS}")
endif()

if(DEFINED ENV{SYCL_LINK_FLAGS})
separate_arguments(SYCL_LINK_FLAGS NATIVE_COMMAND $ENV{SYCL_LINK_FLAGS})
#separate_arguments(SYCL_LINK_FLAGS NATIVE_COMMAND $ENV{SYCL_LINK_FLAGS})
set(SYCL_LINK_FLAGS $ENV{SYCL_LINK_FLAGS})
#string(APPEND CMAKE_EXE_LINKER_FLAGS " ${SYCL_LINK_FLAGS}")
target_link_options(quda PUBLIC "SHELL:${SYCL_LINK_FLAGS}")
endif()

target_include_directories(quda PRIVATE ${CMAKE_SOURCE_DIR}/include/targets/sycl)
target_include_directories(quda PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include/targets/sycl>
$<INSTALL_INTERFACE:include/targets/sycl>)

#set(CMAKE_SYCL_FLAGS "-x c++ ${CMAKE_SYCL_FLAGS}")
string(APPEND CMAKE_SYCL_FLAGS " -x c++")
#set_source_files_properties(${QUDA_CU_OBJS} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${QUDA_CU_OBJS} PROPERTIES LANGUAGE SYCL)
if(SYCL_FLAGS)
set_source_files_properties(${QUDA_CU_OBJS} PROPERTIES COMPILE_FLAGS ${SYCL_FLAGS})
endif()
target_link_options(quda PUBLIC ${SYCL_LINK_FLAGS})
#if(SYCL_FLAGS)
# set_source_files_properties(${QUDA_CU_OBJS} PROPERTIES COMPILE_FLAGS ${SYCL_FLAGS})
#endif()
#target_link_options(quda PUBLIC ${SYCL_LINK_FLAGS})
#set_property(TARGET quda APPEND_STRING PROPERTY LINK_FLAGS " ${SYCL_LINK_FLAGS}")

set(SYCL_MKL_LIBRARY "-lmkl_sycl -lmkl_intel_ilp64 -lmkl_core -lmkl_tbb_thread")

Expand Down

0 comments on commit e0afb86

Please sign in to comment.