arm_compute v19.11
diff --git a/src/graph/backends/CL/CLDeviceBackend.cpp b/src/graph/backends/CL/CLDeviceBackend.cpp
index 0666ec0..de31847 100644
--- a/src/graph/backends/CL/CLDeviceBackend.cpp
+++ b/src/graph/backends/CL/CLDeviceBackend.cpp
@@ -34,11 +34,13 @@
#include "arm_compute/graph/backends/CL/CLSubTensorHandle.h"
#include "arm_compute/graph/backends/CL/CLTensorHandle.h"
+#include "arm_compute/core/CL/CLCoreRuntimeContext.h"
#include "arm_compute/core/TensorInfo.h"
#include "arm_compute/runtime/BlobLifetimeManager.h"
#include "arm_compute/runtime/CL/CLBufferAllocator.h"
-#include "arm_compute/runtime/CL/CLMemoryGroup.h"
#include "arm_compute/runtime/CL/CLScheduler.h"
+#include "arm_compute/runtime/IWeightsManager.h"
+#include "arm_compute/runtime/MemoryGroup.h"
#include "arm_compute/runtime/MemoryManagerOnDemand.h"
#include "arm_compute/runtime/PoolManager.h"
@@ -90,9 +92,8 @@
{
// Setup Scheduler
CLScheduler::get().default_init(&_tuner);
-
// Create allocator with new context
- _allocator = support::cpp14::make_unique<CLBufferAllocator>();
+ _allocator = support::cpp14::make_unique<CLBufferAllocator>(nullptr /* legacy path for CLCoreRuntimeContext */);
}
void CLDeviceBackend::release_backend_context(GraphContext &ctx)
@@ -132,11 +133,21 @@
mm_ctx.target = Target::CL;
mm_ctx.intra_mm = create_memory_manager(MemoryManagerAffinity::Buffer);
mm_ctx.cross_mm = create_memory_manager(MemoryManagerAffinity::Buffer);
- mm_ctx.cross_group = std::make_shared<CLMemoryGroup>(mm_ctx.cross_mm);
+ mm_ctx.cross_group = std::make_shared<MemoryGroup>(mm_ctx.cross_mm);
mm_ctx.allocator = _allocator.get();
ctx.insert_memory_management_ctx(std::move(mm_ctx));
}
+
+ // Create function level weights manager
+ if(ctx.weights_management_ctx(Target::CL) == nullptr)
+ {
+ WeightsManagerContext wm_ctx;
+ wm_ctx.target = Target::CL;
+ wm_ctx.wm = create_weights_manager();
+
+ ctx.insert_weights_management_ctx(std::move(wm_ctx));
+ }
}
bool CLDeviceBackend::is_backend_supported()
@@ -204,6 +215,12 @@
return mm;
}
+
+std::shared_ptr<arm_compute::IWeightsManager> CLDeviceBackend::create_weights_manager()
+{
+ auto weights_mgr = std::make_shared<IWeightsManager>();
+ return weights_mgr;
+}
} // namespace backends
} // namespace graph
} // namespace arm_compute