| 348 | } |
| 349 | |
| 350 | bool CLTuner::save_to_file(const std::string &filename) const |
| 351 | { |
| 352 | if (!_tune_new_kernels || _tuning_params_table.empty() || filename.empty()) |
| 353 | { |
| 354 | return false; |
| 355 | } |
| 356 | std::ofstream fs; |
| 357 | fs.exceptions(std::ifstream::failbit | std::ifstream::badbit); |
| 358 | fs.open(filename, std::ios::out); |
| 359 | std::string header_string = ""; |
| 360 | header_string += "lws"; |
| 361 | if (_tuning_info.tune_wbsm) |
| 362 | { |
| 363 | if (!header_string.empty()) |
| 364 | { |
| 365 | header_string += " "; |
| 366 | } |
| 367 | header_string += "wbsm"; |
| 368 | } |
| 369 | fs << header_string << std::endl; |
| 370 | for (auto const &kernel_data : _tuning_params_table) |
| 371 | { |
| 372 | CLTuningParams tun_pams(kernel_data.second); |
| 373 | fs << kernel_data.first << tun_pams.to_string(_tuning_info) << std::endl; |
| 374 | } |
| 375 | fs.close(); |
| 376 | return true; |
| 377 | } |
| 378 | } // namespace arm_compute |