MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / ~DeviceManager

Method ~DeviceManager

src/backend/opencl/device_manager.cpp:439–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439DeviceManager::~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
472void DeviceManager::markDeviceForInterop(const int device,
473 const void* wHandle) {

Callers

nothing calls this directly

Calls 2

getDeviceCountFunction · 0.70
deInitBlasFunction · 0.70

Tested by

no test coverage detected