()
| 549 | |
| 550 | |
| 551 | def 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 | |
| 573 | def test_BufferWriter(): |
nothing calls this directly
no test coverage detected