Skip to content

Commit 8197ea2

Browse files
authored
[MLIR] Update FindSyclRuntime.cmake to handle SYCL library path chang… (llvm#75861)
…e introduced by oneAPI DPC++ compiler 2024.0
1 parent b3d024c commit 8197ea2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mlir/cmake/modules/FindSyclRuntime.cmake

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ if(NOT DEFINED ENV{CMPLR_ROOT})
1717
message(WARNING "Please make sure to install Intel DPC++ Compiler and run setvars.(sh/bat)")
1818
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")
1919
else()
20-
if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
21-
set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux")
22-
elseif(WIN32)
23-
set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows")
20+
get_filename_component(ONEAPI_VER "$ENV{CMPLR_ROOT}" NAME)
21+
if(ONEAPI_VER VERSION_LESS 2024.0)
22+
if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
23+
set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux")
24+
elseif(WIN32)
25+
set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows")
26+
endif()
27+
else()
28+
set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}")
2429
endif()
2530
list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include")
2631
list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include/sycl")

0 commit comments

Comments
 (0)