MCPcopy Create free account
hub / github.com/apache/arrow / test_Context

Function test_Context

python/pyarrow/tests/test_cuda.py:58–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def 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])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected