
commit 25e7cb77683736a588acb6b30a8ac89e2bd7f56a Author: Carl Pearson <pearson@illinois.edu> Date: Fri Sep 20 13:25:49 2019 -0500 automatically define PERFECT_HAS_CUDA with nvcc commit fcc699c165ba515619781aefb378d3c0c4d1093d Author: Carl Pearson <pearson@illinois.edu> Date: Fri Sep 20 13:18:42 2019 -0500 optional CUDA support
27 lines
629 B
C++
27 lines
629 B
C++
#include "perfect/os_perf.hpp"
|
|
|
|
#include <map>
|
|
|
|
int main(void) {
|
|
perfect::init();
|
|
|
|
std::map<int, perfect::OsPerfState> states;
|
|
|
|
for (auto cpu : perfect::cpus()) {
|
|
perfect::OsPerfState state;
|
|
perfect::Result result;
|
|
result = perfect::get_os_perf_state(&state, cpu);
|
|
if (perfect::Result::SUCCESS == result) {
|
|
states[cpu] = state;
|
|
}
|
|
perfect::os_perf_state_maximum(cpu);
|
|
}
|
|
|
|
// do things with all CPUs set to the maximum performancem mode by the OS
|
|
|
|
for (auto kv : states) {
|
|
int cpu = kv.first;
|
|
perfect::OsPerfState state = kv.second;
|
|
perfect::set_os_perf_state(cpu, state);
|
|
}
|
|
} |