Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLIR] Update FindSyclRuntime.cmake to handle SYCL library path chang… #75861

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

silee2
Copy link
Contributor

@silee2 silee2 commented Dec 18, 2023

…e introduced by oneAPI DPC++ compiler 2024.0

…e introduced by oneAPI DPC++ compiler 2024.0
@llvmbot llvmbot added the mlir label Dec 18, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 18, 2023

@llvm/pr-subscribers-mlir

Author: Sang Ik Lee (silee2)

Changes

…e introduced by oneAPI DPC++ compiler 2024.0


Full diff: https://github.com/llvm/llvm-project/pull/75861.diff

1 Files Affected:

  • (modified) mlir/cmake/modules/FindSyclRuntime.cmake (+9-4)
diff --git a/mlir/cmake/modules/FindSyclRuntime.cmake b/mlir/cmake/modules/FindSyclRuntime.cmake
index 38b065a3f284c2..9e6ae040258487 100644
--- a/mlir/cmake/modules/FindSyclRuntime.cmake
+++ b/mlir/cmake/modules/FindSyclRuntime.cmake
@@ -17,10 +17,15 @@ if(NOT DEFINED ENV{CMPLR_ROOT})
     message(WARNING "Please make sure to install Intel DPC++ Compiler and run setvars.(sh/bat)")
     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")
 else()
-    if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
-        set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux")
-    elseif(WIN32)
-        set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows")
+    get_filename_component(ONEAPI_VER "$ENV{CMPLR_ROOT}" NAME)
+    if(ONEAPI_VER VERSION_LESS 2024.0)
+        if(LINUX OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
+            set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/linux")
+        elseif(WIN32)
+            set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}/windows")
+        endif()
+    else()
+        set(SyclRuntime_ROOT "$ENV{CMPLR_ROOT}")
     endif()
     list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include")
     list(APPEND SyclRuntime_INCLUDE_DIRS "${SyclRuntime_ROOT}/include/sycl")

Copy link
Contributor

@drprajap drprajap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mshahneo mshahneo merged commit 8197ea2 into llvm:main Dec 19, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants