Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 14 additions & 4 deletions dpctl/tensor/_array_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ class Info:

def __init__(self):
self._capabilities = {
"boolean_indexing": True,
"data_dependent_shapes": True,
"boolean indexing": True,
"data-dependent shapes": True,
"max dimensions": 64,
}
self._all_dtypes = {
"bool": dpt.bool,
Expand All @@ -84,11 +85,20 @@ def capabilities(self):

Returns a dictionary of ``dpctl``'s capabilities.

The dictionary contains the following keys:
``"boolean indexing"``:
boolean indicating ``dpctl``'s support of boolean indexing.
Value: ``True``
``"data-dependent shapes"``:
boolean indicating ``dpctl``'s support of data-dependent shapes.
Value: ``True``
``max dimensions``:
integer indication the maximum array dimension supported by ``dpctl``.
Value: ``64``

Returns:
dict:
dictionary of ``dpctl``'s capabilities
- ``"boolean_indexing"``: bool
- ``data_dependent_shapes"``: bool
"""
return self._capabilities.copy()

Expand Down
5 changes: 3 additions & 2 deletions dpctl/tests/test_tensor_array_api_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def test_array_api_inspection_devices():

def test_array_api_inspection_capabilities():
capabilities = dpt.__array_namespace_info__().capabilities()
assert capabilities["boolean_indexing"]
assert capabilities["data_dependent_shapes"]
assert capabilities["boolean indexing"]
assert capabilities["data-dependent shapes"]
assert capabilities["max dimensions"] == 64


def test_array_api_inspection_default_dtypes():
Expand Down