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

Function test_buffer_device

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

make_random_bufferFunction · 0.70

Tested by

no test coverage detected