|
2 | 2 |
|
3 | 3 | ## Purpose |
4 | 4 |
|
5 | | -pytest-based test suite for dpctl functionality. |
| 5 | +pytest-based test suite for dpctl SYCL runtime objects and USM memory functionality. |
| 6 | + |
| 7 | +**Note:** The `dpctl/tensor` module has been removed; focus testing on SYCL objects and memory APIs. |
6 | 8 |
|
7 | 9 | ## Key Files |
8 | 10 |
|
9 | 11 | | File | Purpose | |
10 | 12 | |------|---------| |
11 | 13 | | `conftest.py` | Fixtures and pytest configuration | |
12 | | -| `helper/_helper.py` | `get_queue_or_skip()`, `skip_if_dtype_not_supported()` | |
| 14 | +| `helper/_helper.py` | `get_queue_or_skip()` (queue creation helper) | |
13 | 15 |
|
14 | 16 | ## Essential Helpers |
15 | 17 |
|
16 | 18 | From `helper/_helper.py`: |
17 | 19 | ```python |
18 | 20 | get_queue_or_skip() # Create queue or skip test |
19 | | -skip_if_dtype_not_supported() # Skip if device lacks dtype (fp64/fp16) |
20 | 21 | ``` |
21 | 22 |
|
22 | | -## Test Pattern |
| 23 | +## Test Pattern (SYCL objects) |
23 | 24 |
|
24 | 25 | ```python |
25 | | -@pytest.mark.parametrize("dtype", ["f2", "f4", "f8", "c8", "c16", ...]) |
26 | | -def test_operation(dtype): |
| 26 | +def test_device_creation(): |
27 | 27 | q = get_queue_or_skip() |
28 | | - skip_if_dtype_not_supported(dtype, q) |
29 | | - # ... test logic and assertions |
30 | | -``` |
31 | | - |
32 | | -## Coverage Requirements |
| 28 | + dev = q.sycl_device |
| 29 | + # ... test device properties and methods |
33 | 30 |
|
34 | | -- All supported dtypes |
35 | | -- All USM types: device, shared, host |
36 | | -- Memory orders: C, F where applicable |
37 | | -- Edge cases: empty arrays, 0-d arrays (scalars), broadcasting |
| 31 | +def test_usm_allocation(): |
| 32 | + q = get_queue_or_skip() |
| 33 | + # Test USM memory allocation for supported data types |
| 34 | + # ... |
| 35 | +``` |
38 | 36 |
|
39 | 37 | ## Critical Rules |
40 | 38 |
|
41 | | -1. **Device compatibility:** Not all devices support fp64/fp16 - never assume availability |
42 | | -2. **Queue consistency:** Arrays in same operation must share compatible queues |
| 39 | +1. **Device compatibility:** Not all devices support fp64/fp16 – verify support before testing float64/complex128 memory operations. |
| 40 | +2. **Queue consistency:** Memory allocations and operations must use compatible queues. |
0 commit comments