| 961 | } |
| 962 | |
| 963 | static std::shared_ptr<PoolBuffer> MakeShared(MemoryPool* pool, int64_t alignment) { |
| 964 | std::shared_ptr<MemoryManager> mm; |
| 965 | if (pool == nullptr) { |
| 966 | pool = default_memory_pool(); |
| 967 | mm = default_cpu_memory_manager(); |
| 968 | } else { |
| 969 | mm = CPUDevice::memory_manager(pool); |
| 970 | } |
| 971 | return std::make_shared<PoolBuffer>(std::move(mm), pool, alignment); |
| 972 | } |
| 973 | |
| 974 | static std::unique_ptr<PoolBuffer> MakeUnique(MemoryPool* pool, int64_t alignment) { |
| 975 | std::shared_ptr<MemoryManager> mm; |
nothing calls this directly
no test coverage detected