Example #1
0
void NvmlSensorDriver::read_temps() const
{
	nvmlReturn_t ret;
	unsigned int tmp;
	if ((ret = dl_nvmlDeviceGetTemperature(device_, NVML_TEMPERATURE_GPU, &tmp)))
		throw SystemError(MSG_T_GET(path_) + "Error code (cf. nvml.h): " + std::to_string(ret));
	temp_state.add_temp(tmp);
}
Example #2
0
void NvmlSensorDriver::read_temps() const
{
    nvmlReturn_t ret;
    unsigned int tmp;
    if ((ret = dl_nvmlDeviceGetTemperature(device_, NVML_TEMPERATURE_GPU, &tmp)))
        fail(TF_ERR)
                << SystemError(MSG_T_GET(path_) + "Error code (cf. nvml.h): " + std::to_string(ret))
                << flush;
    *temp_state.temp_idx = tmp;
    update_tempstate(correction_[0]);
}