Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aec4350
remove entire tensor submodule and modify cmake accordingly
ndgrigorian Nov 19, 2025
10f7ae2
remove benchmarks
ndgrigorian Nov 19, 2025
43c5dd5
remove tensor from dpctl cmake
ndgrigorian Nov 19, 2025
d11f0c0
remove array API workflow
ndgrigorian Nov 19, 2025
596f800
remove tensor from linting and gitignore
ndgrigorian Nov 19, 2025
d67be02
remove tensor from coverage testing
ndgrigorian Nov 19, 2025
81848cf
remove tensor-related options from dpctl module call
ndgrigorian Jan 14, 2026
7c811b0
remove skip_if_dtype_not_supported test utility
ndgrigorian Jan 27, 2026
634394d
remove references to dpctl.tensor in docstrings
ndgrigorian Jan 27, 2026
1316c75
Update dpctl tests to remove dpctl.tensor
ndgrigorian Jan 27, 2026
454ba1d
remove _compute_follows_data.pyx as it is no longer applicable to the…
ndgrigorian Jan 29, 2026
8b54735
remove cython/usm_memory example
ndgrigorian Jan 29, 2026
f786531
remove solver from onemkl example
ndgrigorian Jan 29, 2026
576be4a
remove python/sycl_timer example
ndgrigorian Jan 29, 2026
159bf61
Update gemv example to remove calls to dpctl.tensor
ndgrigorian Feb 2, 2026
f8cd405
Update dpctl sycl kernel example
ndgrigorian Feb 2, 2026
5e2cd14
Update tests for external USM allocation example
ndgrigorian Feb 2, 2026
32f5197
remove test for tensor includes
ndgrigorian Feb 2, 2026
03c8f91
Remove reference to dpctl.tensor from SyclTimer docstring
ndgrigorian Feb 2, 2026
49352f9
remove compute_follows_data imports from dpctl.utils __init__
ndgrigorian Feb 5, 2026
1aec97d
rewrite C extension test
ndgrigorian Feb 5, 2026
f26d887
remove missed reference to tensor in SyclTimer docstring
ndgrigorian Feb 17, 2026
c3216ec
remove remaining documentation referencing dpctl.tensor
ndgrigorian Feb 17, 2026
408a03f
add tensor removal to changelog
ndgrigorian Apr 11, 2026
dd74214
address review feedback
ndgrigorian Apr 13, 2026
e4b1415
update flake8 to remove deleted files from per-file-ignores
ndgrigorian Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rewrite C extension test
  • Loading branch information
ndgrigorian committed Apr 13, 2026
commit 1aec97d3e0b8d1cab568a094becf4880cf747a08
33 changes: 17 additions & 16 deletions dpctl/tests/_c_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "dpctl_capi.h"
// clang-format on

PyObject *py_is_usm_ndarray(PyObject *self_unused, PyObject *args)
PyObject *py_is_sycl_queue(PyObject *self_unused, PyObject *args)
{
PyObject *arg = NULL;
PyObject *res = NULL;
Expand All @@ -43,7 +43,7 @@ PyObject *py_is_usm_ndarray(PyObject *self_unused, PyObject *args)
return NULL;
}

check = PyObject_TypeCheck(arg, &PyUSMArrayType);
check = PyObject_TypeCheck(arg, &PySyclQueueType);
if (check == -1) {
PyErr_SetString(PyExc_RuntimeError, "Type check failed");
return NULL;
Expand All @@ -55,35 +55,36 @@ PyObject *py_is_usm_ndarray(PyObject *self_unused, PyObject *args)
return res;
}

PyObject *py_usm_ndarray_ndim(PyObject *self_unused, PyObject *args)
PyObject *py_check_queue_ref(PyObject *self_unused, PyObject *args)
{
PyObject *arg = NULL;
struct PyUSMArrayObject *array = NULL;
PyObject *res = NULL;
int status = -1;
int ndim = -1;
struct PySyclQueueObject *q_obj = NULL;
DPCTLSyclQueueRef qref = NULL;

(void)(self_unused); // avoid unused arguments warning
status = PyArg_ParseTuple(args, "O!", &PyUSMArrayType, &arg);
status = PyArg_ParseTuple(args, "O!", &PySyclQueueType, &arg);
if (!status) {
PyErr_SetString(
PyExc_TypeError,
"Expecting single argument of type dpctl.tensor.usm_ndarray");
PyErr_SetString(PyExc_TypeError,
"Expecting single argument of type dpctl.SyclQueue");
return NULL;
}

array = (struct PyUSMArrayObject *)arg;
ndim = UsmNDArray_GetNDim(array);
q_obj = (struct PySyclQueueObject *)arg;
qref = SyclQueue_GetQueueRef((struct PySyclQueueObject *)arg);

res = (qref != NULL) ? Py_True : Py_False;
Py_INCREF(res);

res = PyLong_FromLong(ndim);
return res;
}

static PyMethodDef CExtMethods[] = {
{"is_usm_ndarray", py_is_usm_ndarray, METH_VARARGS,
"Checks if input object is an usm_ndarray instance"},
{"usm_ndarray_ndim", py_usm_ndarray_ndim, METH_VARARGS,
"Get ndim property of an usm_ndarray instance"},
{"is_sycl_queue", py_is_sycl_queue, METH_VARARGS,
"Checks if input object is a dpctl.SyclQueue instance"},
{"check_queue_ref", py_check_queue_ref, METH_VARARGS,
"Checks that queue ref obtained via C-API is not NULL"},
{NULL, NULL, 0, NULL} /* Sentinel */
};

Expand Down
7 changes: 3 additions & 4 deletions dpctl/tests/test_headers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

import dpctl
import dpctl.tensor as dpt


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -44,9 +43,9 @@ def dpctl_c_extension(tmp_path_factory):

def test_c_headers(dpctl_c_extension):
try:
x = dpt.empty(10)
q = dpctl.SyclQueue()
except (dpctl.SyclDeviceCreationError, dpctl.SyclQueueCreationError):
pytest.skip()

assert dpctl_c_extension.is_usm_ndarray(x)
assert dpctl_c_extension.usm_ndarray_ndim(x) == x.ndim
assert dpctl_c_extension.is_sycl_queue(q)
assert dpctl_c_extension.check_queue_ref(q)
2 changes: 1 addition & 1 deletion dpctl/tests/test_sycl_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def test_cpython_api_SyclQueue_GetQueueRef():
try:
q = dpctl.SyclQueue()
except dpctl.SyclQueueCreationError:
pytest.skip("Can not defaul-construct SyclQueue")
pytest.skip("Can not default-construct SyclQueue")
mod = sys.modules[q.__class__.__module__]
# get capsule storign SyclQueue_GetQueueRef function ptr
q_ref_fn_cap = mod.__pyx_capi__["SyclQueue_GetQueueRef"]
Expand Down