if(std::string(attr[i]) == "name")name(attr[i+1]);
if(std::string(attr[i]) == "state")this->state(attr[i+1]);
if(std::string(attr[i]) == "nbranch")nbranch(atoi(attr[i+1]));
+ if(std::string(attr[i]) == "weight")weight(atof(attr[i+1]));
if(std::string(attr[i]) == "type")datatype(attr[i+1]);
}
postAttr();
virtual void pre ()
{
_nbranch=0;
+ _weight=1;
this->looptypeParser<T>::pre();
}
virtual void name (const std::string& name)
DEBTRACE("foreach_nbranch: " << n )
_nbranch=n;
}
+ virtual void weight (const double& x)
+ {
+ DEBTRACE("foreach_weight: " << x )
+ _weight=x;
+ }
virtual void datatype (const std::string& type)
{
DEBTRACE("foreach_datatype: "<< type)
this->_cnode=theRuntime->createForEachLoop(_name,currentProc->typeMap[_datatype]);
//set number of branches
if(_nbranch > 0)this->_cnode->edGetNbOfBranchesPort()->edInit(_nbranch);
+ this->_cnode->setWeight(_weight);
this->_cnodes.push_back(this->_cnode);
currentProc->names.push_back(_fullname + '.');
}
return b;
}
int _nbranch;
+ double _weight;
std::string _fullname;
std::string _name;
std::string _datatype;
if(std::string(attr[i]) == "name")name(attr[i+1]);
if(std::string(attr[i]) == "state")this->state(attr[i+1]);
if(std::string(attr[i]) == "nbranch")nbranch(atoi(attr[i+1]));
+ if(std::string(attr[i]) == "weight")weight(atof(attr[i+1]));
if(std::string(attr[i]) == "lib")lib(attr[i+1]);
if(std::string(attr[i]) == "entry")entry(attr[i+1]);
if(std::string(attr[i]) == "kind")kind(attr[i+1]);
virtual void pre ()
{
_nbranch=0;
+ _weight=1;
this->looptypeParser<T>::pre();
}
virtual void name (const std::string& name)
DEBTRACE("optimizer_nbranch: " << n )
_nbranch=n;
}
+ virtual void weight (const double& x)
+ {
+ DEBTRACE("foreach_weight: " << x )
+ _weight=x;
+ }
virtual void kind (const std::string& name)
{
_kind=name;
this->_cnode=theRuntime->createOptimizerLoop(_name,_lib,_entry,true,_kind, currentProc);
//set number of branches
if(_nbranch > 0)this->_cnode->edGetNbOfBranchesPort()->edInit(_nbranch);
+ this->_cnode->setWeight(_weight);
this->_cnodes.push_back(this->_cnode);
currentProc->names.push_back(_fullname + '.');
}
}
int _nbranch;
+ double _weight;
std::string _fullname;
std::string _name;
std::string _entry;