mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add support for triSYCL
Eigen is now able to use triSYCL with EIGEN_SYCL_TRISYCL and TRISYCL_INCLUDE_DIR options Fix contraction kernel with correct nd_item dimension
This commit is contained in:
@@ -111,7 +111,7 @@ endmacro(ei_add_test_internal)
|
||||
|
||||
# SYCL
|
||||
macro(ei_add_test_internal_sycl testname testname_with_suffix)
|
||||
include_directories( SYSTEM ${COMPUTECPP_PACKAGE_ROOT_DIR}/include)
|
||||
|
||||
set(targetname ${testname_with_suffix})
|
||||
|
||||
if(EIGEN_ADD_TEST_FILENAME_EXTENSION)
|
||||
@@ -124,18 +124,25 @@ macro(ei_add_test_internal_sycl testname testname_with_suffix)
|
||||
set( bc_file ${CMAKE_CURRENT_BINARY_DIR}/${filename})
|
||||
set( host_file ${CMAKE_CURRENT_SOURCE_DIR}/${filename})
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${include_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${host_file}\\\"" > ${include_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${bc_file}.sycl\\\"" >> ${include_file}
|
||||
DEPENDS ${filename} ${bc_file}.sycl
|
||||
COMMENT "Building ComputeCpp integration header file ${include_file}"
|
||||
)
|
||||
# Add a custom target for the generated integration header
|
||||
add_custom_target(${testname}_integration_header_sycl DEPENDS ${include_file})
|
||||
if(NOT EIGEN_SYCL_TRISYCL)
|
||||
include_directories( SYSTEM ${COMPUTECPP_PACKAGE_ROOT_DIR}/include)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${include_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${host_file}\\\"" > ${include_file}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${bc_file}.sycl\\\"" >> ${include_file}
|
||||
DEPENDS ${filename} ${bc_file}.sycl
|
||||
COMMENT "Building ComputeCpp integration header file ${include_file}"
|
||||
)
|
||||
|
||||
# Add a custom target for the generated integration header
|
||||
add_custom_target(${testname}_integration_header_sycl DEPENDS ${include_file})
|
||||
add_executable(${targetname} ${include_file})
|
||||
add_dependencies(${targetname} ${testname}_integration_header_sycl)
|
||||
else()
|
||||
add_executable(${targetname} ${host_file})
|
||||
endif()
|
||||
|
||||
add_executable(${targetname} ${include_file})
|
||||
add_dependencies(${targetname} ${testname}_integration_header_sycl)
|
||||
add_sycl_to_target(${targetname} ${filename} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if (targetname MATCHES "^eigen2_")
|
||||
@@ -467,7 +474,11 @@ macro(ei_testing_print_summary)
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_SYCL)
|
||||
message(STATUS "SYCL: ON")
|
||||
if(EIGEN_SYCL_TRISYCL)
|
||||
message(STATUS "SYCL: ON (using triSYCL)")
|
||||
else()
|
||||
message(STATUS "SYCL: ON (using computeCPP)")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "SYCL: OFF")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user