KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
Kernel_Prioritization.cpp
Go to the documentation of this file.
2
3#include "kids/hash_fnv1a.h"
4#include "kids/macro_utils.h"
5
6namespace PROJECT_NS {
7
8Kernel_Prioritization::Kernel_Prioritization(std::vector<std::shared_ptr<Kernel>> kers, int ptype_in)
9 : Kernel(), ptype{ptype_in} {
10 for (auto& ker : kers) { _ref_kernels.push_back(ker); }
11}
12
13const std::string Kernel_Prioritization::getName() {
14 std::stringstream ss;
15 ss << "Kernel_Prioritization [" << ptype << "]";
16 for (auto& ker : _ref_kernels) ss << " #" << std::setfill('0') << std::setw(2) << ker->getID();
17 return ss.str();
18}
19
21
22void Kernel_Prioritization::setInputParam_impl(std::shared_ptr<Param>& PM) {
23 if (ptype == 0)
24 for (auto& ker : _ref_kernels) ker->setInputParam(PM);
25}
26
27void Kernel_Prioritization::setInputDataSet_impl(std::shared_ptr<DataSet>& DS) {
28 if (ptype == 1)
29 for (auto& ker : _ref_kernels) ker->setInputDataSet(DS);
30}
31
33 if (ptype == 2)
34 for (auto& ker : _ref_kernels) ker->initializeKernel(stat);
35 return stat;
36}
37
38}; // namespace PROJECT_NS
this file provides Kernel_Prioritization class enabling reordering different kernels in parsing Param...
virtual Status & initializeKernel_impl(Status &stat)
Virtual function to initialize the kernel implementation.
Kernel_Prioritization(std::vector< std::shared_ptr< Kernel > > kers, int ptype_in)
std::vector< std::shared_ptr< Kernel > > _ref_kernels
virtual void setInputParam_impl(std::shared_ptr< Param > &PM)
Virtual function to set input parameters for the kernel implementation.
virtual const std::string getName()
Get the name of the kernel.
virtual void setInputDataSet_impl(std::shared_ptr< DataSet > &DS)
Virtual function to set input data set for the kernel implementation.
virtual int getType() const
Get the type of the kernel.
this class provides the container and implementation of algorithms
Definition Kernel.h:60
int getID() const
Get the ID of the kernel.
Definition Kernel.cpp:74
#define FUNCTION_NAME
Definition macro_utils.h:9
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
constexpr uint32_t hash(const char *str)
Definition hash_fnv1a.h:12