Skip to content

Commit

Permalink
amd temperature monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
orkblutt committed Dec 11, 2017
1 parent 9752062 commit 375f91c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
26 changes: 26 additions & 0 deletions amdapi_adl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,30 @@ int amdapi_adl::setFanSpeed(int gpu, unsigned int percent)
return 0;
}

int amdapi_adl::getHigherTemp()
{
unsigned int maxTemp = 0;
unsigned int gpuCount = getGPUCount();
for(unsigned int i = 0; i < gpuCount; i++)
{
unsigned int temp = getGpuTemperature(i);
if(temp > maxTemp)
maxTemp = temp;
}
return maxTemp;
}

int amdapi_adl::getLowerTemp()
{
unsigned int minTemp = 100000000;
unsigned int gpuCount = getGPUCount();
for(unsigned int i = 0; i < gpuCount; i++)
{
unsigned int temp = getGpuTemperature(i);
if(temp < minTemp)
minTemp = temp;
}
return minTemp;
}


3 changes: 3 additions & 0 deletions amdapi_adl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class amdapi_adl : public QLibrary

bool isInitialized(){return _isInitialized;}

int getHigherTemp();
int getLowerTemp();


private:

Expand Down
6 changes: 4 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,12 @@ void amdMonitorThrd::run()
while(1)
{
unsigned int gpucount = _amd->getGPUCount();
unsigned int maxTemp = _amd->getHigherTemp();
unsigned int minTemp = _amd->getLowerTemp();

emit gpuInfoSignal(gpucount
, 0
, 0
, maxTemp
, minTemp
, 0
, 0
, 0
Expand Down

0 comments on commit 375f91c

Please sign in to comment.