diff --git a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp index 89968f2b094e34d3ec4b8a790ab678fa4d81201d..813d77c46a51ede56dcc509495308637eb2ce862 100644 --- a/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp +++ b/llvm/projects/hpvm-tensor-rt/tensor_runtime/src/hpvm-rt-controller.cpp @@ -41,6 +41,7 @@ void updateJetsonGPUFreq(int freq_level) { unsigned long int readJetsonGPUFreq() { FILE* cur_freq_file = 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) { printf("Could not open cur_freq file \n"); } @@ -1370,15 +1371,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST( RC->findTargetConfiguration(target_speedup, SPEEDUP); 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 * + RC->resume_profiler(); 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->addToCurrentIterationControlTime(pinfo.first); - RC->addToCurrentIterationControlEnergy(pinfo.second); + RC->addToCurrentIterationConfigTime(pinfo2.first); + RC->addToCurrentIterationConfigEnergy(pinfo2.second); + //* */ INFO( "current iteration time = %f, current iteration energy = %f\n", @@ -1407,15 +1415,22 @@ extern "C" void llvm_hpvm_invokeRtControl_ADJUST_PR( RC->adjustTargetConfiguration(target_speedup); 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 * + RC->resume_profiler(); 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->addToCurrentIterationControlTime(pinfo.first); - RC->addToCurrentIterationControlEnergy(pinfo.second); + RC->addToCurrentIterationConfigTime(pinfo2.first); + RC->addToCurrentIterationConfigEnergy(pinfo2.second); + //* */ INFO( "current iteration time = %f, current iteration energy = %f\n",