|
27 | 27 |
|
28 | 28 | include(FindPackageHandleStandardArgs)
|
29 | 29 |
|
30 |
| -if(NOT DEFINED ENV{CMPLR_ROOT}) |
| 30 | +if(NOT DEFINED ENV{CMPLR_ROOT} AND NOT DEFINED ENV{SYCL_DIR}) |
31 | 31 | message(WARNING "Please make sure to install Intel DPC++ Compiler and run setvars.(sh/bat)")
|
32 | 32 | message(WARNING "You can download standalone Intel DPC++ Compiler from https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#compilers")
|
| 33 | + message(Warning "Alternatively, you can set environment SYCL_DIR to the install dir of SYCL") |
33 | 34 | else()
|
34 |
| - get_filename_component(ONEAPI_VER "$ENV{CMPLR_ROOT}" NAME) |
35 |
| - # Adding more precise detection for SYCL runtime folder name |
36 |
| - if (ONEAPI_VER) |
37 |
| - string(REGEX MATCH "[0-9]+.[0-9]+[.0-9]*" VER_NUMBER ${ONEAPI_VER}) |
| 35 | + if(DEFINED ENV{SYCL_DIR}) |
| 36 | + set(SyclRuntime_ROOT "$ENV{SYCL_DIR}") |
38 | 37 | else()
|
39 |
| - set(VER_NUMBER FALSE) |
40 |
| - endif() |
| 38 | + get_filename_component(ONEAPI_VER "$ENV{CMPLR_ROOT}" NAME) |
| 39 | + # Adding more precise detection for SYCL runtime folder name |
| 40 | + if (ONEAPI_VER) |
| 41 | + string(REGEX MATCH "[0-9]+.[0-9]+[.0-9]*" VER_NUMBER ${ONEAPI_VER}) |
| 42 | + else() |
| 43 | + set(VER_NUMBER FALSE) |
| 44 | + endif() |
41 | 45 |
|
42 |
| - if(VER_NUMBER AND ONEAPI_VER VERSION_LESS 2024.0) |
43 |
| - if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) |
44 |
| - set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux") |
45 |
| - elseif(WIN32) |
46 |
| - set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows") |
| 46 | + if(VER_NUMBER AND ONEAPI_VER VERSION_LESS 2024.0) |
| 47 | + if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) |
| 48 | + set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux") |
| 49 | + elseif(WIN32) |
| 50 | + set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows") |
| 51 | + endif() |
| 52 | + else() |
| 53 | + set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}") |
47 | 54 | endif()
|
48 |
| - else() |
49 |
| - set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}") |
50 | 55 | endif()
|
| 56 | + |
51 | 57 | list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include")
|
52 | 58 | list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include/sycl")
|
53 | 59 |
|
|
0 commit comments