| 437 | } |
| 438 | |
| 439 | DeviceManager::~DeviceManager() { |
| 440 | for (int i = 0; i < getDeviceCount(); ++i) { gfxManagers[i] = nullptr; } |
| 441 | #ifndef OS_WIN |
| 442 | // TODO: FIXME: |
| 443 | // clfftTeardown() causes a "Pure Virtual Function Called" crash on |
| 444 | // Windows for Intel devices. This causes tests to fail. |
| 445 | clfftTeardown(); |
| 446 | #endif |
| 447 | |
| 448 | deInitBlas(); |
| 449 | |
| 450 | // deCache Boost program_cache |
| 451 | #ifndef OS_WIN |
| 452 | for (auto bCache : mBoostProgCacheVector) { delete bCache; } |
| 453 | #endif |
| 454 | |
| 455 | memManager = nullptr; |
| 456 | pinnedMemManager = nullptr; |
| 457 | |
| 458 | // TODO: FIXME: |
| 459 | // OpenCL libs on Windows platforms |
| 460 | // are crashing the application at program exit |
| 461 | // most probably a reference counting issue based |
| 462 | // on the investigation done so far. This problem |
| 463 | // doesn't seem to happen on Linux or MacOSX. |
| 464 | // So, clean up OpenCL resources on non-Windows platforms |
| 465 | #ifdef OS_WIN |
| 466 | for (auto& q : mQueues) { q.release(); } |
| 467 | for (auto& c : mContexts) { c.release(); } |
| 468 | for (auto& d : mDevices) { d.release(); } |
| 469 | #endif |
| 470 | } |
| 471 | |
| 472 | void DeviceManager::markDeviceForInterop(const int device, |
| 473 | const void* wHandle) { |
nothing calls this directly
no test coverage detected