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

Method CopyNonOwnedTo

cpp/src/arrow/gpu/cuda_context.cc:433–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433Result<std::unique_ptr<Buffer>> CudaMemoryManager::CopyNonOwnedTo(
434 const Buffer& buf, const std::shared_ptr<MemoryManager>& to) {
435 if (to->is_cpu()) {
436 auto sync_event = buf.device_sync_event();
437 if (sync_event) {
438 RETURN_NOT_OK(sync_event->Wait());
439 }
440
441 // Device-to-CPU copy
442 std::unique_ptr<Buffer> dest;
443 ARROW_ASSIGN_OR_RAISE(auto from_context, cuda_device()->GetContext());
444 ARROW_ASSIGN_OR_RAISE(dest, to->AllocateBuffer(buf.size()));
445 RETURN_NOT_OK(
446 from_context->CopyDeviceToHost(dest->mutable_data(), buf.address(), buf.size()));
447 return dest;
448 }
449 return nullptr;
450}
451
452Result<std::shared_ptr<Buffer>> CudaMemoryManager::CopyBufferFrom(
453 const std::shared_ptr<Buffer>& buf, const std::shared_ptr<MemoryManager>& from) {

Callers

nothing calls this directly

Calls 8

addressMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
device_sync_eventMethod · 0.45
WaitMethod · 0.45
AllocateBufferMethod · 0.45
sizeMethod · 0.45
CopyDeviceToHostMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected