Commit be0defe1 authored by Carla Guillen's avatar Carla Guillen
Browse files

fixing bugs

parent de8e771e
......@@ -42,19 +42,19 @@ void SMUCNGPerfConfigurator::sensorBase(SMUCSensorBase& s, CFG_VAL config) {
unsigned int position = std::stoul(val.second.data());
s.setPosition(position);
std::string name = s.getName();
if(name.compare("instructions")==0){
if(name.find("instructions") != std::string::npos){
_metricToPosition[SMUCSensorBase::INSTRUCTIONS] = position;
s.setMetric(SMUCSensorBase::INSTRUCTIONS);
} else if(name.compare("clocks") == 0){
} else if(name.find("clocks") != std::string::npos){
_metricToPosition[SMUCSensorBase::CLOCKS] = position;
s.setMetric(SMUCSensorBase::CLOCKS);
} else if(name.compare("ref_clocks") == 0){
} else if(name.find("ref_clocks") != std::string::npos){
_metricToPosition[SMUCSensorBase::CLOCKS_REF] = position;
s.setMetric(SMUCSensorBase::CLOCKS_REF);
} else if(name.compare("cpi") == 0){
} else if(name.find("cpi") != std::string::npos){
_metricToPosition[SMUCSensorBase::CPI] = position;
s.setMetric(SMUCSensorBase::CPI);
} else if(name.compare("frequency") == 0){
} else if(name.find("frequency") != std::string::npos){
_metricToPosition[SMUCSensorBase::FREQUENCY] = position;
s.setMetric(SMUCSensorBase::FREQUENCY);
}
......
......@@ -37,11 +37,13 @@ SMUCNGPerfOperator::~SMUCNGPerfOperator() {
SMUCNGPerfOperator::SMUCNGPerfOperator(const SMUCNGPerfOperator& other) : OperatorTemplate(other){
this->_buffers = other._buffers;
this->_metricToPosition = other._metricToPosition;
}
SMUCNGPerfOperator& SMUCNGPerfOperator::operator=(const SMUCNGPerfOperator& other){
OperatorTemplate::operator =(other);
this->_buffers = other._buffers;
this->_metricToPosition = other._metricToPosition;
return *this;
}
......@@ -67,7 +69,6 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
for(auto& outSensor : unit->getOutputs()){
if( outSensor->getMetric() == SMUCSensorBase::CPI) {
std::cout << "CPI found!";
std::vector<reading_t> & instructions = _buffers[0];
std::vector<reading_t> & clocks = _buffers[1];
query(inputs[_metricToPosition[SMUCSensorBase::INSTRUCTIONS]]->getName(), timestamp, instructions);
......@@ -78,7 +79,6 @@ void SMUCNGPerfOperator::compute(U_Ptr unit) {
outSensor->storeReading(cpi);
}
} else if (outSensor->getMetric() == SMUCSensorBase::FREQUENCY) {
std::cout << "Frequency found!";
std::vector<reading_t> & clocks = _buffers[0];
std::vector<reading_t> & clocks_ref = _buffers[1];
query(inputs[_metricToPosition[SMUCSensorBase::CLOCKS]]->getName(), timestamp, clocks);
......
......@@ -48,6 +48,7 @@ public:
SMUCSensorBase& operator=(const SMUCSensorBase& other){
SensorBase::operator=(other);
copy(other);
return *this;
}
virtual ~SMUCSensorBase(){}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment