| 184 | } |
| 185 | |
| 186 | DeviceManager::~DeviceManager() { |
| 187 | try { |
| 188 | // Reset unique_ptrs for all cu[BLAS | Sparse | Solver] |
| 189 | // handles of all devices |
| 190 | for (int i = 0; i < nDevices; ++i) { |
| 191 | setDevice(i); |
| 192 | cusolverManager(i)->reset(); |
| 193 | cusparseManager(i)->reset(); |
| 194 | cufftManager(i).reset(); |
| 195 | cublasManager(i)->reset(); |
| 196 | #ifdef WITH_CUDNN |
| 197 | nnManager(i)->reset(); |
| 198 | #endif |
| 199 | } |
| 200 | } catch (const AfError &err) { |
| 201 | AF_TRACE( |
| 202 | "Exception thrown during destruction of DeviceManager(ignoring). " |
| 203 | "{}({}):{} " |
| 204 | "{}", |
| 205 | err.getFileName(), err.getLine(), err.getFunctionName(), |
| 206 | err.what()); |
| 207 | } catch (...) { |
| 208 | AF_TRACE( |
| 209 | "Unknown exception thrown during destruction of " |
| 210 | "DeviceManager(ignoring)"); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | bool isDeviceBufferAccessible(int buf_device_id, int execution_id) { |
| 215 | DeviceManager &mngr = DeviceManager::getInstance(); |
nothing calls this directly
no test coverage detected