aboutsummaryrefslogtreecommitdiff
path: root/src/graph/backends/CL/CLDeviceBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph/backends/CL/CLDeviceBackend.cpp')
-rw-r--r--src/graph/backends/CL/CLDeviceBackend.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/graph/backends/CL/CLDeviceBackend.cpp b/src/graph/backends/CL/CLDeviceBackend.cpp
index b235c3aa48..6717f9f8e3 100644
--- a/src/graph/backends/CL/CLDeviceBackend.cpp
+++ b/src/graph/backends/CL/CLDeviceBackend.cpp
@@ -62,20 +62,17 @@ bool file_exists(const std::string &filename)
/** Register CL backend */
static detail::BackendRegistrar<CLDeviceBackend> CLDeviceBackend_registrar(Target::CL);
-/** Tuner export file */
-static const std::string tuner_data_filename = "acl_tuner.csv";
-
CLDeviceBackend::CLDeviceBackend()
- : _initialized(false), _tuner(), _allocator(nullptr)
+ : _initialized(false), _tuner(), _allocator(nullptr), _tuner_file()
{
}
CLDeviceBackend::~CLDeviceBackend()
{
// TODO (geopin01) : Shouldn't call non exception safe stuff here
- if(_tuner.tune_new_kernels() && !_tuner.lws_table().empty())
+ if(_tuner.tune_new_kernels() && !_tuner.lws_table().empty() && !_tuner_file.empty())
{
- _tuner.save_to_file(tuner_data_filename);
+ _tuner.save_to_file(_tuner_file);
}
}
@@ -86,12 +83,6 @@ void CLDeviceBackend::set_kernel_tuning(bool enable_tuning)
void CLDeviceBackend::initialize_backend()
{
- // Load tuner data if available
- if(_tuner.lws_table().empty() && file_exists(tuner_data_filename))
- {
- _tuner.load_from_file(tuner_data_filename);
- }
-
// Setup Scheduler
CLScheduler::get().default_init(&_tuner);
@@ -109,6 +100,13 @@ void CLDeviceBackend::setup_backend_context(GraphContext &ctx)
}
// Setup tuner
+ _tuner_file = ctx.config().tuner_file;
+ // Load tuner data if available
+ if(file_exists(_tuner_file))
+ {
+ _tuner.load_from_file(_tuner_file);
+ }
+
set_kernel_tuning(ctx.config().use_tuner);
// Setup a management backend
@@ -193,4 +191,4 @@ std::shared_ptr<arm_compute::IMemoryManager> CLDeviceBackend::create_memory_mana
}
} // namespace backends
} // namespace graph
-} // namespace arm_compute \ No newline at end of file
+} // namespace arm_compute