File tree Expand file tree Collapse file tree 11 files changed +29
-3
lines changed
Expand file tree Collapse file tree 11 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -344,5 +344,14 @@ if(DEFINED SKBUILD)
344344 set (_ignore_me ${SKBUILD} )
345345endif ()
346346
347- add_subdirectory (dpnp )
347+ # TODO: Replace `${CMAKE_BINARY_DIR}` with a dedicated public include root
348+ # for dpctl_ext C-API headers
349+ # Unlike dpctl which exposes C-API from `dpctl/apis/include`,
350+ # dpctl_ext currently relies on generated headers in the build tree.
351+ # `${CMAKE_BINARY_DIR}` is a temporary workaround.
352+
353+ add_library (DpctlExtCAPI INTERFACE )
354+ target_include_directories (DpctlExtCAPI INTERFACE ${CMAKE_BINARY_DIR} )
355+
348356add_subdirectory (dpctl_ext )
357+ add_subdirectory (dpnp )
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ foreach(_cy_file ${_cython_sources})
3535 build_dpctl_ext (${_trgt} ${_cy_file} "dpctl_ext/tensor" RELATIVE_PATH ".." )
3636 target_include_directories (${_trgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} /include )
3737 # target_link_libraries(DpctlCAPI INTERFACE ${_trgt}_headers)
38+ target_link_libraries (DpctlExtCAPI INTERFACE ${_trgt} _headers )
3839endforeach ()
3940
4041if (WIN32 )
@@ -346,6 +347,7 @@ foreach(python_module_name ${_py_trgts})
346347 # dpctl4pybind11.hpp. It will allow to simplify dependency tree
347348 # NOTE: dpctl C-API is resolved at runtime via Python
348349 # target_link_libraries(${python_module_name} PRIVATE DpctlCAPI)
350+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
349351 if (DPNP_WITH_REDIST)
350352 set_target_properties (
351353 ${python_module_name}
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ set(_module_src
3939pybind11_add_module (${python_module_name} MODULE ${_module_src} )
4040add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
4141
42+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
43+
4244if (_dpnp_sycl_targets)
4345 # make fat binary
4446 target_compile_options (
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ set(_module_src ${CMAKE_CURRENT_SOURCE_DIR}/fft_py.cpp)
3333pybind11_add_module (${python_module_name} MODULE ${_module_src} )
3434add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
3535
36+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
37+
3638if (_dpnp_sycl_targets)
3739 # make fat binary
3840 target_compile_options (
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ set(_module_src
3636pybind11_add_module (${python_module_name} MODULE ${_module_src} )
3737add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
3838
39+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
40+
3941if (_dpnp_sycl_targets)
4042 # make fat binary
4143 target_compile_options (
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ set(_module_src
5555
5656pybind11_add_module (${python_module_name} MODULE ${_module_src} )
5757add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
58+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
5859
5960if (_dpnp_sycl_targets)
6061 # make fat binary
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ set(_module_src
4141pybind11_add_module (${python_module_name} MODULE ${_module_src} )
4242add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
4343
44+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
45+
4446if (_dpnp_sycl_targets)
4547 # make fat binary
4648 target_compile_options (
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ set(_module_src
6767pybind11_add_module (${python_module_name} MODULE ${_module_src} )
6868add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
6969
70+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
71+
7072if (WIN32 )
7173 if (${CMAKE_VERSION} VERSION_LESS "3.27" )
7274 # this is a work-around for target_link_options inserting option after -link option, cause
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ set(python_module_name _vm_impl)
9090pybind11_add_module (${python_module_name} MODULE ${_module_src} )
9191add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
9292
93+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
94+
9395if (WIN32 )
9496 if (${CMAKE_VERSION} VERSION_LESS "3.27" )
9597 # this is a work-around for target_link_options inserting option after -link option, cause
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ set(_module_src
3636pybind11_add_module (${python_module_name} MODULE ${_module_src} )
3737add_sycl_to_target (TARGET ${python_module_name} SOURCES ${_module_src} )
3838
39+ target_link_libraries (${python_module_name} PRIVATE DpctlExtCAPI )
40+
3941if (_dpnp_sycl_targets)
4042 # make fat binary
4143 target_compile_options (
You can’t perform that action at this time.
0 commit comments