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

Method CopyNonOwnedFrom

cpp/src/arrow/buffer_test.cc:156–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156Result<std::unique_ptr<Buffer>> MyMemoryManager::CopyNonOwnedFrom(
157 const Buffer& buf, const std::shared_ptr<MemoryManager>& from) {
158 if (!allow_copy()) {
159 return nullptr;
160 }
161 if (from->is_cpu()) {
162 // CPU to MyDevice:
163 // 1. CPU to CPU
164 ARROW_ASSIGN_OR_RAISE(auto dest,
165 MemoryManager::CopyNonOwned(buf, default_cpu_memory_manager()));
166 // 2. Wrap CPU buffer result
167 return std::make_unique<MyBuffer>(shared_from_this(), std::move(dest));
168 }
169 return nullptr;
170}
171
172Result<std::unique_ptr<Buffer>> MyMemoryManager::CopyNonOwnedTo(
173 const Buffer& buf, const std::shared_ptr<MemoryManager>& to) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected