File tree Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Expand file tree Collapse file tree 4 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,16 @@ set(DPCTL_TARGET_HIP
3434 CACHE STRING
3535 "Build DPCTL to target a HIP device architecture"
3636)
37- option (DPCTL_WITH_REDIST "Build DPCTL assuming DPC++ redistributable is installed into Python prefix" OFF )
37+ option (
38+ DPCTL_WITH_REDIST
39+ "Build DPCTL assuming DPC++ redistributable is installed into Python prefix"
40+ OFF )
41+ option (
42+ DPCTL_OFFLOAD_COMPRESS
43+ "Build using offload section compression feature of DPC++ to reduce \
44+ size of shared object with offloading sections"
45+ OFF
46+ )
3847
3948find_package (IntelSYCL REQUIRED PATHS ${CMAKE_SOURCE_DIR} /cmake NO_DEFAULT_PATH)
4049
Original file line number Diff line number Diff line change @@ -111,6 +111,11 @@ function(build_dpctl_ext _trgt _src _dest)
111111 Python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src} )
112112 if (BUILD_DPCTL_EXT_SYCL)
113113 add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src} )
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)
116+ if (DPCTL_OFFLOAD_COMPRESS)
117+ target_link_options (${_trgt} PRIVATE --offload-compress)
118+ endif ()
114119 if (_dpctl_sycl_targets)
115120 # make fat binary
116121 target_compile_options (
Original file line number Diff line number Diff line change @@ -268,6 +268,10 @@ set(_linker_options "LINKER:${DPCTL_LDFLAGS}")
268268foreach (python_module_name ${_py_trgts} )
269269 target_compile_options (${python_module_name} PRIVATE -fno-sycl-id-queries-fit-in-int)
270270 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+
271275 target_include_directories (${python_module_name}
272276 PRIVATE
273277 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/include
@@ -279,7 +283,7 @@ foreach(python_module_name ${_py_trgts})
279283 target_compile_options (${python_module_name}
280284 PRIVATE -fprofile-instr-generate -fcoverage-mapping
281285 )
282- endif ()
286+ endif ()
283287 target_link_options (${python_module_name}
284288 PRIVATE -fprofile-instr-generate -fcoverage-mapping
285289 )
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ set(_linker_options "LINKER:${DPCTL_LDFLAGS}")
2929foreach (python_module_name ${_pybind11_targets} )
3030 target_compile_options (${python_module_name} PRIVATE -fno-sycl-id-queries-fit-in-int)
3131 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+
3236 target_include_directories (${python_module_name}
3337 PRIVATE
3438 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/include
@@ -40,7 +44,7 @@ foreach(python_module_name ${_pybind11_targets})
4044 target_compile_options (${python_module_name}
4145 PRIVATE -fprofile-instr-generate -fcoverage-mapping
4246 )
43- endif ()
47+ endif ()
4448 target_link_options (${python_module_name}
4549 PRIVATE -fprofile-instr-generate -fcoverage-mapping
4650 )
You can’t perform that action at this time.
0 commit comments