Merge changed from upstream

This commit is contained in:
a-doumoulakis
2017-05-24 17:45:29 +01:00
4 changed files with 32 additions and 32 deletions

View File

@@ -111,7 +111,6 @@ endmacro(ei_add_test_internal)
# SYCL
macro(ei_add_test_internal_sycl testname testname_with_suffix)
set(targetname ${testname_with_suffix})
if(EIGEN_ADD_TEST_FILENAME_EXTENSION)
@@ -120,9 +119,9 @@ macro(ei_add_test_internal_sycl testname testname_with_suffix)
set(filename ${testname}.cpp)
endif()
set( include_file ${CMAKE_CURRENT_BINARY_DIR}/inc_${filename})
set( bc_file ${CMAKE_CURRENT_BINARY_DIR}/${filename})
set( host_file ${CMAKE_CURRENT_SOURCE_DIR}/${filename})
set( include_file "${CMAKE_CURRENT_BINARY_DIR}/inc_${filename}")
set( bc_file "${CMAKE_CURRENT_BINARY_DIR}/${filename}.sycl")
set( host_file "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
if(NOT EIGEN_SYCL_TRISYCL)
include_directories( SYSTEM ${COMPUTECPP_PACKAGE_ROOT_DIR}/include)
@@ -130,20 +129,21 @@ macro(ei_add_test_internal_sycl testname testname_with_suffix)
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
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${bc_file}\\\"" >> ${include_file}
DEPENDS ${filename} ${bc_file}
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_custom_target("${testname}_integration_header_sycl" DEPENDS ${include_file})
add_executable(${targetname} ${include_file})
add_dependencies(${targetname} ${testname}_integration_header_sycl)
add_dependencies(${targetname} "${testname}_integration_header_sycl")
else()
add_executable(${targetname} ${host_file})
endif()
add_sycl_to_target(${targetname} ${filename} ${CMAKE_CURRENT_BINARY_DIR})
add_sycl_to_target(${targetname} ${CMAKE_CURRENT_BINARY_DIR} ${filename})
if (targetname MATCHES "^eigen2_")
add_dependencies(eigen2_buildtests ${targetname})

View File

@@ -201,7 +201,8 @@ function(__build_spir targetName sourceFile binaryDir)
${device_compiler_includes}
-o ${outputSyclFile}
-c ${CMAKE_CURRENT_SOURCE_DIR}/${sourceFile}
DEPENDS ${sourceFile}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${sourceFile}
IMPLICIT_DEPENDS CXX "${CMAKE_CURRENT_SOURCE_DIR}/${sourceFile}"
WORKING_DIRECTORY ${binaryDir}
COMMENT "Building ComputeCpp integration header file ${outputSyclFile}")
@@ -233,8 +234,9 @@ endfunction()
# sourceFile : Source file to be compiled for SYCL.
# binaryDir : Intermediate directory to output the integration header.
#
function(add_sycl_to_target targetName sourceFile binaryDir)
function(add_sycl_to_target targetName binaryDir sourceFile)
set(sourceFiles ${sourceFiles} ${ARGN})
# Add custom target to run compute++ and generate the integration header
__build_spir(${targetName} ${sourceFile} ${binaryDir})
@@ -242,4 +244,4 @@ function(add_sycl_to_target targetName sourceFile binaryDir)
target_link_libraries(${targetName} PUBLIC ${COMPUTECPP_RUNTIME_LIBRARY}
PUBLIC ${OpenCL_LIBRARIES})
endfunction(add_sycl_to_target)
endfunction(add_sycl_to_target)