Skip to content

Commit 8b35b01

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into llvmspirv_pulldown
Closes: #18403
2 parents 4bbb39d + 2ce5fef commit 8b35b01

File tree

28 files changed

+1492
-760
lines changed

28 files changed

+1492
-760
lines changed

devops/scripts/benchmarks/benches/compute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def git_url(self) -> str:
4949
return "https://github.com/intel/compute-benchmarks.git"
5050

5151
def git_hash(self) -> str:
52-
return "015019f815f73e308171145a48b63d57c1263e45"
52+
return "49a8c6314875c57fee9b59aea16e721572e3021d"
5353

5454
def setup(self):
5555
if options.sycl is None:

libclc/utils/prepare-builtins.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ int main(int argc, char **argv) {
143143
//
144144
// NativeCPU uses the same builtins for multiple host targets and should
145145
// likewise not have features that limit the builtins to any particular
146-
// target.
146+
// target. It does not record any target triple so as to not confuse opt.
147+
// TODO If this gets upstreamed into LLVM, it should be recognized in
148+
// llvm::Triple.
147149
if (M->getTargetTriple().str().find("amdgcn") != std::string::npos ||
148-
M->getTargetTriple().str() != "native_cpu") {
150+
M->getTargetTriple().str() == "") {
149151
AttributeMask AM;
150152
AM.addAttribute("target-features");
151153
AM.addAttribute("target-cpu");

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ set(compile_opts
5555
set(SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation")
5656

5757
if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "")
58-
list(APPEND compile_opts "--gcc-toolchain=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}")
58+
list(APPEND compile_opts "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}")
5959
endif()
6060

6161
if (WIN32)
@@ -66,6 +66,7 @@ endif()
6666
add_custom_target(libsycldevice)
6767

6868
set(filetypes obj obj-new-offload spv bc)
69+
set(filetypes_no_spv obj obj-new-offload bc)
6970

7071
foreach(filetype IN LISTS filetypes)
7172
add_custom_target(libsycldevice-${filetype})
@@ -193,10 +194,14 @@ function(add_devicelibs filename)
193194
cmake_parse_arguments(ARG
194195
""
195196
""
196-
"SRC;EXTRA_OPTS;DEPENDENCIES;SKIP_ARCHS"
197+
"SRC;EXTRA_OPTS;DEPENDENCIES;SKIP_ARCHS;FILETYPES"
197198
${ARGN})
198-
199-
foreach(filetype IN LISTS filetypes)
199+
if(ARG_FILETYPES)
200+
set(devicelib_filetypes "${ARG_FILETYPES}")
201+
else()
202+
set(devicelib_filetypes "${filetypes}")
203+
endif()
204+
foreach(filetype IN LISTS devicelib_filetypes)
200205
compile_lib(${filename}
201206
FILETYPE ${filetype}
202207
SRC ${ARG_SRC}
@@ -387,15 +392,15 @@ else()
387392
DEPENDENCIES ${asan_obj_deps}
388393
SKIP_ARCHS nvptx64-nvidia-cuda
389394
amdgcn-amd-amdhsa
395+
FILETYPES "${filetypes_no_spv}"
390396
EXTRA_OPTS -fno-sycl-instrument-device-code
391397
-I${UR_SANITIZER_INCLUDE_DIR}
392398
-I${CMAKE_CURRENT_SOURCE_DIR})
393399

394400
# asan aot
395-
set(sanitizer_filetypes obj obj-new-offload bc)
396401
set(asan_devicetypes pvc cpu dg2)
397402

398-
foreach(asan_ft IN LISTS sanitizer_filetypes)
403+
foreach(asan_ft IN LISTS filetypes_no_spv)
399404
foreach(asan_device IN LISTS asan_devicetypes)
400405
compile_lib_ext(libsycl-asan-${asan_device}
401406
SRC sanitizer/asan_rtl.cpp
@@ -409,14 +414,17 @@ else()
409414
add_devicelibs(libsycl-msan
410415
SRC sanitizer/msan_rtl.cpp
411416
DEPENDENCIES ${msan_obj_deps}
417+
SKIP_ARCHS nvptx64-nvidia-cuda
418+
amdgcn-amd-amdhsa
419+
FILETYPES "${filetypes_no_spv}"
412420
EXTRA_OPTS -fno-sycl-instrument-device-code
413421
-I${UR_SANITIZER_INCLUDE_DIR}
414422
-I${CMAKE_CURRENT_SOURCE_DIR})
415423

416424
# msan aot
417425
set(msan_devicetypes pvc cpu)
418426

419-
foreach(msan_ft IN LISTS sanitizer_filetypes)
427+
foreach(msan_ft IN LISTS filetypes_no_spv)
420428
foreach(msan_device IN LISTS msan_devicetypes)
421429
compile_lib_ext(libsycl-msan-${msan_device}
422430
SRC sanitizer/msan_rtl.cpp
@@ -430,13 +438,16 @@ else()
430438
add_devicelibs(libsycl-tsan
431439
SRC sanitizer/tsan_rtl.cpp
432440
DEPENDENCIES ${tsan_obj_deps}
441+
SKIP_ARCHS nvptx64-nvidia-cuda
442+
amdgcn-amd-amdhsa
443+
FILETYPES "${filetypes_no_spv}"
433444
EXTRA_OPTS -fno-sycl-instrument-device-code
434445
-I${UR_SANITIZER_INCLUDE_DIR}
435446
-I${CMAKE_CURRENT_SOURCE_DIR})
436447

437448
set(tsan_devicetypes pvc cpu)
438449

439-
foreach(tsan_ft IN LISTS sanitizer_filetypes)
450+
foreach(tsan_ft IN LISTS filetypes_no_spv)
440451
foreach(tsan_device IN LISTS tsan_devicetypes)
441452
compile_lib_ext(libsycl-tsan-${tsan_device}
442453
SRC sanitizer/tsan_rtl.cpp
@@ -470,9 +481,11 @@ add_devicelibs(libsycl-fallback-cmath-fp64
470481
DEPENDENCIES ${cmath_obj_deps})
471482
add_devicelibs(libsycl-fallback-bfloat16
472483
SRC fallback-bfloat16.cpp
484+
FILETYPES "${filetypes_no_spv}"
473485
DEPENDENCIES ${bfloat16_obj_deps})
474486
add_devicelibs(libsycl-native-bfloat16
475487
SRC bfloat16_wrapper.cpp
488+
FILETYPES "${filetypes_no_spv}"
476489
DEPENDENCIES ${bfloat16_obj_deps})
477490

478491
# Create dependency and source lists for Intel math function libraries.
@@ -504,6 +517,10 @@ set(imf_host_cxx_flags -c
504517
-D__LIBDEVICE_HOST_IMPL__
505518
)
506519

520+
if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "")
521+
list(APPEND imf_host_cxx_flags "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}")
522+
endif()
523+
507524
macro(mangle_name str output)
508525
string(STRIP "${str}" strippedStr)
509526
string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")

0 commit comments

Comments
 (0)