Skip to content

Commit bfe532b

Browse files
Changes to build_backend.py
to enable sycl-compiler-prefix on Windows
1 parent 775eef3 commit bfe532b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/build_backend.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def build_backend(
3939

4040
if sycl_compiler_prefix is None:
4141
oneapi_root = os.getenv("ONEAPI_ROOT")
42+
if oneapi_root is None:
43+
raise ValueError("Environment variable ONEAPI_ROOT is not set")
4244
if IS_LIN:
4345
DPCPP_ROOT = os.path.join(oneapi_root, r"compiler/latest/linux")
4446
elif IS_WIN:
@@ -159,14 +161,17 @@ def build_backend(
159161
elif IS_WIN:
160162
if os.path.exists(os.path.join(DPCPP_ROOT, "bin", "dpcpp.exe")):
161163
cmake_compiler_args = [
164+
"-DDPCTL_DPCPP_HOME_DIR=" + DPCPP_ROOT,
165+
"-DDPCTL_DPCPP_FROM_ONEAPI=ON",
162166
"-DCMAKE_C_COMPILER:PATH="
163167
+ os.path.join(DPCPP_ROOT, "bin", "clang-cl.exe"),
164168
"-DCMAKE_CXX_COMPILER:PATH="
165169
+ os.path.join(DPCPP_ROOT, "bin", "dpcpp.exe"),
166170
]
167171
else:
168172
cmake_compiler_args = [
169-
"-DDPCTL_CUSTOM_DPCPP_INSTALL_DIR=" + DPCPP_ROOT,
173+
"-DDPCTL_DPCPP_HOME_DIR=" + DPCPP_ROOT,
174+
"-DDPCTL_DPCPP_FROM_ONEAPI=OFF",
170175
"-DCMAKE_C_COMPILER:PATH="
171176
+ os.path.join(DPCPP_ROOT, "bin", "clang-cl.exe"),
172177
"-DCMAKE_CXX_COMPILER:PATH="

0 commit comments

Comments
 (0)