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

Method ViewBuffer

cpp/src/arrow/device.cc:102–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102Result<std::shared_ptr<Buffer>> MemoryManager::ViewBuffer(
103 const std::shared_ptr<Buffer>& buf, const std::shared_ptr<MemoryManager>& to) {
104 if (buf->memory_manager() == to) {
105 return buf;
106 }
107 const auto& from = buf->memory_manager();
108 auto maybe_buffer = to->ViewBufferFrom(buf, from);
109 COPY_BUFFER_RETURN(maybe_buffer, to);
110 // `to` doesn't support viewing from `from`, try the other way
111 maybe_buffer = from->ViewBufferTo(buf, to);
112 COPY_BUFFER_RETURN(maybe_buffer, to);
113
114 return Status::NotImplemented("Viewing buffer from ", from->device()->ToString(),
115 " on ", to->device()->ToString(), " not supported");
116}
117
118Status MemoryManager::CopyBufferSliceToCPU(const std::shared_ptr<Buffer>& buf,
119 int64_t offset, int64_t length,

Callers

nothing calls this directly

Calls 6

NotImplementedFunction · 0.70
memory_managerMethod · 0.45
ViewBufferFromMethod · 0.45
ViewBufferToMethod · 0.45
ToStringMethod · 0.45
deviceMethod · 0.45

Tested by

no test coverage detected