mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Add default XPU toolkit path to CMake (#149270)
# Motivation Add default XPU runtime path to CMake to mitigate https://github.com/pytorch/pytorch/issues/149075 This ensures proper linking with `libtorch` when a user does not source the Torch XPU toolkit while working on a C++ library or executable. Pull Request resolved: https://github.com/pytorch/pytorch/pull/149270 Approved by: https://github.com/dvrogozh, https://github.com/EikanWang, https://github.com/atalman
This commit is contained in:
parent
66b0a0b61a
commit
db9b031b00
|
|
@ -12,6 +12,16 @@ if(DEFINED ENV{SYCL_ROOT})
|
|||
set(SYCL_ROOT $ENV{SYCL_ROOT})
|
||||
elseif(DEFINED ENV{CMPLR_ROOT})
|
||||
set(SYCL_ROOT $ENV{CMPLR_ROOT})
|
||||
else()
|
||||
# Use the default path to ensure proper linking with torch::xpurt when the user is working with libtorch.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(SYCL_ROOT "/opt/intel/oneapi/compiler/latest")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(SYCL_ROOT "C:/Program Files (x86)/Intel/oneAPI/compiler/latest")
|
||||
endif()
|
||||
if(NOT EXISTS ${SYCL_ROOT})
|
||||
set(SYCL_ROOT "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(COMPARE EQUAL "${SYCL_ROOT}" "" nosyclfound)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user