28 #ifndef RUN_IMP_ON_INPUT_H_
29 #define RUN_IMP_ON_INPUT_H_
52 template<RunData_t T, run_environment::AccSetting OPT_IMP_ACCEL,
unsigned int NUM_INPUT>
76 bool loop_iters_templated)
const = 0;
89 std::shared_ptr<ParallelParams> parallel_params,
90 bool run_opt_imp_only,
91 bool run_imp_templated_loop_iters)
const = 0;
104 curr_run_data.
AppendData(run_environment::RunSettings<OPT_IMP_ACCEL>());
107 return curr_run_data;
122 bool run_w_loop_iters_templated)
const
124 MultRunData::mapped_type::value_type out_run_data;
125 enum class RunType { ONLY_RUN, OPTIMIZED_RUN, TEST_PARAMS };
128 std::shared_ptr<ParallelParams> parallel_params =
133 const auto& [default_p_params, alt_p_params] =
138 auto p_param_options = alt_p_params;
139 p_param_options.insert(default_p_params);
146 for (
auto [p_params_iter, run_num] = std::tuple{p_param_options.cbegin(), 0u};
147 run_num < (p_param_options.size() + 1);
148 p_params_iter++, run_num++)
154 RunType curr_run_type;
155 if (alt_p_params.size() == 0) {
158 curr_run_type = RunType::ONLY_RUN;
159 parallel_params->SetParallelDims(
162 else if (run_num == p_param_options.size()) {
164 curr_run_type = RunType::OPTIMIZED_RUN;
167 parallel_params->SetOptimizedParams();
172 curr_run_type = RunType::TEST_PARAMS;
175 parallel_params->SetParallelDims(*p_params_iter);
181 const bool run_results_output{
182 ((curr_run_type != RunType::TEST_PARAMS) ||
183 (*p_params_iter == default_p_params))};
187 if (run_results_output)
193 std::to_string(NUM_INPUT));
196 if ((alt_p_params.size() > 0) &&
204 curr_run_data.
AppendData(parallel_params->AsRunData());
212 const auto run_imps_results =
216 run_w_loop_iters_templated);
220 if ((!run_imps_results) && run_results_output) {
225 if (run_imps_results) {
229 if (curr_run_type == RunType::TEST_PARAMS) {
235 if (run_imps_results) {
236 parallel_params->AddTestResultsForParallelParams(
237 *p_params_iter, curr_run_data);
239 if (*p_params_iter == default_p_params) {
243 std::move(curr_run_data);
246 else if (curr_run_type == RunType::ONLY_RUN) {
254 std::move(curr_run_data);
259 else if (curr_run_type == RunType::OPTIMIZED_RUN) {
262 std::move(curr_run_data);
Header for defining aliases for storing run results and evaluating implementations.
std::map< InputSignature, std::optional< std::map< run_environment::ParallelParamsSetting, RunData > >> MultRunData
Alias mapping input signature to run data for each parallel parameters setting Run data is null if r...
Declares abstract class for holding and processing parallelization parameters.
Contains namespace with enums and constants for implementation run evaluation.
Declares and defines structure that stores settings for current implementation run as well as functio...
Define constraints for data type in processing.
Class to store headers with data corresponding to current program run and evaluation.
void AppendData(const RunData &rundata)
Append current RunData with input RunData.
void AddDataWHeader(const std::string &header, const std::string &data)
Add string data with header describing added data.
const std::map< std::size_t, std::string_view > kDataSizeToNameMap
Mapping from data size to data type string.
@ kAllowDiffKernelParallelParamsInRun
constexpr std::string_view kInputIdxHeader
constexpr std::string_view kDatatypeHeader
constexpr std::string_view kLoopItersTemplatedHeader
Structure that stores settings for current implementation run.
std::pair< std::array< unsigned int, 2 >, std::set< std::array< unsigned int, 2 > > > p_params_default_alt_options
OptParallelParamsSetting opt_parallel_params_setting