| 154 | } |
| 155 | |
| 156 | Result<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 | |
| 172 | Result<std::unique_ptr<Buffer>> MyMemoryManager::CopyNonOwnedTo( |
| 173 | const Buffer& buf, const std::shared_ptr<MemoryManager>& to) { |
nothing calls this directly
no outgoing calls
no test coverage detected