Skip to content
Snippets Groups Projects
Commit cb89d89d authored by hashimsharif's avatar hashimsharif
Browse files

Added frequency update time to hpcm controller - config timer

parent 5ab75fdd
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ void updateJetsonGPUFreq(int freq_level) { ...@@ -41,6 +41,7 @@ void updateJetsonGPUFreq(int freq_level) {
unsigned long int readJetsonGPUFreq() { unsigned long int readJetsonGPUFreq() {
FILE* cur_freq_file = FILE* cur_freq_file =
fopen("/sys/devices/17000000.gp10b/devfreq/17000000.gp10b/cur_freq", "r"); fopen("/sys/devices/17000000.gp10b/devfreq/17000000.gp10b/cur_freq", "r");
// fopen("/sys/devices/17000000.gp10b/devfreq/17000000.gp10b/min_freq", "r");
if (cur_freq_file == NULL) { if (cur_freq_file == NULL) {
printf("Could not open cur_freq file \n"); printf("Could not open cur_freq file \n");
} }
...@@ -1370,15 +1371,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST( ...@@ -1370,15 +1371,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST(
RC->findTargetConfiguration(target_speedup, SPEEDUP); RC->findTargetConfiguration(target_speedup, SPEEDUP);
RC->pause_profiler(); RC->pause_profiler();
std::pair<double, double> pinfo = RC->get_time_energy();
RC->reset_profiler();
RC->addToCurrentIterationControlTime(pinfo.first);
RC->addToCurrentIterationControlEnergy(pinfo.second);
//* * //* *
//*Needed for the frequency variation experiment - not part of the control * //*Needed for the frequency variation experiment - not part of the control *
RC->resume_profiler();
RC->updateFrequency(); RC->updateFrequency();
//* */ RC->pause_profiler();
std::pair<double, double> pinfo = RC->get_time_energy(); std::pair<double, double> pinfo2 = RC->get_time_energy();
RC->reset_profiler(); RC->reset_profiler();
RC->addToCurrentIterationControlTime(pinfo.first); RC->addToCurrentIterationConfigTime(pinfo2.first);
RC->addToCurrentIterationControlEnergy(pinfo.second); RC->addToCurrentIterationConfigEnergy(pinfo2.second);
//* */
INFO( INFO(
"current iteration time = %f, current iteration energy = %f\n", "current iteration time = %f, current iteration energy = %f\n",
...@@ -1407,15 +1415,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR( ...@@ -1407,15 +1415,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR(
RC->adjustTargetConfiguration(target_speedup); RC->adjustTargetConfiguration(target_speedup);
RC->pause_profiler(); RC->pause_profiler();
std::pair<double, double> pinfo = RC->get_time_energy();
RC->reset_profiler();
RC->addToCurrentIterationControlTime(pinfo.first);
RC->addToCurrentIterationControlEnergy(pinfo.second);
//* * //* *
//*Needed for the frequency variation experiment - not part of the control * //*Needed for the frequency variation experiment - not part of the control *
RC->resume_profiler();
RC->updateFrequency(); RC->updateFrequency();
//* */ RC->pause_profiler();
std::pair<double, double> pinfo = RC->get_time_energy(); std::pair<double, double> pinfo2 = RC->get_time_energy();
RC->reset_profiler(); RC->reset_profiler();
RC->addToCurrentIterationControlTime(pinfo.first); RC->addToCurrentIterationConfigTime(pinfo2.first);
RC->addToCurrentIterationControlEnergy(pinfo.second); RC->addToCurrentIterationConfigEnergy(pinfo2.second);
//* */
INFO( INFO(
"current iteration time = %f, current iteration energy = %f\n", "current iteration time = %f, current iteration energy = %f\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment