()
| 541 | |
| 542 | |
| 543 | def 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 | |
| 565 | def test_BufferWriter(): |
nothing calls this directly
no test coverage detected