Fixed ADL dll loading. The name of the dll is always atiadlxx, except when running as 32-bit app on 64-bit systems (atiadlxy in that case).
3 Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 The contents of this file are subject to the Mozilla Public License Version
6 1.1 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.mozilla.org/MPL/
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 for the specific language governing rights and limitations under the License.
15 The Original Code is the Open Hardware Monitor code.
17 The Initial Developer of the Original Code is
18 Michael Möller <m.moeller@gmx.ch>.
19 Portions created by the Initial Developer are Copyright (C) 2009-2010
20 the Initial Developer. All Rights Reserved.
24 Alternatively, the contents of this file may be used under the terms of
25 either the GNU General Public License Version 2 or later (the "GPL"), or
26 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 in which case the provisions of the GPL or the LGPL are applicable instead
28 of those above. If you wish to allow use of your version of this file only
29 under the terms of either the GPL or the LGPL, and not to allow others to
30 use your version of this file under the terms of the MPL, indicate your
31 decision by deleting the provisions above and replace them with the notice
32 and other provisions required by the GPL or the LGPL. If you do not delete
33 the provisions above, a recipient may use your version of this file under
34 the terms of any one of the MPL, the GPL or the LGPL.
39 using System.Collections.Generic;
41 using System.Reflection;
43 namespace OpenHardwareMonitor.Hardware.ATI {
44 public class ATIGPU : IHardware {
48 private int adapterIndex;
49 private int busNumber;
50 private int deviceNumber;
51 private Sensor temperature;
53 private Sensor coreClock;
54 private Sensor memoryClock;
55 private Sensor coreVoltage;
57 public ATIGPU(string name, int adapterIndex, int busNumber,
61 this.icon = Utilities.EmbeddedResources.GetImage("ati.png");
62 this.adapterIndex = adapterIndex;
63 this.busNumber = busNumber;
64 this.deviceNumber = deviceNumber;
66 ADLFanSpeedInfo speedInfo = new ADLFanSpeedInfo();
67 ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref speedInfo);
70 new Sensor("GPU Core", 0, SensorType.Temperature, this);
71 this.fan = new Sensor("GPU", 0, speedInfo.MaxRPM, SensorType.Fan, this);
72 this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
73 this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
74 this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
78 public int BusNumber { get { return busNumber; } }
80 public int DeviceNumber { get { return deviceNumber; } }
86 public string Identifier {
87 get { return "/atigpu/" + adapterIndex; }
94 public ISensor[] Sensors {
96 return new ISensor[] { coreVoltage, coreClock, memoryClock, temperature,
101 public string GetReport() {
105 public void Update() {
106 ADLTemperature adlt = new ADLTemperature();
107 ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt);
108 temperature.Value = 0.001f * adlt.Temperature;
110 ADLFanSpeedValue adlf = new ADLFanSpeedValue();
111 adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
112 ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf);
113 fan.Value = adlf.FanSpeed;
115 ADLPMActivity adlp = new ADLPMActivity();
116 ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp);
117 coreClock.Value = 0.01f * adlp.EngineClock;
118 memoryClock.Value = 0.01f * adlp.MemoryClock;
119 coreVoltage.Value = 0.001f * adlp.Vddc;
122 #pragma warning disable 67
123 public event SensorEventHandler SensorAdded;
124 public event SensorEventHandler SensorRemoved;
125 #pragma warning restore 67