| 182 | } |
| 183 | |
| 184 | Result<std::shared_ptr<Buffer>> MyMemoryManager::ViewBufferFrom( |
| 185 | const std::shared_ptr<Buffer>& buf, const std::shared_ptr<MemoryManager>& from) { |
| 186 | if (!allow_view()) { |
| 187 | return nullptr; |
| 188 | } |
| 189 | if (from->is_cpu()) { |
| 190 | // CPU on MyDevice: wrap CPU buffer |
| 191 | return std::make_shared<MyBuffer>(shared_from_this(), buf); |
| 192 | } |
| 193 | return nullptr; |
| 194 | } |
| 195 | |
| 196 | Result<std::shared_ptr<Buffer>> MyMemoryManager::ViewBufferTo( |
| 197 | const std::shared_ptr<Buffer>& buf, const std::shared_ptr<MemoryManager>& to) { |
nothing calls this directly
no outgoing calls
no test coverage detected