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

Function test_buffer_device

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

Source from the content-addressed store, hash-verified

541
542
543def test_buffer_device():
544 buf = cuda.new_host_buffer(10)
545 assert buf.device_type == pa.DeviceAllocationType.CUDA_HOST
546 assert isinstance(buf.device, pa.Device)
547 assert isinstance(buf.memory_manager, pa.MemoryManager)
548 assert buf.is_cpu
549 assert buf.device.is_cpu
550 assert buf.device == pa.default_cpu_memory_manager().device
551 # it is not entirely clear if CudaHostBuffer should use the default CPU memory
552 # manager (as it does now), see https://github.com/apache/arrow/pull/42221
553 assert buf.memory_manager.is_cpu
554
555 _, buf = make_random_buffer(size=10, target='device')
556 assert buf.device_type == pa.DeviceAllocationType.CUDA
557 assert isinstance(buf.device, pa.Device)
558 assert buf.device == global_context.memory_manager.device
559 assert isinstance(buf.memory_manager, pa.MemoryManager)
560 assert not buf.is_cpu
561 assert not buf.device.is_cpu
562 assert not buf.memory_manager.is_cpu
563
564
565def test_BufferWriter():

Callers

nothing calls this directly

Calls 1

make_random_bufferFunction · 0.70

Tested by

no test coverage detected