@@ -12,7 +12,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
1212include (CheckLanguage)
1313enable_testing ()
1414
15- find_package (IntelDPCPP REQUIRED)
15+ find_package (IntelSYCL REQUIRED)
1616
1717if (BUILD_FOTRAN_EXAMPLES)
1818 check_language(Fortran)
@@ -39,36 +39,44 @@ string(CONCAT WARNING_CXX_FLAGS_STR
3939string (REPLACE " " ";" COMMON_CXX_FLAGS "${WARNING_CXX_FLAGS_STR} " )
4040
4141function (add_example_with_mkl name )
42- add_executable (${name} ${name} .cpp)
42+ set (_sources ${name} .cpp)
43+ add_executable (${name} ${_sources} )
44+ add_sycl_to_target(TARGET ${_name} SOURCES ${_sources} )
4345 target_compile_options (${name} PRIVATE ${COMMON_CXX_FLAGS} )
4446 target_compile_options (${name} PRIVATE -fiopenmp -fopenmp-targets=spir64 -qmkl)
45- target_link_libraries (${name} PRIVATE MKL::MKL_DPCPP )
47+ target_link_libraries (${name} PRIVATE MKL::MKL_SYCL )
4648 target_link_options (${name} PRIVATE -fiopenmp -fopenmp-targets=spir64 -qmkl -lOpenCL)
4749 add_test (NAME ${name} COMMAND ${name} ${ARGN} )
4850endfunction (add_example_with_mkl)
4951
5052function (add_fortran_example_with_mkl name )
5153 if (CMAKE_Fortran_COMPILER)
52- add_executable (${name} ${name} .f)
54+ set (_sources ${name} .f)
55+ add_executable (${name} ${_sources} )
56+ add_sycl_to_target(TARGET ${name} SOURCES ${_sources} )
5357 target_compile_options (${name} PRIVATE -warn all )
5458 target_compile_options (${name} PRIVATE -fiopenmp -fopenmp-targets=spir64 -qmkl -fpp -free)
5559 set_target_properties (${name} PROPERTIES LINKER_LANGUAGE Fortran)
56- target_link_libraries (${name} PUBLIC MKL::MKL_DPCPP )
60+ target_link_libraries (${name} PUBLIC MKL::MKL_MKL )
5761 target_link_options (${name} PRIVATE -fiopenmp -fopenmp-targets=spir64 -qmkl -lOpenCL)
5862 add_test (NAME ${name} COMMAND ${name} ${ARGN} )
5963 endif ()
6064endfunction (add_fortran_example_with_mkl)
6165
6266function (add_example name )
63- add_executable (${name} ${name} .cpp)
67+ set (_sources ${name} .cpp)
68+ add_executable (${name} ${_sources} )
69+ add_sycl_to_target(TARGET ${name} SOURCES ${_sources} )
6470 target_compile_options (${name} PRIVATE ${COMMON_CXX_FLAGS} )
6571 target_link_options (${name} PRIVATE -fsycl-device-code-split=per_kernel)
6672 add_test (NAME ${name} COMMAND ${name} ${ARGN} )
6773endfunction (add_example)
6874
6975function (add_fortran_example name )
7076 if (CMAKE_Fortran_COMPILER)
71- add_executable (${name} ${name} .f90)
77+ set (_sources ${name} .f90)
78+ add_executable (${name} ${_sources} )
79+ add_sycl_to_target(TARGET ${name} SOURCES ${_sources} )
7280 target_compile_options (${name} PRIVATE -warn all )
7381 target_compile_options (${name} PRIVATE -fiopenmp -fopenmp-targets=spir64)
7482 set_target_properties (${name} PROPERTIES LINKER_LANGUAGE Fortran)
@@ -79,7 +87,9 @@ endfunction(add_fortran_example)
7987
8088function (add_mpi_example name )
8189 if (MPI_FOUND)
82- add_executable (${name} ${name} .cpp)
90+ set (_sources ${name} .cpp)
91+ add_executable (${name} ${_sources} )
92+ add_sycl_to_target(TARGET ${name} SOURCES ${_sources} )
8393 target_compile_options (${name} PRIVATE -O3 -fiopenmp -fopenmp-targets=spir64)
8494 target_link_options (${name} PRIVATE -O3 -fiopenmp -fopenmp-targets=spir64)
8595 target_link_libraries (${name} PRIVATE MPI::MPI_CXX)
0 commit comments