Skip to content

Commit f188dde

Browse files
committed
Fix Intel SYCL CI toolchain wiring
1 parent 2bd0e06 commit f188dde

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ set_property(CACHE ITLABAI_SYCL_IMPLEMENTATION PROPERTY STRINGS
1212
IntelLLVM AdaptiveCpp)
1313
set(ITLABAI_SYCL_TARGETS "" CACHE STRING
1414
"Optional SYCL targets; forwarded to AdaptiveCpp as ACPP_TARGETS or IntelLLVM as -fsycl-targets")
15+
set(ITLABAI_SYCL_ROOT "" CACHE PATH
16+
"Optional root directory of the SYCL toolchain; used to expose SYCL headers to host-only sources")
1517

1618
option(ENABLE_STATISTIC_TENSORS "Enable statistic tensors" OFF)
1719

@@ -67,6 +69,10 @@ if(ITLABAI_ENABLE_SYCL)
6769
add_sycl_to_target(${ARGN})
6870
endfunction()
6971
elseif(ITLABAI_SYCL_IMPLEMENTATION STREQUAL "IntelLLVM")
72+
set(ITLABAI_INTEL_SYCL_INCLUDE_DIRS "")
73+
if(ITLABAI_SYCL_ROOT AND EXISTS "${ITLABAI_SYCL_ROOT}/include")
74+
list(APPEND ITLABAI_INTEL_SYCL_INCLUDE_DIRS "${ITLABAI_SYCL_ROOT}/include")
75+
endif()
7076
function(itlabai_add_sycl_to_target)
7177
set(options)
7278
set(one_value_keywords TARGET)
@@ -82,6 +88,12 @@ if(ITLABAI_ENABLE_SYCL)
8288
message(FATAL_ERROR "itlabai_add_sycl_to_target requires TARGET")
8389
endif()
8490

91+
if(ITLABAI_INTEL_SYCL_INCLUDE_DIRS)
92+
target_include_directories(${ITLABAI_SYCL_TARGET} PRIVATE
93+
${ITLABAI_INTEL_SYCL_INCLUDE_DIRS}
94+
)
95+
endif()
96+
8597
target_link_options(${ITLABAI_SYCL_TARGET} PRIVATE -fsycl)
8698

8799
if(ITLABAI_SYCL_SOURCES)

scripts/ci/sycl_configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def main() -> None:
5555
if itlabai_sycl_targets:
5656
cmake_args.append(f"-DITLABAI_SYCL_TARGETS={itlabai_sycl_targets}")
5757

58+
itlabai_sycl_root = os.environ.get("SYCL_ROOT", "")
59+
if itlabai_sycl_root:
60+
cmake_args.append(f"-DITLABAI_SYCL_ROOT={itlabai_sycl_root}")
61+
5862
c_flags = os.environ.get("ITLABAI_C_FLAGS", "")
5963
cxx_flags = os.environ.get("ITLABAI_CXX_FLAGS", "")
6064
gcc_install_dir = os.environ.get("ITLABAI_GCC_INSTALL_DIR", "")

scripts/ci/sycl_x86_setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,17 @@ def setup_windows_compilers(sycl_root: Path) -> None:
214214
cc_path = find_first_existing(
215215
[
216216
sycl_root / "bin" / "icx.exe",
217+
sycl_root / "bin" / "clang.exe",
217218
sycl_root / "bin" / "icx-cl.exe",
218219
sycl_root / "bin" / "clang-cl.exe",
219-
sycl_root / "bin" / "clang.exe",
220220
]
221221
)
222222
cxx_path = find_first_existing(
223223
[
224224
sycl_root / "bin" / "icpx.exe",
225+
sycl_root / "bin" / "clang++.exe",
225226
sycl_root / "bin" / "icx-cl.exe",
226227
sycl_root / "bin" / "clang-cl.exe",
227-
sycl_root / "bin" / "clang++.exe",
228228
]
229229
)
230230

@@ -290,7 +290,7 @@ def setup_unix_compilers(sycl_root: Path) -> None:
290290
if gcc_openmp_header is not None and gcc_openmp_library.exists():
291291
openmp_library = gcc_openmp_library
292292
openmp_library_name = "gomp"
293-
openmp_flags = "-fopenmp"
293+
openmp_flags = "-fopenmp=libgomp"
294294
if openmp_library is None and not source_built_linux_toolchain:
295295
main_error("Unable to locate an Intel toolchain OpenMP runtime library")
296296

0 commit comments

Comments
 (0)