MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / addMemoryManagement

Method addMemoryManagement

src/backend/common/DefaultMemoryManager.cpp:96–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94void DefaultMemoryManager::shutdown() { signalMemoryCleanup(); }
95
96void DefaultMemoryManager::addMemoryManagement(int device) {
97 // If there is a memory manager allocated for this device id, we might
98 // as well use it and the buffers allocated for it
99 if (static_cast<size_t>(device) < memory.size()) { return; }
100
101 // Assuming, device need not be always the next device Lets resize to
102 // current_size + device + 1 +1 is to account for device being 0-based
103 // index of devices
104 memory.resize(memory.size() + device + 1);
105}
106
107void DefaultMemoryManager::removeMemoryManagement(int device) {
108 if (static_cast<size_t>(device) >= memory.size()) {

Callers 2

addDeviceContextFunction · 0.45
addDeviceContextFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected