File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ set(DPCTL_TARGET_HIP
35
35
"Build DPCTL to target a HIP device architecture"
36
36
)
37
37
option (DPCTL_WITH_REDIST "Build DPCTL assuming DPC++ redistributable is installed into Python prefix" OFF )
38
+ option (DPCTL_OFFLOAD_COMPRESS "Build using offload section compression feature of DPC++" OFF )
38
39
39
40
find_package (IntelSYCL REQUIRED PATHS ${CMAKE_SOURCE_DIR} /cmake NO_DEFAULT_PATH )
40
41
Original file line number Diff line number Diff line change @@ -112,7 +112,10 @@ function(build_dpctl_ext _trgt _src _dest)
112
112
if (BUILD_DPCTL_EXT_SYCL )
113
113
add_sycl_to_target (TARGET ${_trgt} SOURCES ${_generated_src} )
114
114
target_compile_options (${_trgt} PRIVATE -fno-sycl-id-queries-fit-in-int )
115
- target_link_options (${_trgt} PRIVATE -fsycl-device-code-split=per_kernel --offload-compress )
115
+ target_link_options (${_trgt} PRIVATE -fsycl-device-code-split=per_kernel )
116
+ if (DPCTL_OFFLOAD_COMPRESS )
117
+ target_link_options (${_trgt} PRIVATE --offload-compress )
118
+ endif ()
116
119
if (_dpctl_sycl_targets )
117
120
# make fat binary
118
121
target_compile_options (
Original file line number Diff line number Diff line change @@ -267,7 +267,11 @@ endforeach()
267
267
set (_linker_options "LINKER:${DPCTL_LDFLAGS} " )
268
268
foreach (python_module_name ${_py_trgts} )
269
269
target_compile_options (${python_module_name} PRIVATE -fno-sycl-id-queries-fit-in-int )
270
- target_link_options (${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel --offload-compress )
270
+ target_link_options (${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel )
271
+ if (DPCTL_OFFLOAD_COMPRESS )
272
+ target_link_options (${python_module_name} PRIVATE --offload-compress )
273
+ endif ()
274
+
271
275
target_include_directories (${python_module_name}
272
276
PRIVATE
273
277
${CMAKE_CURRENT_SOURCE_DIR} /libtensor/include
Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ list(APPEND _pybind11_targets ${python_module_name})
28
28
set (_linker_options "LINKER:${DPCTL_LDFLAGS} " )
29
29
foreach (python_module_name ${_pybind11_targets} )
30
30
target_compile_options (${python_module_name} PRIVATE -fno-sycl-id-queries-fit-in-int )
31
- target_link_options (${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel --offload-compress )
31
+ target_link_options (${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel )
32
+ if (DPCTL_OFFLOAD_COMPRESS )
33
+ target_link_options (${python_module_name} PRIVATE --offload-compress )
34
+ endif ()
35
+
32
36
target_include_directories (${python_module_name}
33
37
PRIVATE
34
38
${CMAKE_CURRENT_SOURCE_DIR} /libtensor/include
You can’t perform that action at this time.
0 commit comments