Skip to content

Commit aeafda3

Browse files
[SYCL][NewOffloadModel] Enforce default SYCL device library to use old offloading model (#20569)
This pull request enforces the default SYCL device library to always be built with the old offloading model, regardless of which offloading model (new or old) is set as the default. This is implemented by adding `--no-offload-new-driver` to the `device_compile_opts` in `libdevice/cmake/modules/SYCLLibdevice.cmake`. The motivation for this change is to address test failures in `Config/kernel_from_file.cpp` and `SeparateCompile/test.cpp` that occur when the new offloading model is enabled as the default. These failures happen because `clang-offload-bundler` does not support extracting libraries built with the new offloading model.
1 parent 703d57e commit aeafda3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ set(spv_device_compile_opts -fsycl-device-only -fsycl-device-obj=spirv)
111111
set(bc_device_compile_opts -fsycl-device-only -fsycl-device-obj=llvmir)
112112
set(obj-new-offload_device_compile_opts -fsycl -c --offload-new-driver
113113
-foffload-lto=thin ${sycl_targets_opt})
114-
set(obj_device_compile_opts -fsycl -c ${sycl_targets_opt})
114+
set(obj_device_compile_opts -fsycl -c ${sycl_targets_opt} --no-offload-new-driver)
115115

116116
# Compiles and installs a single device library.
117117
#
@@ -364,17 +364,17 @@ if (NOT MSVC AND UR_SANITIZER_INCLUDE_DIR)
364364
-I${UR_SANITIZER_INCLUDE_DIR}
365365
-I${CMAKE_CURRENT_SOURCE_DIR})
366366

367-
set(sanitizer_pvc_compile_opts_obj -fsycl -c
367+
set(sanitizer_pvc_compile_opts_obj -fsycl -c --no-offload-new-driver
368368
${sanitizer_generic_compile_opts}
369369
${sycl_pvc_target_opt}
370370
-D__LIBDEVICE_PVC__)
371371

372-
set(sanitizer_cpu_compile_opts_obj -fsycl -c
372+
set(sanitizer_cpu_compile_opts_obj -fsycl -c --no-offload-new-driver
373373
${sanitizer_generic_compile_opts}
374374
${sycl_cpu_target_opt}
375375
-D__LIBDEVICE_CPU__)
376376

377-
set(sanitizer_dg2_compile_opts_obj -fsycl -c
377+
set(sanitizer_dg2_compile_opts_obj -fsycl -c --no-offload-new-driver
378378
${sanitizer_generic_compile_opts}
379379
${sycl_dg2_target_opt}
380380
-D__LIBDEVICE_DG2__)
@@ -706,7 +706,7 @@ endif()
706706

707707
set(obj-new-offload_host_compile_opts ${imf_host_cxx_flags} --offload-new-driver
708708
-foffload-lto=thin)
709-
set(obj_host_compile_opts ${imf_host_cxx_flags})
709+
set(obj_host_compile_opts ${imf_host_cxx_flags} --no-offload-new-driver)
710710

711711
foreach(datatype IN ITEMS fp32 fp64 bf16)
712712
string(TOUPPER ${datatype} upper_datatype)

0 commit comments

Comments
 (0)