@@ -55,7 +55,7 @@ set(compile_opts
55
55
set (SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation" )
56
56
57
57
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} " )
59
59
endif ()
60
60
61
61
if (WIN32 )
@@ -66,6 +66,7 @@ endif()
66
66
add_custom_target (libsycldevice)
67
67
68
68
set (filetypes obj obj-new-offload spv bc)
69
+ set (filetypes_no_spv obj obj-new-offload bc)
69
70
70
71
foreach (filetype IN LISTS filetypes)
71
72
add_custom_target (libsycldevice-${filetype} )
@@ -193,10 +194,14 @@ function(add_devicelibs filename)
193
194
cmake_parse_arguments (ARG
194
195
""
195
196
""
196
- "SRC;EXTRA_OPTS;DEPENDENCIES;SKIP_ARCHS"
197
+ "SRC;EXTRA_OPTS;DEPENDENCIES;SKIP_ARCHS;FILETYPES "
197
198
${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)
200
205
compile_lib(${filename}
201
206
FILETYPE ${filetype}
202
207
SRC ${ARG_SRC}
@@ -387,15 +392,15 @@ else()
387
392
DEPENDENCIES ${asan_obj_deps}
388
393
SKIP_ARCHS nvptx64-nvidia-cuda
389
394
amdgcn-amd-amdhsa
395
+ FILETYPES "${filetypes_no_spv} "
390
396
EXTRA_OPTS -fno-sycl-instrument-device-code
391
397
-I${UR_SANITIZER_INCLUDE_DIR}
392
398
-I${CMAKE_CURRENT_SOURCE_DIR} )
393
399
394
400
# asan aot
395
- set (sanitizer_filetypes obj obj-new-offload bc)
396
401
set (asan_devicetypes pvc cpu dg2)
397
402
398
- foreach (asan_ft IN LISTS sanitizer_filetypes )
403
+ foreach (asan_ft IN LISTS filetypes_no_spv )
399
404
foreach (asan_device IN LISTS asan_devicetypes)
400
405
compile_lib_ext(libsycl-asan-${asan_device}
401
406
SRC sanitizer/asan_rtl.cpp
@@ -409,14 +414,17 @@ else()
409
414
add_devicelibs(libsycl-msan
410
415
SRC sanitizer/msan_rtl.cpp
411
416
DEPENDENCIES ${msan_obj_deps}
417
+ SKIP_ARCHS nvptx64-nvidia-cuda
418
+ amdgcn-amd-amdhsa
419
+ FILETYPES "${filetypes_no_spv} "
412
420
EXTRA_OPTS -fno-sycl-instrument-device-code
413
421
-I${UR_SANITIZER_INCLUDE_DIR}
414
422
-I${CMAKE_CURRENT_SOURCE_DIR} )
415
423
416
424
# msan aot
417
425
set (msan_devicetypes pvc cpu)
418
426
419
- foreach (msan_ft IN LISTS sanitizer_filetypes )
427
+ foreach (msan_ft IN LISTS filetypes_no_spv )
420
428
foreach (msan_device IN LISTS msan_devicetypes)
421
429
compile_lib_ext(libsycl-msan-${msan_device}
422
430
SRC sanitizer/msan_rtl.cpp
@@ -430,13 +438,16 @@ else()
430
438
add_devicelibs(libsycl-tsan
431
439
SRC sanitizer/tsan_rtl.cpp
432
440
DEPENDENCIES ${tsan_obj_deps}
441
+ SKIP_ARCHS nvptx64-nvidia-cuda
442
+ amdgcn-amd-amdhsa
443
+ FILETYPES "${filetypes_no_spv} "
433
444
EXTRA_OPTS -fno-sycl-instrument-device-code
434
445
-I${UR_SANITIZER_INCLUDE_DIR}
435
446
-I${CMAKE_CURRENT_SOURCE_DIR} )
436
447
437
448
set (tsan_devicetypes pvc cpu)
438
449
439
- foreach (tsan_ft IN LISTS sanitizer_filetypes )
450
+ foreach (tsan_ft IN LISTS filetypes_no_spv )
440
451
foreach (tsan_device IN LISTS tsan_devicetypes)
441
452
compile_lib_ext(libsycl-tsan-${tsan_device}
442
453
SRC sanitizer/tsan_rtl.cpp
@@ -470,9 +481,11 @@ add_devicelibs(libsycl-fallback-cmath-fp64
470
481
DEPENDENCIES ${cmath_obj_deps} )
471
482
add_devicelibs(libsycl-fallback-bfloat16
472
483
SRC fallback-bfloat16.cpp
484
+ FILETYPES "${filetypes_no_spv} "
473
485
DEPENDENCIES ${bfloat16_obj_deps} )
474
486
add_devicelibs(libsycl-native-bfloat16
475
487
SRC bfloat16_wrapper.cpp
488
+ FILETYPES "${filetypes_no_spv} "
476
489
DEPENDENCIES ${bfloat16_obj_deps} )
477
490
478
491
# Create dependency and source lists for Intel math function libraries.
@@ -504,6 +517,10 @@ set(imf_host_cxx_flags -c
504
517
-D__LIBDEVICE_HOST_IMPL__
505
518
)
506
519
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
+
507
524
macro (mangle_name str output )
508
525
string (STRIP "${str} " strippedStr)
509
526
string (REGEX REPLACE "^/" "" strippedStr "${strippedStr} " )
0 commit comments