MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / do_tune_kernel_dynamic

Method do_tune_kernel_dynamic

src/runtime/CL/CLTuner.cpp:105–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void CLTuner::do_tune_kernel_dynamic(ICLKernel &kernel, IKernelData *data)
106{
107 // Get the configuration ID from the kernel and append GPU target name and number of available compute units
108 const std::string config_id = kernel.config_id() + "_" + string_from_target(kernel.get_target()) + "_MP" +
109 support::cpp11::to_string(CLKernelLibrary::get().get_num_compute_units());
110
111 // Check if we need to find the Optimal LWS. If the kernel's config_id is equal to default_config_id, the kernel does not require to be tuned
112 if (kernel.config_id() != arm_compute::default_config_id)
113 {
114 auto p = _tuning_params_table.find(config_id);
115
116 if (p == _tuning_params_table.end())
117 {
118 if (_tune_new_kernels)
119 {
120 // Find the optimal LWS for the kernel
121 CLTuningParams opt_tuning_params = find_optimal_tuning_params(kernel, data);
122
123 // Insert the optimal LWS in the table
124 add_tuning_params(config_id, opt_tuning_params);
125
126 // Set Local-Workgroup-Size
127 kernel.set_lws_hint(opt_tuning_params.get_lws());
128 if (_tuning_info.tune_wbsm)
129 {
130 kernel.set_wbsm_hint(opt_tuning_params.get_wbsm());
131 }
132 }
133 }
134 else
135 {
136 // Set Local-Workgroup-Size
137 kernel.set_lws_hint(p->second.get_lws());
138 if (_tuning_info.tune_wbsm)
139 {
140 kernel.set_wbsm_hint(p->second.get_wbsm());
141 }
142 }
143 }
144}
145void CLTuner::tune_kernel_dynamic(ICLKernel &kernel, ITensorPack &tensors)
146{
147 DefaultKernelData data{tensors};

Callers

nothing calls this directly

Calls 9

get_targetMethod · 0.80
findMethod · 0.80
set_lws_hintMethod · 0.80
get_lwsMethod · 0.80
set_wbsm_hintMethod · 0.80
get_wbsmMethod · 0.80
to_stringFunction · 0.50
get_num_compute_unitsMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected