| 1523 | : type_(type), zero_size_buffer_(std::make_shared<Buffer>(kZeroSizeArea, 0)) {} |
| 1524 | |
| 1525 | Status Import(struct ArrowDeviceArray* src, const DeviceMemoryMapper& mapper) { |
| 1526 | ARROW_ASSIGN_OR_RAISE(memory_mgr_, mapper(src->device_type, src->device_id)); |
| 1527 | device_type_ = static_cast<DeviceAllocationType>(src->device_type); |
| 1528 | RETURN_NOT_OK(Import(&src->array)); |
| 1529 | if (src->sync_event != nullptr) { |
| 1530 | ARROW_ASSIGN_OR_RAISE(import_->device_sync_, memory_mgr_->WrapDeviceSyncEvent( |
| 1531 | src->sync_event, [](void*) {})); |
| 1532 | } |
| 1533 | // reset internal state before next import |
| 1534 | memory_mgr_.reset(); |
| 1535 | device_type_ = DeviceAllocationType::kCPU; |
| 1536 | return Status::OK(); |
| 1537 | } |
| 1538 | |
| 1539 | Status Import(struct ArrowArray* src) { |
| 1540 | if (ArrowArrayIsReleased(src)) { |
no test coverage detected