| 125 | Allocator::Allocator() { logger = common::loggerFactory("mem"); } |
| 126 | |
| 127 | void Allocator::shutdown() { |
| 128 | for (int n = 0; n < cpu::getDeviceCount(); n++) { |
| 129 | try { |
| 130 | cpu::setDevice(n); |
| 131 | shutdownMemoryManager(); |
| 132 | } catch (const AfError &err) { |
| 133 | continue; // Do not throw any errors while shutting down |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | int Allocator::getActiveDeviceId() { |
| 139 | return static_cast<int>(cpu::getActiveDeviceId()); |
no test coverage detected