aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLTuner.h
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-02-28 13:47:58 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:48:33 +0000
commit8b81195919eaab90a803fabae57ca05136e9430e (patch)
tree325798fd319f8091b18458127d3843b88c4d40af /arm_compute/runtime/CL/CLTuner.h
parentfadfc6d6737716891f543f61a529e984da9b0a8b (diff)
downloadComputeLibrary-8b81195919eaab90a803fabae57ca05136e9430e.tar.gz
COMPMID-978 Load/Store tuning data from file (Part2)
Change-Id: I1819f42c0e456673543b267d51f730b6e80a0ad9 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122629 Reviewed-by: Robert Hughes <robert.hughes@arm.com> Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/CLTuner.h')
-rw-r--r--arm_compute/runtime/CL/CLTuner.h53
1 files changed, 20 insertions, 33 deletions
diff --git a/arm_compute/runtime/CL/CLTuner.h b/arm_compute/runtime/CL/CLTuner.h
index 251848814d..a321241fee 100644
--- a/arm_compute/runtime/CL/CLTuner.h
+++ b/arm_compute/runtime/CL/CLTuner.h
@@ -47,11 +47,16 @@ public:
/** Destructor */
~CLTuner() = default;
- /* Setter for tune_new_kernels option
+ /** Setter for tune_new_kernels option
*
* @param[in] tune_new_kernels Find the optimal local workgroup size for kernels which are not present in the table ?
*/
void set_tune_new_kernels(bool tune_new_kernels);
+ /** Tune kernels that are not in the LWS table
+ *
+ * @return True if tuning of new kernels is enabled.
+ */
+ bool tune_new_kernels() const;
/** Manually add a LWS for a kernel
*
* @param[in] kernel_id Unique identifiant of the kernel
@@ -64,11 +69,11 @@ public:
*/
void import_lws_table(const std::unordered_map<std::string, cl::NDRange> &lws_table);
- /** Export LWS table
+ /** Give read access to the LWS table
*
* return The lws table as unordered_map container
*/
- const std::unordered_map<std::string, cl::NDRange> &export_lws_table() const;
+ const std::unordered_map<std::string, cl::NDRange> &lws_table() const;
/** Set the OpenCL kernel event
*
@@ -80,6 +85,18 @@ public:
std::function<decltype(clEnqueueNDRangeKernel)> real_clEnqueueNDRangeKernel;
+ /** Load the LWS table from file
+ *
+ * @param[in] filename Load the LWS table from this file.(Must exist)
+ */
+ void load_from_file(const std::string &filename);
+
+ /** Save the content of the LWS table to file
+ *
+ * @param[in] filename Save the LWS table to this file. (Content will be overwritten)
+ */
+ void save_to_file(const std::string &filename) const;
+
// Inherited methods overridden:
void tune_kernel(ICLKernel &kernel) override;
@@ -98,35 +115,5 @@ private:
cl::Event _kernel_event;
bool _tune_new_kernels;
};
-
-class CLFileTuner : public CLTuner
-{
-public:
- /** Constructor
- *
- * @param[in] file_path File to load/store the tuning information from
- * @param[in] update_file If true, save the new LWS table to the file on exit.
- * @param[in] tune_new_kernels Find the optimal local workgroup size for kernels which are not present in the table ?
- */
- CLFileTuner(std::string file_path = "acl_tuner.csv", bool update_file = false, bool tune_new_kernels = false);
-
- /** Save the content of the LWS table to file
- */
- void save_to_file() const;
- /* Setter for update_file option
- *
- * @param[in] update_file If true, save the new LWS table to the file on exit.
- */
- void set_update_file(bool update_file);
- /** Destructor
- *
- * Will save the LWS table to the file if the CLFileTuner was created with update_file enabled.
- */
- ~CLFileTuner();
- const std::string filename;
-
-private:
- bool _update_file;
-};
}
#endif /*__ARM_COMPUTE_CLTUNER_H__ */