PowerMonitor::PowerMonitor() { powerA7 = NULL; powerA15 = NULL; powerGPU = NULL; powerDRAM = NULL; sensingMethod = ODROID; if (enableSensor(SENSOR_A7) == 0) { enableSensor(SENSOR_A15); enableSensor(SENSOR_GPU); enableSensor(SENSOR_DRAM); sensingMethod = ODROID; std::cerr << "Power sensors: ODROID" << std::endl; #ifdef PAPI_MONITORING } else { /************************************************* Insert code to attempt to initialise for PAPI here please *****************************************************/ if(papi_init() == 0) { /* Dependent on what is required for initialisation of CUDA? and when it becomes available OpenCL for GPU PAPI then we can either insert the initialisation code into papi_init OR to create different initialisation functions ... */ sensingMethod = PAPI_CPU; std::cerr << "Power sensors: PAPI CPU" << std::endl; } } #else } else {
void WebAppBase::fastAccelerometerOn(bool enable) { #if defined(HAS_NYX) if (enable && enableSensor(NYXConnectorBase::SensorAcceleration)) { if (m_SensorList.contains(NYXConnectorBase::SensorAcceleration)) { NYXConnectorBase *pSensor = m_SensorList.value(NYXConnectorBase::SensorAcceleration); pSensor->setRate(NYXConnectorBase::SensorReportRateHighest); } } #endif }
bool WebAppBase::enableSensor(Palm::SensorType aSensorType, bool aNeedEvents) { bool isSuccess = false; #if defined(HAS_NYX) NYXConnectorBase::Sensor nyxSensorType = mapSensorType(aSensorType); if (aNeedEvents) { isSuccess = enableSensor(nyxSensorType); } else { isSuccess = disableSensor(nyxSensorType); } #endif return isSuccess; }