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