| 1195 | } |
| 1196 | |
| 1197 | void 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 | |
| 1225 | bool LoadedNetwork::Execute(std::unique_ptr<TimelineUtilityMethods>& timelineUtils, |
| 1226 | ProfilingGuid inferenceGuid) |
no test coverage detected