-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SYCL as a CMake compiler
- Loading branch information
Showing
13 changed files
with
221 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
if(NOT CMAKE_SYCL_COMPILER) | ||
set(CMAKE_SYCL_COMPILER ${CMAKE_CXX_COMPILER}) | ||
endif() | ||
mark_as_advanced(CMAKE_SYCL_COMPILER) | ||
message(STATUS "The SYCL compiler is " ${CMAKE_SYCL_COMPILER}) | ||
|
||
if(NOT CMAKE_SYCL_COMPILER_ID_RUN) | ||
set(CMAKE_SYCL_COMPILER_ID_RUN 1) | ||
|
||
# Try to identify the compiler. | ||
set(CMAKE_SYCL_COMPILER_ID) | ||
set(CMAKE_SYCL_PLATFORM_ID) | ||
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in CMAKE_SYCL_COMPILER_ID_PLATFORM_CONTENT) | ||
|
||
set(CMAKE_SYCL_COMPILER_ID_TEST_FLAGS_FIRST) | ||
set(CMAKE_SYCL_COMPILER_ID_TEST_FLAGS) | ||
|
||
set(CMAKE_CXX_COMPILER_ID_CONTENT "#if defined(__INTEL_LLVM_COMPILER)\n# define COMPILER_ID \"IntelLLVM\"\n") | ||
string(APPEND CMAKE_CXX_COMPILER_ID_CONTENT "#elif defined(__clang__)\n# define COMPILER_ID \"Clang\"\n") | ||
string(APPEND CMAKE_CXX_COMPILER_ID_CONTENT "#endif\n") | ||
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) | ||
CMAKE_DETERMINE_COMPILER_ID(SYCL SYCLFLAGS CMakeCXXCompilerId.cpp) | ||
|
||
_cmake_find_compiler_sysroot(SYCL) | ||
endif() | ||
|
||
|
||
#set(CMAKE_SYCL_COMPILER_ID_TEST_FLAGS_FIRST) | ||
#set(CMAKESYCL_COMPILER_ID_TEST_FLAGS "-c") | ||
#include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) | ||
#CMAKE_DETERMINE_COMPILER_ID(SYCL SYCLFLAGS CMakeCXXCompilerId.cpp) | ||
|
||
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeSYCLCompiler.cmake.in | ||
${CMAKE_PLATFORM_INFO_DIR}/CMakeSYCLCompiler.cmake) | ||
|
||
set(CMAKE_SYCL_COMPILER_ENV_VAR "SYCL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(CMAKE_SYCL_COMPILER "@CMAKE_SYCL_COMPILER@") | ||
set(CMAKE_SYCL_COMPILER_LOADED 1) | ||
set(CMAKE_SYCL_COMPILER_ENV_VAR "SYCL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
if(NOT CMAKE_SYCL_COMPILE_OPTIONS_PIC) | ||
set(CMAKE_SYCL_COMPILE_OPTIONS_PIC ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) | ||
endif() | ||
|
||
if(NOT CMAKE_SYCL_COMPILE_OPTIONS_PIE) | ||
set(CMAKE_SYCL_COMPILE_OPTIONS_PIE ${CMAKE_CXX_COMPILE_OPTIONS_PIE}) | ||
endif() | ||
if(NOT CMAKE_SYCL_LINK_OPTIONS_PIE) | ||
set(CMAKE_SYCL_LINK_OPTIONS_PIE ${CMAKE_CXX_LINK_OPTIONS_PIE}) | ||
endif() | ||
if(NOT CMAKE_SYCL_LINK_OPTIONS_NO_PIE) | ||
set(CMAKE_SYCL_LINK_OPTIONS_NO_PIE ${CMAKE_CXX_LINK_OPTIONS_NO_PIE}) | ||
endif() | ||
|
||
if(NOT CMAKE_SYCL_OUTPUT_EXTENSION) | ||
set(CMAKE_SYCL_OUTPUT_EXTENSION ${CMAKE_CXX_OUTPUT_EXTENSION}) | ||
endif() | ||
|
||
if(NOT CMAKE_INCLUDE_FLAG_SYCL) | ||
set(CMAKE_INCLUDE_FLAG_SYCL ${CMAKE_INCLUDE_FLAG_CXX}) | ||
endif() | ||
|
||
if(NOT CMAKE_SYCL_COMPILE_OBJECT) | ||
set(CMAKE_SYCL_COMPILE_OBJECT "<CMAKE_SYCL_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") | ||
endif() | ||
|
||
if(NOT CMAKE_SYCL_LINK_EXECUTABLE) | ||
set(CMAKE_SYCL_LINK_EXECUTABLE "<CMAKE_SYCL_COMPILER> <FLAGS> <CMAKE_SYCL_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") | ||
endif() | ||
|
||
set(CMAKE_SYCL_INFORMATION_LOADED 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(CMAKE_SYCL_COMPILER_WORKS 1 CACHE INTERNAL "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.