Skip to content

Commit 27df7d9

Browse files
Merge include-dpctl-tensor into move_tensor_tests
2 parents 7294993 + a31ab47 commit 27df7d9

28 files changed

Lines changed: 208 additions & 440 deletions

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Generate coverage and push to Coveralls.io
1212

1313
runs-on: ubuntu-latest
14-
timeout-minutes: 120
14+
timeout-minutes: 150
1515

1616
permissions:
1717
# Needed to cancel any previous runs that are not completed for a given workflow
@@ -122,7 +122,7 @@ jobs:
122122
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
123123
with:
124124
shell: bash
125-
timeout_minutes: 90
125+
timeout_minutes: 120
126126
max_attempts: 5
127127
retry_on: error
128128
command: |

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,5 @@ if(DEFINED SKBUILD)
344344
set(_ignore_me ${SKBUILD})
345345
endif()
346346

347-
# DpctlExtCAPI: Interface library for dpctl_ext C-API
348-
# Provides access to:
349-
# 1. Public C-API headers from dpctl_ext/apis/include
350-
# 2. Generated Cython headers via per-target header interface libraries
351-
352-
add_library(DpctlExtCAPI INTERFACE)
353-
target_include_directories(
354-
DpctlExtCAPI
355-
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/dpctl_ext/apis/include
356-
)
357-
358347
add_subdirectory(dpctl_ext)
359348
add_subdirectory(dpnp)

dpctl_ext/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,4 @@ function(build_dpctl_ext _trgt _src _dest)
199199
target_include_directories(${_trgt_headers} INTERFACE ${_trgt_headers_dir})
200200
endfunction()
201201

202-
# Install dpctl_ext C-API headers (similar to dpctl's C-API installation)
203-
install(
204-
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/apis/include/
205-
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl_ext/include
206-
FILES_MATCHING
207-
REGEX "\\.h(pp)?$"
208-
)
209-
210202
add_subdirectory(tensor)

dpctl_ext/tensor/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ foreach(_cy_file ${_cython_sources})
3434
get_filename_component(_trgt ${_cy_file} NAME_WLE)
3535
build_dpctl_ext(${_trgt} ${_cy_file} "dpctl_ext/tensor" RELATIVE_PATH "..")
3636
target_include_directories(${_trgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
37-
# target_link_libraries(DpctlCAPI INTERFACE ${_trgt}_headers)
38-
target_link_libraries(DpctlExtCAPI INTERFACE ${_trgt}_headers)
3937
endforeach()
4038

4139
if(WIN32)
@@ -318,6 +316,7 @@ foreach(python_module_name ${_py_trgts})
318316
${Dpctl_INCLUDE_DIR}
319317
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/include
320318
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/
319+
${CMAKE_BINARY_DIR} # For generated Cython headers
321320
)
322321
target_link_options(${python_module_name} PRIVATE ${_linker_options})
323322
if(DPCTL_GENERATE_COVERAGE)
@@ -343,11 +342,8 @@ foreach(python_module_name ${_py_trgts})
343342
PRIVATE ${_dpnp_sycl_target_link_options}
344343
)
345344
endif()
346-
# TODO: update source so they reference individual libraries instead of
347-
# dpctl4pybind11.hpp. It will allow to simplify dependency tree
348-
# NOTE: dpctl C-API is resolved at runtime via Python
349-
# target_link_libraries(${python_module_name} PRIVATE DpctlCAPI)
350-
target_link_libraries(${python_module_name} PRIVATE DpctlExtCAPI)
345+
# Ensure Cython modules build first so _usmarray.h exists
346+
add_dependencies(${python_module_name} _usmarray)
351347
if(DPNP_WITH_REDIST)
352348
set_target_properties(
353349
${python_module_name}

dpctl_ext/tensor/_ctors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
_empty_like_orderK,
4747
_from_numpy_empty_like_orderK,
4848
)
49+
from ._data_types import _get_dtype
50+
from ._device import normalize_queue_device
51+
from ._usmarray import _is_object_with_buffer_protocol
4952

5053
__doc__ = "Implementation of creation functions in :module:`dpctl.tensor`"
5154

dpctl_ext/tensor/_dlpack.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ def from_dlpack(x, /, *, device=None, copy=None):
10861086
.. code-block:: python
10871087
10881088
import dpctl
1089-
import dpctl.tensor as dpt
1089+
import dpctl_ext.tensor as dpt
10901090
10911091
class Container:
10921092
"Helper class implementing `__dlpack__` protocol"

dpctl_ext/tensor/_scalar_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
# TODO: revert to `import dpctl.tensor...`
3535
# when dpnp fully migrates dpctl/tensor
3636
import dpctl_ext.tensor as dpt
37-
from dpctl_ext.tensor._usmarray import (
38-
_is_object_with_buffer_protocol as _is_buffer,
39-
)
4037

4138
from ._type_utils import (
4239
WeakBooleanType,
@@ -45,6 +42,7 @@
4542
WeakIntegralType,
4643
_to_device_supported_dtype,
4744
)
45+
from ._usmarray import _is_object_with_buffer_protocol as _is_buffer
4846

4947

5048
def _get_queue_usm_type(o):

dpctl_ext/tensor/_set_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# TODO: revert to `import dpctl.tensor...`
3434
# when dpnp fully migrates dpctl/tensor
3535
import dpctl_ext.tensor as dpt
36-
from dpctl_ext.tensor._tensor_elementwise_impl import _not_equal, _subtract
3736

3837
from ._copy_utils import _empty_like_orderK
3938
from ._scalar_utils import (
@@ -42,6 +41,7 @@
4241
_get_shape,
4342
_validate_dtype,
4443
)
44+
from ._tensor_elementwise_impl import _not_equal, _subtract
4545
from ._tensor_impl import (
4646
_copy_usm_ndarray_into_usm_ndarray,
4747
_extract,

0 commit comments

Comments
 (0)