diff options
author | Krzysztof Bogacki <krzysztof.bogacki@leancode.pl> | 2022-06-06 22:48:54 +0300 |
---|---|---|
committer | Jens Peters <jp7677@gmail.com> | 2022-06-25 01:53:54 +0300 |
commit | bf3c425946ab8cb61660f9d0de14e7b8c12ac966 (patch) | |
tree | d8978e6ed3af00aa4cea9ae303e03e0d92e5681b | |
parent | 76fda20dcfc9ea85bc0755776a17759d51e80b37 (diff) |
nvml: Reorder functions to match API header declaration order
I'm sorry, got too annoyed by this.
-rw-r--r-- | src/sysinfo/nvapi_adapter.cpp | 16 | ||||
-rw-r--r-- | src/sysinfo/nvapi_adapter.h | 4 | ||||
-rw-r--r-- | src/sysinfo/nvml.cpp | 28 | ||||
-rw-r--r-- | src/sysinfo/nvml.h | 12 |
4 files changed, 30 insertions, 30 deletions
diff --git a/src/sysinfo/nvapi_adapter.cpp b/src/sysinfo/nvapi_adapter.cpp index a2cf148..b15941e 100644 --- a/src/sysinfo/nvapi_adapter.cpp +++ b/src/sysinfo/nvapi_adapter.cpp @@ -250,10 +250,18 @@ namespace dxvk { return {m_nvml.ErrorString(result)}; } + nvmlReturn_t NvapiAdapter::GetNvmlDeviceClockInfo(nvmlClockType_t type, unsigned int* clock) const { + return m_nvml.DeviceGetClockInfo(m_nvmlDevice, type, clock); + } + nvmlReturn_t NvapiAdapter::GetNvmlDeviceTemperature(nvmlTemperatureSensors_t sensorType, unsigned int* temp) const { return m_nvml.DeviceGetTemperature(m_nvmlDevice, sensorType, temp); } + nvmlReturn_t NvapiAdapter::GetNvmlDevicePerformanceState(nvmlPstates_t* pState) const { + return m_nvml.DeviceGetPerformanceState(m_nvmlDevice, pState); + } + nvmlReturn_t NvapiAdapter::GetNvmlDeviceUtilizationRates(nvmlUtilization_t* utilization) const { return m_nvml.DeviceGetUtilizationRates(m_nvmlDevice, utilization); } @@ -262,14 +270,6 @@ namespace dxvk { return m_nvml.DeviceGetVbiosVersion(m_nvmlDevice, version, length); } - nvmlReturn_t NvapiAdapter::GetNvmlDevicePerformanceState(nvmlPstates_t* pState) const { - return m_nvml.DeviceGetPerformanceState(m_nvmlDevice, pState); - } - - nvmlReturn_t NvapiAdapter::GetNvmlDeviceClockInfo(nvmlClockType_t type, unsigned int* clock) const { - return m_nvml.DeviceGetClockInfo(m_nvmlDevice, type, clock); - } - nvmlReturn_t NvapiAdapter::GetNvmlDeviceBusType(nvmlBusType_t* type) const { return m_nvml.DeviceGetBusType(m_nvmlDevice, type); } diff --git a/src/sysinfo/nvapi_adapter.h b/src/sysinfo/nvapi_adapter.h index e22f0c8..2cf1fe7 100644 --- a/src/sysinfo/nvapi_adapter.h +++ b/src/sysinfo/nvapi_adapter.h @@ -31,11 +31,11 @@ namespace dxvk { [[nodiscard]] bool HasNvml() const; [[nodiscard]] bool HasNvmlDevice() const; [[nodiscard]] std::string GetNvmlErrorString(nvmlReturn_t result) const; + [[nodiscard]] nvmlReturn_t GetNvmlDeviceClockInfo(nvmlClockType_t type, unsigned int* clock) const; [[nodiscard]] nvmlReturn_t GetNvmlDeviceTemperature(nvmlTemperatureSensors_t sensorType, unsigned int* temp) const; + [[nodiscard]] nvmlReturn_t GetNvmlDevicePerformanceState(nvmlPstates_t* pState) const; [[nodiscard]] nvmlReturn_t GetNvmlDeviceUtilizationRates(nvmlUtilization_t* utilization) const; [[nodiscard]] nvmlReturn_t GetNvmlDeviceVbiosVersion(char* version, unsigned int length) const; - [[nodiscard]] nvmlReturn_t GetNvmlDevicePerformanceState(nvmlPstates_t* pState) const; - [[nodiscard]] nvmlReturn_t GetNvmlDeviceClockInfo(nvmlClockType_t type, unsigned int* clock) const; [[nodiscard]] nvmlReturn_t GetNvmlDeviceBusType(nvmlBusType_t* type) const; [[nodiscard]] nvmlReturn_t GetNvmlDeviceDynamicPstatesInfo(nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) const; diff --git a/src/sysinfo/nvml.cpp b/src/sysinfo/nvml.cpp index 4c3c0e4..3c7029d 100644 --- a/src/sysinfo/nvml.cpp +++ b/src/sysinfo/nvml.cpp @@ -21,11 +21,11 @@ namespace dxvk { GETPROCADDR(nvmlErrorString); GETPROCADDR(nvmlDeviceGetHandleByPciBusId_v2); GETPROCADDR(nvmlDeviceGetPciInfo_v3); + GETPROCADDR(nvmlDeviceGetClockInfo); GETPROCADDR(nvmlDeviceGetTemperature); + GETPROCADDR(nvmlDeviceGetPerformanceState); GETPROCADDR(nvmlDeviceGetUtilizationRates); GETPROCADDR(nvmlDeviceGetVbiosVersion); - GETPROCADDR(nvmlDeviceGetPerformanceState); - GETPROCADDR(nvmlDeviceGetClockInfo); GETPROCADDR(nvmlDeviceGetBusType); GETPROCADDR(nvmlDeviceGetDynamicPstatesInfo); @@ -75,12 +75,24 @@ namespace dxvk { : NVML_ERROR_FUNCTION_NOT_FOUND; } + nvmlReturn_t Nvml::DeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) const { + return m_nvmlDeviceGetClockInfo + ? m_nvmlDeviceGetClockInfo(device, type, clock) + : NVML_ERROR_FUNCTION_NOT_FOUND; + } + nvmlReturn_t Nvml::DeviceGetTemperature(nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int* temp) const { return m_nvmlDeviceGetTemperature ? m_nvmlDeviceGetTemperature(device, sensorType, temp) : NVML_ERROR_FUNCTION_NOT_FOUND; } + nvmlReturn_t Nvml::DeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) const { + return m_nvmlDeviceGetPerformanceState + ? m_nvmlDeviceGetPerformanceState(device, pState) + : NVML_ERROR_FUNCTION_NOT_FOUND; + } + nvmlReturn_t Nvml::DeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) const { return m_nvmlDeviceGetUtilizationRates ? m_nvmlDeviceGetUtilizationRates(device, utilization) @@ -93,18 +105,6 @@ namespace dxvk { : NVML_ERROR_FUNCTION_NOT_FOUND; } - nvmlReturn_t Nvml::DeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) const { - return m_nvmlDeviceGetPerformanceState - ? m_nvmlDeviceGetPerformanceState(device, pState) - : NVML_ERROR_FUNCTION_NOT_FOUND; - } - - nvmlReturn_t Nvml::DeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) const { - return m_nvmlDeviceGetClockInfo - ? m_nvmlDeviceGetClockInfo(device, type, clock) - : NVML_ERROR_FUNCTION_NOT_FOUND; - } - nvmlReturn_t Nvml::DeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) const { return m_nvmlDeviceGetBusType ? m_nvmlDeviceGetBusType(device, type) diff --git a/src/sysinfo/nvml.h b/src/sysinfo/nvml.h index 7ccf214..3b8280a 100644 --- a/src/sysinfo/nvml.h +++ b/src/sysinfo/nvml.h @@ -13,11 +13,11 @@ namespace dxvk { [[nodiscard]] virtual const char* ErrorString(nvmlReturn_t result) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) const; + [[nodiscard]] virtual nvmlReturn_t DeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetTemperature(nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int* temp) const; + [[nodiscard]] virtual nvmlReturn_t DeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) const; - [[nodiscard]] virtual nvmlReturn_t DeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) const; - [[nodiscard]] virtual nvmlReturn_t DeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) const; [[nodiscard]] virtual nvmlReturn_t DeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) const; @@ -27,11 +27,11 @@ namespace dxvk { typedef decltype(&nvmlErrorString) PFN_nvmlErrorString; typedef decltype(&nvmlDeviceGetHandleByPciBusId_v2) PFN_nvmlDeviceGetHandleByPciBusId_v2; typedef decltype(&nvmlDeviceGetPciInfo_v3) PFN_nvmlDeviceGetPciInfo_v3; + typedef decltype(&nvmlDeviceGetClockInfo) PFN_nvmlDeviceGetClockInfo; typedef decltype(&nvmlDeviceGetTemperature) PFN_nvmlDeviceGetTemperature; + typedef decltype(&nvmlDeviceGetPerformanceState) PFN_nvmlDeviceGetPerformanceState; typedef decltype(&nvmlDeviceGetUtilizationRates) PFN_nvmlDeviceGetUtilizationRates; typedef decltype(&nvmlDeviceGetVbiosVersion) PFN_nvmlDeviceGetVbiosVersion; - typedef decltype(&nvmlDeviceGetPerformanceState) PFN_nvmlDeviceGetPerformanceState; - typedef decltype(&nvmlDeviceGetClockInfo) PFN_nvmlDeviceGetClockInfo; typedef decltype(&nvmlDeviceGetBusType) PFN_nvmlDeviceGetBusType; typedef decltype(&nvmlDeviceGetDynamicPstatesInfo) PFN_nvmlDeviceGetDynamicPstatesInfo; @@ -41,11 +41,11 @@ namespace dxvk { PFN_nvmlErrorString m_nvmlErrorString{}; PFN_nvmlDeviceGetHandleByPciBusId_v2 m_nvmlDeviceGetHandleByPciBusId_v2{}; PFN_nvmlDeviceGetPciInfo_v3 m_nvmlDeviceGetPciInfo_v3{}; + PFN_nvmlDeviceGetClockInfo m_nvmlDeviceGetClockInfo{}; PFN_nvmlDeviceGetTemperature m_nvmlDeviceGetTemperature{}; + PFN_nvmlDeviceGetPerformanceState m_nvmlDeviceGetPerformanceState{}; PFN_nvmlDeviceGetUtilizationRates m_nvmlDeviceGetUtilizationRates{}; PFN_nvmlDeviceGetVbiosVersion m_nvmlDeviceGetVbiosVersion{}; - PFN_nvmlDeviceGetPerformanceState m_nvmlDeviceGetPerformanceState{}; - PFN_nvmlDeviceGetClockInfo m_nvmlDeviceGetClockInfo{}; PFN_nvmlDeviceGetBusType m_nvmlDeviceGetBusType{}; PFN_nvmlDeviceGetDynamicPstatesInfo m_nvmlDeviceGetDynamicPstatesInfo{}; |