diff options
author | Anthony Barbier <anthony.barbier@arm.com> | 2018-07-13 15:55:24 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 7b607dc5058d2f6a398cfac4d2eab65d415c3733 (patch) | |
tree | 8597679faf0fb1b389b7ffa7f3d424d527863a1c /src/graph/backends/CL | |
parent | 11a7e32230121e457252084f8b93357814fe57e5 (diff) | |
download | ComputeLibrary-7b607dc5058d2f6a398cfac4d2eab65d415c3733.tar.gz |
COMPMID-1400: Add command line option to specify the tuner's config file
Change-Id: Ib597e0dff4c8c01f7e6bd46d03824beef4bc1e9a
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139923
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/graph/backends/CL')
-rw-r--r-- | src/graph/backends/CL/CLDeviceBackend.cpp | 24 |
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 |