37 lines
835 B
CMake
37 lines
835 B
CMake
cmake_minimum_required(VERSION 3.25)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
project(sycl_example)
|
|
|
|
option(USE_INTELSYCL "Use Intel oneAPI compiler" OFF)
|
|
option(USE_ACPP "Use AdaptiveCpp compiler" OFF)
|
|
|
|
if(USE_INTELSYCL AND USE_ACPP)
|
|
message(FATAL_ERROR "Only one SYCL compiler can be selected.")
|
|
endif()
|
|
|
|
if(USE_INTELSYCL)
|
|
find_package(IntelSYCL REQUIRED)
|
|
elseif(USE_ACPP)
|
|
find_package(AdaptiveCpp REQUIRED)
|
|
else()
|
|
message(FATAL_ERROR "Set either -DUSE_INTELSYCL or -DUSE_ACPP.")
|
|
endif()
|
|
|
|
|
|
|
|
find_library(LIB_XXHASH xxhash)
|
|
|
|
message(STATUS "${IntelSYCL_FOUND}")
|
|
|
|
if ((NOT(AdaptiveCpp_FOUND)) AND (NOT(IntelSYCL_FOUND)))
|
|
message(FATAL_ERROR
|
|
"Could not find either AdaptiveCpp or IntelDPCPP.
|
|
Install one of them and provide -D<Compiler>_DIR=/path/to/cmake/config.
|
|
Configuration not possible.")
|
|
endif()
|
|
|
|
|
|
add_subdirectory(src)
|