aboutsummaryrefslogtreecommitdiff
path: root/src/graph/backends/CL/CLDeviceBackend.cpp
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2021-02-03 12:17:35 +0000
committerSiCong Li <sicong.li@arm.com>2021-02-09 16:02:44 +0000
commit4841c97170b85be0706b65d424e967e561cef932 (patch)
tree31faa2e082a57f16c49092d902410b9397ed6384 /src/graph/backends/CL/CLDeviceBackend.cpp
parent9f7d55a3566b0f1044110000b033d663b26d3a6c (diff)
downloadComputeLibrary-4841c97170b85be0706b65d424e967e561cef932.tar.gz
Add mlgo to graph examples
Resolves COMPMID-3847 Change-Id: I99f73bfc8eda66e8ce1dd1f2a18be76e9d826569 Signed-off-by: SiCong Li <sicong.li@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5033 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/graph/backends/CL/CLDeviceBackend.cpp')
-rw-r--r--src/graph/backends/CL/CLDeviceBackend.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/graph/backends/CL/CLDeviceBackend.cpp b/src/graph/backends/CL/CLDeviceBackend.cpp
index 50dd799ee1..f8e22ca7a0 100644
--- a/src/graph/backends/CL/CLDeviceBackend.cpp
+++ b/src/graph/backends/CL/CLDeviceBackend.cpp
@@ -65,7 +65,7 @@ bool file_exists(const std::string &filename)
static detail::BackendRegistrar<CLDeviceBackend> CLDeviceBackend_registrar(Target::CL);
CLDeviceBackend::CLDeviceBackend()
- : _context_count(0), _tuner(), _allocator(nullptr), _tuner_file()
+ : _context_count(0), _tuner(), _gemm_heuristics(), _allocator(nullptr), _tuner_file()
{
}
@@ -87,7 +87,7 @@ void CLDeviceBackend::set_kernel_tuning_mode(CLTunerMode tuning_mode)
void CLDeviceBackend::initialize_backend()
{
// Setup Scheduler
- CLScheduler::get().default_init(&_tuner);
+ CLScheduler::get().default_init(&_tuner, &_gemm_heuristics);
// Create allocator with new context
_allocator = std::make_unique<CLBufferAllocator>(nullptr /* legacy path for CLCoreRuntimeContext */);
}
@@ -123,6 +123,10 @@ void CLDeviceBackend::setup_backend_context(GraphContext &ctx)
set_kernel_tuning(ctx.config().use_tuner);
set_kernel_tuning_mode(ctx.config().tuner_mode);
+ // Attempt to load mlgo heuristics
+ ARM_COMPUTE_ERROR_ON(CLScheduler::get().gemm_heuristics() == nullptr);
+ CLScheduler::get().gemm_heuristics()->reload_from_file(ctx.config().mlgo_file);
+
// Setup a management backend
if(ctx.memory_management_ctx(Target::CL) == nullptr)
{