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

Method ViewBufferFrom

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

Source from the content-addressed store, hash-verified

497}
498
499Result<std::shared_ptr<Buffer>> CudaMemoryManager::ViewBufferFrom(
500 const std::shared_ptr<Buffer>& buf, const std::shared_ptr<MemoryManager>& from) {
501 if (from->is_cpu()) {
502 // CPU-on-device view
503 ARROW_ASSIGN_OR_RAISE(auto to_context, cuda_device()->GetContext());
504 ARROW_ASSIGN_OR_RAISE(auto address, GetDeviceAddress(buf->data(), to_context));
505 return std::make_shared<Buffer>(address, buf->size(), shared_from_this(), buf);
506 }
507 return nullptr;
508}
509
510bool IsCudaMemoryManager(const MemoryManager& mm) { return IsCudaDevice(*mm.device()); }
511

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected