MCPcopy Create free account
hub / github.com/ARM-software/armnn / FreeWorkingMemory

Method FreeWorkingMemory

src/armnn/LoadedNetwork.cpp:1197–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197void LoadedNetwork::FreeWorkingMemory()
1198{
1199#if !defined(ARMNN_DISABLE_THREADS)
1200 std::lock_guard<std::mutex> lockGuard(m_WorkingMemMutex);
1201#endif
1202
1203 if (!m_IsWorkingMemAllocated)
1204 {
1205 return;
1206 }
1207
1208 if (m_ExternalMemoryManager)
1209 {
1210 m_ExternalMemoryManager->Deallocate();
1211 }
1212
1213 // Informs the memory managers to release memory in its respective memory group
1214 for (auto&& memoryManager : m_BackendMemoryMangers)
1215 {
1216 if (memoryManager)
1217 {
1218 memoryManager->Release();
1219 }
1220 }
1221 m_TensorHandleFactoryRegistry.ReleaseMemory();
1222 m_IsWorkingMemAllocated = false;
1223}
1224
1225bool LoadedNetwork::Execute(std::unique_ptr<TimelineUtilityMethods>& timelineUtils,
1226 ProfilingGuid inferenceGuid)

Callers 1

EnqueueWorkloadMethod · 0.80

Calls 3

DeallocateMethod · 0.80
ReleaseMemoryMethod · 0.80
ReleaseMethod · 0.45

Tested by

no test coverage detected