| 510 | bool IsCudaMemoryManager(const MemoryManager& mm) { return IsCudaDevice(*mm.device()); } |
| 511 | |
| 512 | Result<std::shared_ptr<CudaMemoryManager>> AsCudaMemoryManager( |
| 513 | const std::shared_ptr<MemoryManager>& mm) { |
| 514 | if (IsCudaMemoryManager(*mm)) { |
| 515 | return checked_pointer_cast<CudaMemoryManager>(mm); |
| 516 | } else { |
| 517 | return Status::TypeError("Device is not a Cuda device: ", mm->device()->ToString()); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | // ---------------------------------------------------------------------- |
| 522 | // CudaDeviceManager implementation |