|
29 | 29 | "bool": dpt.bool, |
30 | 30 | "float32": dpt.float32, |
31 | 31 | "complex64": dpt.complex64, |
32 | | - "complex128": dpt.complex128, |
33 | 32 | "int8": dpt.int8, |
34 | 33 | "int16": dpt.int16, |
35 | 34 | "int32": dpt.int32, |
|
41 | 40 | } |
42 | 41 |
|
43 | 42 |
|
44 | | -class MockDevice: |
45 | | - def __init__(self, fp16: bool, fp64: bool): |
46 | | - self.has_aspect_fp16 = fp16 |
47 | | - self.has_aspect_fp64 = fp64 |
48 | | - |
49 | | - |
50 | 43 | def test_array_api_inspection_methods(): |
51 | 44 | info = dpt.__array_namespace_info__() |
52 | 45 | assert info.capabilities() |
@@ -125,17 +118,21 @@ def test_array_api_inspection_default_device_dtypes(): |
125 | 118 | dtypes = _dtypes_no_fp16_fp64.copy() |
126 | 119 | if dev.has_aspect_fp64: |
127 | 120 | dtypes["float64"] = dpt.float64 |
| 121 | + dtypes["complex128"] = dpt.complex128 |
128 | 122 |
|
129 | 123 | assert dtypes == dpt.__array_namespace_info__().dtypes() |
130 | 124 |
|
131 | 125 |
|
132 | | -@pytest.mark.parametrize("fp16", [True, False]) |
133 | | -@pytest.mark.parametrize("fp64", [True, False]) |
134 | | -def test_array_api_inspection_device_dtypes(fp16, fp64): |
135 | | - dev = MockDevice(fp16, fp64) |
| 126 | +def test_array_api_inspection_device_dtypes(): |
| 127 | + info = dpt.__array_namespace_info__() |
| 128 | + try: |
| 129 | + dev = info.default_device() |
| 130 | + except dpctl.SyclDeviceCreationError: |
| 131 | + pytest.skip("No default device available") |
136 | 132 | dtypes = _dtypes_no_fp16_fp64.copy() |
137 | | - if fp64: |
| 133 | + if dev.has_aspect_fp64: |
138 | 134 | dtypes["float64"] = dpt.float64 |
| 135 | + dtypes["complex128"] = dpt.complex128 |
139 | 136 |
|
140 | 137 | assert dtypes == dpt.__array_namespace_info__().dtypes(device=dev) |
141 | 138 |
|
|
0 commit comments