()
| 56 | |
| 57 | |
| 58 | def test_Context(): |
| 59 | assert cuda.Context.get_num_devices() > 0 |
| 60 | assert global_context.device_number == 0 |
| 61 | assert global_context1.device_number == cuda.Context.get_num_devices() - 1 |
| 62 | |
| 63 | mm = global_context.memory_manager |
| 64 | assert not mm.is_cpu |
| 65 | assert "<pyarrow.MemoryManager device: CudaDevice" in repr(mm) |
| 66 | |
| 67 | dev = global_context.device |
| 68 | assert dev == mm.device |
| 69 | |
| 70 | assert not dev.is_cpu |
| 71 | assert dev.device_id == 0 |
| 72 | assert dev.device_type == pa.DeviceAllocationType.CUDA |
| 73 | |
| 74 | with pytest.raises(ValueError, |
| 75 | match=("device_number argument must " |
| 76 | "be non-negative less than")): |
| 77 | cuda.Context(cuda.Context.get_num_devices()) |
| 78 | |
| 79 | |
| 80 | @pytest.mark.parametrize("size", [0, 1, 1000]) |
nothing calls this directly
no outgoing calls
no test coverage detected