node-gpuinfo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +336 -0
- package/binding.gyp +69 -0
- package/build/Release/gpu.exp +0 -0
- package/build/Release/gpu.lib +0 -0
- package/build/Release/gpu.node +0 -0
- package/build/Release/gpu.pdb +0 -0
- package/build/binding.sln +19 -0
- package/build/gpu.vcxproj +175 -0
- package/build/gpu.vcxproj.filters +169 -0
- package/example.js +69 -0
- package/index.js +33 -0
- package/package.json +68 -0
- package/src/binding.cpp +201 -0
- package/src/gpu_info.c +130 -0
- package/src/gpu_info.h +86 -0
- package/src/includes/adlx/ADLX.h +367 -0
- package/src/includes/adlx/ADLXDefines.h +1345 -0
- package/src/includes/adlx/ADLXHelper/ADLXHelper.c +175 -0
- package/src/includes/adlx/ADLXHelper/ADLXHelper.h +245 -0
- package/src/includes/adlx/ADLXHelper/WinAPIS.c +64 -0
- package/src/includes/adlx/ADLXStructures.h +206 -0
- package/src/includes/adlx/ADLXVersion.h +18 -0
- package/src/includes/adlx/I3DSettings.h +3476 -0
- package/src/includes/adlx/I3DSettings1.h +292 -0
- package/src/includes/adlx/I3DSettings2.h +317 -0
- package/src/includes/adlx/IApplications.h +397 -0
- package/src/includes/adlx/IChangedEvent.h +71 -0
- package/src/includes/adlx/ICollections.h +325 -0
- package/src/includes/adlx/IDesktops.h +918 -0
- package/src/includes/adlx/IDisplay3DLUT.h +663 -0
- package/src/includes/adlx/IDisplayGamma.h +683 -0
- package/src/includes/adlx/IDisplayGamut.h +760 -0
- package/src/includes/adlx/IDisplaySettings.h +3476 -0
- package/src/includes/adlx/IDisplays.h +2676 -0
- package/src/includes/adlx/IDisplays1.h +191 -0
- package/src/includes/adlx/IDisplays2.h +188 -0
- package/src/includes/adlx/IDisplays3.h +256 -0
- package/src/includes/adlx/IGPUAutoTuning.h +460 -0
- package/src/includes/adlx/IGPUManualFanTuning.h +1007 -0
- package/src/includes/adlx/IGPUManualGFXTuning.h +607 -0
- package/src/includes/adlx/IGPUManualPowerTuning.h +340 -0
- package/src/includes/adlx/IGPUManualVRAMTuning.h +576 -0
- package/src/includes/adlx/IGPUPresetTuning.h +469 -0
- package/src/includes/adlx/IGPUTuning.h +1239 -0
- package/src/includes/adlx/IGPUTuning1.h +197 -0
- package/src/includes/adlx/II2C.h +198 -0
- package/src/includes/adlx/ILog.h +72 -0
- package/src/includes/adlx/IMultiMedia.h +578 -0
- package/src/includes/adlx/IPerformanceMonitoring.h +2520 -0
- package/src/includes/adlx/IPerformanceMonitoring1.h +134 -0
- package/src/includes/adlx/IPerformanceMonitoring2.h +341 -0
- package/src/includes/adlx/IPerformanceMonitoring3.h +199 -0
- package/src/includes/adlx/IPowerTuning.h +473 -0
- package/src/includes/adlx/IPowerTuning1.h +515 -0
- package/src/includes/adlx/ISmartAccessMemory.h +114 -0
- package/src/includes/adlx/ISystem.h +1557 -0
- package/src/includes/adlx/ISystem1.h +237 -0
- package/src/includes/adlx/ISystem2.h +643 -0
- package/src/linux/amd_linux.c +269 -0
- package/src/linux/intel_linux.c +20 -0
- package/src/linux/nvidia_linux.c +257 -0
- package/src/macos/amd_mac.c +131 -0
- package/src/macos/intel_mac.c +131 -0
- package/src/macos/nvidia_mac.c +21 -0
- package/src/vendor/amd.c +37 -0
- package/src/vendor/intel.c +37 -0
- package/src/vendor/nvidia.c +37 -0
- package/src/windows/amd_windows.c +468 -0
- package/src/windows/intel_windows.c +157 -0
- package/src/windows/nvidia_windows.c +252 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
//-------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
#ifndef ADLX_IGPUTUNING1_H
|
|
7
|
+
#define ADLX_IGPUTUNING1_H
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "ADLXStructures.h"
|
|
11
|
+
#include "IGPUTuning.h"
|
|
12
|
+
|
|
13
|
+
//-------------------------------------------------------------------------------------------------
|
|
14
|
+
//IGPUTuning1.h - Interfaces for ADLX GPU Tuning functionality
|
|
15
|
+
|
|
16
|
+
#pragma region IADLXGPUTuningServices1
|
|
17
|
+
#if defined (__cplusplus)
|
|
18
|
+
namespace adlx
|
|
19
|
+
{
|
|
20
|
+
class ADLX_NO_VTABLE IADLXGPU;
|
|
21
|
+
class ADLX_NO_VTABLE IADLXSmartAccessMemory;
|
|
22
|
+
class ADLX_NO_VTABLE IADLXGPUTuningServices1 : public IADLXGPUTuningServices
|
|
23
|
+
{
|
|
24
|
+
public:
|
|
25
|
+
ADLX_DECLARE_IID(L"IADLXGPUTuningServices1")
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*@page DOX_IADLXGPUTuningServices1_GetSmartAccessMemory GetSmartAccessMemory
|
|
29
|
+
*@ENG_START_DOX @brief Gets the reference counted AMD SmartAccess Memory interface for a GPU. @ENG_END_DOX
|
|
30
|
+
*
|
|
31
|
+
*@syntax
|
|
32
|
+
*@codeStart
|
|
33
|
+
* @ref ADLX_RESULT GetSmartAccessMemory (@ref DOX_IADLXGPU* pGPU, @ref DOX_IADLXSmartAccessMemory** ppSmartAccessMemory)
|
|
34
|
+
*@codeEnd
|
|
35
|
+
*
|
|
36
|
+
*@params
|
|
37
|
+
*@paramrow{1.,[in] ,pGPU,@ref DOX_IADLXGPU* ,@ENG_START_DOX The pointer to the GPU interface. @ENG_END_DOX}
|
|
38
|
+
*@paramrow{2.,[out],ppSmartAccessMemory,@ref DOX_IADLXSmartAccessMemory**,@ENG_START_DOX The address of a pointer to the returned interface. If the interface is not successfully returned\, the method sets the dereferenced address __*ppSmartAccessMemory__ to __nullptr__. @ENG_END_DOX}
|
|
39
|
+
*
|
|
40
|
+
*@retvalues
|
|
41
|
+
*@ENG_START_DOX
|
|
42
|
+
* If the interface is successfully returned, __ADLX_OK__ is returned. <br>
|
|
43
|
+
* If the interface is not successfully returned, an error code is returned. <br>
|
|
44
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
45
|
+
*
|
|
46
|
+
*@detaileddesc
|
|
47
|
+
*@ENG_START_DOX @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when its no longer needed. @ENG_END_DOX
|
|
48
|
+
*
|
|
49
|
+
*@addinfo
|
|
50
|
+
*@ENG_START_DOX
|
|
51
|
+
*In C++, when using ADLX interfaces as smart pointers, there is no need to call @ref DOX_IADLXInterface_Release because smart pointers call it in their internal implementation. @ENG_END_DOX
|
|
52
|
+
*
|
|
53
|
+
*@copydoc IADLXGPUTuningServices1_REQ_TABLE
|
|
54
|
+
*/
|
|
55
|
+
virtual ADLX_RESULT ADLX_STD_CALL GetSmartAccessMemory(IADLXGPU* pGPU, IADLXSmartAccessMemory** ppSmartAccessMemory) = 0;
|
|
56
|
+
}; //IADLXGPUTuningServices1
|
|
57
|
+
typedef IADLXInterfacePtr_T<IADLXGPUTuningServices1> IADLXGPUTuningServices1Ptr;
|
|
58
|
+
} // namespace adlx
|
|
59
|
+
#else // __cplusplus
|
|
60
|
+
ADLX_DECLARE_IID(IADLXGPUTuningServices1, L"IADLXGPUTuningServices1")
|
|
61
|
+
typedef struct IADLXSmartAccessMemory IADLXSmartAccessMemory;
|
|
62
|
+
typedef struct IADLXGPUTuningServices1 IADLXGPUTuningServices1;
|
|
63
|
+
|
|
64
|
+
typedef struct IADLXGPUTuningServices1Vtbl
|
|
65
|
+
{
|
|
66
|
+
//IADLXInterface
|
|
67
|
+
adlx_long(ADLX_STD_CALL* Acquire)(IADLXGPUTuningServices1* pThis);
|
|
68
|
+
adlx_long(ADLX_STD_CALL* Release)(IADLXGPUTuningServices1* pThis);
|
|
69
|
+
ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXGPUTuningServices1* pThis, const wchar_t* interfaceId, void** ppInterface);
|
|
70
|
+
|
|
71
|
+
//IADLXGPUTuningServices
|
|
72
|
+
ADLX_RESULT(ADLX_STD_CALL* GetGPUTuningChangedHandling)(IADLXGPUTuningServices1* pThis, IADLXGPUTuningChangedHandling** ppGPUTuningChangedHandling);
|
|
73
|
+
ADLX_RESULT(ADLX_STD_CALL* IsAtFactory)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* isFactory);
|
|
74
|
+
ADLX_RESULT(ADLX_STD_CALL* ResetToFactory)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU);
|
|
75
|
+
|
|
76
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedAutoTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
77
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedPresetTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
78
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedManualGFXTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
79
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedManualVRAMTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
80
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedManualFanTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
81
|
+
ADLX_RESULT(ADLX_STD_CALL* IsSupportedManualPowerTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, adlx_bool* supported);
|
|
82
|
+
|
|
83
|
+
ADLX_RESULT(ADLX_STD_CALL* GetAutoTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppAutoTuning);
|
|
84
|
+
ADLX_RESULT(ADLX_STD_CALL* GetPresetTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppPresetTuning);
|
|
85
|
+
ADLX_RESULT(ADLX_STD_CALL* GetManualGFXTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppManualGFXTuning);
|
|
86
|
+
ADLX_RESULT(ADLX_STD_CALL* GetManualVRAMTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppManualVRAMTuning);
|
|
87
|
+
ADLX_RESULT(ADLX_STD_CALL* GetManualFanTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppManualFanTuning);
|
|
88
|
+
ADLX_RESULT(ADLX_STD_CALL* GetManualPowerTuning)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXInterface** ppManualPowerTuning);
|
|
89
|
+
|
|
90
|
+
//IADLXGPUTuningServices1
|
|
91
|
+
ADLX_RESULT(ADLX_STD_CALL* GetSmartAccessMemory)(IADLXGPUTuningServices1* pThis, IADLXGPU* pGPU, IADLXSmartAccessMemory** ppSmartAccessMemory);
|
|
92
|
+
}IADLXGPUTuningServices1Vtbl;
|
|
93
|
+
|
|
94
|
+
struct IADLXGPUTuningServices1 { const IADLXGPUTuningServices1Vtbl* pVtbl; };
|
|
95
|
+
#endif // __cplusplus
|
|
96
|
+
#pragma endregion IADLXGPUTuningServices1
|
|
97
|
+
|
|
98
|
+
#pragma region IADLXGPUTuningChangedEvent1
|
|
99
|
+
#if defined (__cplusplus)
|
|
100
|
+
namespace adlx
|
|
101
|
+
{
|
|
102
|
+
class ADLX_NO_VTABLE IADLXGPUTuningChangedEvent1 : public IADLXGPUTuningChangedEvent
|
|
103
|
+
{
|
|
104
|
+
public:
|
|
105
|
+
ADLX_DECLARE_IID(L"IADLXGPUTuningChangedEvent1")
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
*@page DOX_IADLXGPUTuningChangedEvent1_IsSmartAccessMemoryChanged IsSmartAccessMemoryChanged
|
|
109
|
+
*@ENG_START_DOX @brief Checks for changes to the AMD SmartAccess Memory settings. @ENG_END_DOX
|
|
110
|
+
*
|
|
111
|
+
*@syntax
|
|
112
|
+
*@codeStart
|
|
113
|
+
* adlx_bool IsSmartAccessMemoryChanged ()
|
|
114
|
+
*@codeEnd
|
|
115
|
+
*
|
|
116
|
+
*@params
|
|
117
|
+
*N/A
|
|
118
|
+
*
|
|
119
|
+
*@retvalues
|
|
120
|
+
*@ENG_START_DOX If AMD SmartAccess Memory settings are changed, __true__ is returned.<br>
|
|
121
|
+
* If AMD SmartAccess Memory settings are not changed, __false__ is returned.<br> @ENG_END_DOX
|
|
122
|
+
*
|
|
123
|
+
*@addinfo
|
|
124
|
+
*@ENG_START_DOX
|
|
125
|
+
* __Note:__ To obtain the GPU, use @ref DOX_IADLXGPUTuningChangedEvent_GetGPU.
|
|
126
|
+
* @ENG_END_DOX
|
|
127
|
+
*
|
|
128
|
+
*@copydoc IADLXGPUTuningChangedEvent1_REQ_TABLE
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
virtual adlx_bool ADLX_STD_CALL IsSmartAccessMemoryChanged() = 0;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
*@page DOX_IADLXGPUTuningChangedEvent1_GetSmartAccessMemoryStatus GetSmartAccessMemoryStatus
|
|
135
|
+
*@ENG_START_DOX @brief Gets the current AMD SmartAccess Memory status. @ENG_END_DOX
|
|
136
|
+
*
|
|
137
|
+
*@syntax
|
|
138
|
+
*@codeStart
|
|
139
|
+
* @ref ADLX_RESULT GetSmartAccessMemoryStatus (adlx_bool* pEnabled, adlx_bool* pCompleted)
|
|
140
|
+
*@codeEnd
|
|
141
|
+
*
|
|
142
|
+
*@params
|
|
143
|
+
*@paramrow{1.,[out] ,pEnabled,adlx_bool* ,@ENG_START_DOX The pointer to a variable where the current state of AMD SmartAccess Memory is returned. The variable is __true__ if AMD SmartAccess Memory is enabled. The variable is __false__ if AMD SmartAccess Memory is disabled. @ENG_END_DOX}
|
|
144
|
+
*@paramrow{2.,[out] ,pEnabled,adlx_bool* ,@ENG_START_DOX The pointer to a variable where the complete state of AMD SmartAccess Memory is returned. The variable is __true__ if AMD SmartAccess Memory is completed. The variable is __false__ if AMD SmartAccess Memory is not completed. @ENG_END_DOX}
|
|
145
|
+
*
|
|
146
|
+
*@retvalues
|
|
147
|
+
*@ENG_START_DOX If the interface is successfully returned, __ADLX_OK__ is returned.<br>
|
|
148
|
+
* If the interface is not successfully returned, an error code is returned.<br>
|
|
149
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
|
|
150
|
+
*
|
|
151
|
+
*@addinfo
|
|
152
|
+
*@ENG_START_DOX
|
|
153
|
+
* __Note:__ Use @ref DOX_IADLXGPUTuningChangedEvent_GetGPU to obtain the GPU.
|
|
154
|
+
* @ENG_END_DOX
|
|
155
|
+
*
|
|
156
|
+
*@copydoc IADLXGPUTuningChangedEvent1_REQ_TABLE
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
virtual ADLX_RESULT ADLX_STD_CALL GetSmartAccessMemoryStatus(adlx_bool* pEnabled, adlx_bool* pCompleted) = 0;
|
|
160
|
+
};
|
|
161
|
+
//----------------------------------------------------------------------------------------------
|
|
162
|
+
typedef IADLXInterfacePtr_T<IADLXGPUTuningChangedEvent1> IADLXGPUTuningChangedEvent1Ptr;
|
|
163
|
+
} //namespace adlx
|
|
164
|
+
#else //__cplusplus
|
|
165
|
+
ADLX_DECLARE_IID(IADLXGPUTuningChangedEvent1, L"IADLXGPUTuningChangedEvent1")
|
|
166
|
+
|
|
167
|
+
typedef struct IADLXGPUTuningChangedEvent1 IADLXGPUTuningChangedEvent1;
|
|
168
|
+
|
|
169
|
+
typedef struct IADLXGPUTuningChangedEvent1Vtbl
|
|
170
|
+
{
|
|
171
|
+
// IADLXInterface
|
|
172
|
+
adlx_long(ADLX_STD_CALL* Acquire)(IADLXGPUTuningChangedEvent1* pThis);
|
|
173
|
+
adlx_long(ADLX_STD_CALL* Release)(IADLXGPUTuningChangedEvent1* pThis);
|
|
174
|
+
ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXGPUTuningChangedEvent1* pThis, const wchar_t* interfaceId, void** ppInterface);
|
|
175
|
+
|
|
176
|
+
// IADLXChangedEvent
|
|
177
|
+
ADLX_SYNC_ORIGIN(ADLX_STD_CALL* GetOrigin)(IADLXGPUTuningChangedEvent1* pThis);
|
|
178
|
+
|
|
179
|
+
// IADLXGPUTuningChangedEvent
|
|
180
|
+
ADLX_RESULT(ADLX_STD_CALL* GetGPU)(IADLXGPUTuningChangedEvent1* pThis, IADLXGPU** ppGPU);
|
|
181
|
+
adlx_bool(ADLX_STD_CALL* IsAutomaticTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
182
|
+
adlx_bool(ADLX_STD_CALL* IsPresetTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
183
|
+
adlx_bool(ADLX_STD_CALL* IsManualGPUCLKTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
184
|
+
adlx_bool(ADLX_STD_CALL* IsManualVRAMTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
185
|
+
adlx_bool(ADLX_STD_CALL* IsManualFanTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
186
|
+
adlx_bool(ADLX_STD_CALL* IsManualPowerTuningChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
187
|
+
|
|
188
|
+
// IADLXGPUTuningChangedEvent1
|
|
189
|
+
adlx_bool(ADLX_STD_CALL* IsSmartAccessMemoryChanged)(IADLXGPUTuningChangedEvent1* pThis);
|
|
190
|
+
ADLX_RESULT(ADLX_STD_CALL* GetSmartAccessMemoryStatus)(IADLXGPUTuningChangedEvent1* pThis, adlx_bool* pEnabled, adlx_bool* pCompleted);
|
|
191
|
+
} IADLXGPUTuningChangedEvent1Vtbl;
|
|
192
|
+
|
|
193
|
+
struct IADLXGPUTuningChangedEvent1 { const IADLXGPUTuningChangedEvent1Vtbl* pVtbl; };
|
|
194
|
+
#endif //__cplusplus
|
|
195
|
+
#pragma endregion IADLXGPUTuningChangedEvent1
|
|
196
|
+
|
|
197
|
+
#endif // ADLX_IGPUTUNING1_H
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
//-------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
#ifndef ADLX_II2C_H
|
|
7
|
+
#define ADLX_II2C_H
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "ADLXDefines.h"
|
|
11
|
+
|
|
12
|
+
//-------------------------------------------------------------------------------------------------
|
|
13
|
+
//II2C.h - Interfaces for ADLX GPU I2C functionality
|
|
14
|
+
|
|
15
|
+
//I2C setting interface
|
|
16
|
+
#pragma region IADLXI2C
|
|
17
|
+
#if defined (__cplusplus)
|
|
18
|
+
namespace adlx
|
|
19
|
+
{
|
|
20
|
+
class ADLX_NO_VTABLE IADLXI2C : public IADLXInterface
|
|
21
|
+
{
|
|
22
|
+
public:
|
|
23
|
+
ADLX_DECLARE_IID (L"IADLXI2C")
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*@page DOX_IADLXI2C_Version Version
|
|
27
|
+
*@ENG_START_DOX @brief Retrieves the major and minor software version of I2C interface on a GPU. @ENG_END_DOX
|
|
28
|
+
*
|
|
29
|
+
*@syntax
|
|
30
|
+
*@codeStart
|
|
31
|
+
* @ref ADLX_RESULT Version (adlx_int* major, adlx_int* minor)
|
|
32
|
+
*@codeEnd
|
|
33
|
+
*
|
|
34
|
+
*@params
|
|
35
|
+
* @paramrow{1.,[out],major,adlx_int*,@ENG_START_DOX A pointer to a variable where the I2C major version is returned. @ENG_END_DOX}
|
|
36
|
+
* @paramrow{2.,[out],minor,adlx_int*,@ENG_START_DOX A pointer to a variable where the I2C minor version is returned. @ENG_END_DOX}
|
|
37
|
+
*
|
|
38
|
+
*@retvalues
|
|
39
|
+
*@ENG_START_DOX If the I2C major version and the I2C minor version are successfully returned, __ADLX_OK__ is returned. <br>
|
|
40
|
+
* If the I2C major version and the I2C minor version are not successfully returned, an error code is returned. <br>
|
|
41
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
*@copydoc IADLXI2C_REQ_TABLE
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
virtual ADLX_RESULT ADLX_STD_CALL Version (adlx_int* major, adlx_int* minor) = 0;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
*@page DOX_IADLXI2C_IsSupported IsSupported
|
|
52
|
+
*@ENG_START_DOX @brief Checks if the OEM device data can be read and written through the I2C bus on a GPU. @ENG_END_DOX
|
|
53
|
+
*
|
|
54
|
+
*@syntax
|
|
55
|
+
*@codeStart
|
|
56
|
+
* @ref ADLX_RESULT IsSupported (@ref ADLX_I2C_LINE line, adlx_int address, adlx_bool* isSupported)
|
|
57
|
+
*@codeEnd
|
|
58
|
+
*
|
|
59
|
+
*@params
|
|
60
|
+
* @paramrow{1.,[in],line,@ref ADLX_I2C_LINE,@ENG_START_DOX The I2C line. @ENG_END_DOX}
|
|
61
|
+
* @paramrow{2.,[in],address,adlx_int,@ENG_START_DOX The 7-bit I2C slave device address which is shifted one bit to the left. @ENG_END_DOX}
|
|
62
|
+
* @paramrow{2.,[out],isSupported,adlx_bool*,@ENG_START_DOX A pointer to a variable where the status of the I2C bus read and write is returned. The variable is __true__ if the OEM device data can be read and written through the I2C bus. The variable is __false__ if the OEM device data cannot be read and written through the I2C bus. @ENG_END_DOX}
|
|
63
|
+
*
|
|
64
|
+
*@retvalues
|
|
65
|
+
*@ENG_START_DOX If the status of the I2C bus read and write is successfully returned, __ADLX_OK__ is returned. <br>
|
|
66
|
+
* If the status of the I2C bus read and write is not successfully returned, an error code is returned. <br>
|
|
67
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
68
|
+
*
|
|
69
|
+
*
|
|
70
|
+
*
|
|
71
|
+
*@copydoc IADLXI2C_REQ_TABLE
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
virtual ADLX_RESULT ADLX_STD_CALL IsSupported (ADLX_I2C_LINE line, adlx_int address, adlx_bool* isSupported) = 0;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*@page DOX_IADLXI2C_Read Read
|
|
78
|
+
*@ENG_START_DOX @brief Reads the OEM device data through the I2C bus of a GPU. @ENG_END_DOX
|
|
79
|
+
*
|
|
80
|
+
*@syntax
|
|
81
|
+
*@codeStart
|
|
82
|
+
* @ref ADLX_RESULT Read (@ref ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data)
|
|
83
|
+
*@codeEnd
|
|
84
|
+
*
|
|
85
|
+
*@params
|
|
86
|
+
* @paramrow{1.,[in],line,@ref ADLX_I2C_LINE,@ENG_START_DOX The I2C line. @ENG_END_DOX}
|
|
87
|
+
* @paramrow{2.,[in],speed,adlx_int,@ENG_START_DOX The I2C clock speed (in KHz). @ENG_END_DOX}
|
|
88
|
+
* @paramrow{3.,[in],address,adlx_int,@ENG_START_DOX The 7-bit I2C slave device address which is shifted one bit to the left. @ENG_END_DOX}
|
|
89
|
+
* @paramrow{4.,[in],offset,adlx_int,@ENG_START_DOX The offset of the data from the address. @ENG_END_DOX}
|
|
90
|
+
* @paramrow{5.,[in],dataSize,adlx_int,@ENG_START_DOX The size (in bytes) of the buffer for the OEM device data. @ENG_END_DOX}
|
|
91
|
+
* @paramrow{6.,[in],data,adlx_byte*,@ENG_START_DOX The address to the buffer with the new OEM data. @ENG_END_DOX}
|
|
92
|
+
*
|
|
93
|
+
*@retvalues
|
|
94
|
+
*@ENG_START_DOX If the OEM device data is successfully returned, __ADLX_OK__ is returned. <br>
|
|
95
|
+
* If the OEM device data is not successfully returned, an error code is returned. <br>
|
|
96
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
97
|
+
*
|
|
98
|
+
*@detaileddesc
|
|
99
|
+
*@ENG_START_DOX @details The application is responsible to allocate a buffer sufficiently large to hold the requested OEM device data. @ENG_END_DOX
|
|
100
|
+
*
|
|
101
|
+
*
|
|
102
|
+
*@copydoc IADLXI2C_REQ_TABLE
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
virtual ADLX_RESULT ADLX_STD_CALL Read (ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data) = 0;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
*@page DOX_IADLXI2C_RepeatedStartRead RepeatedStartRead
|
|
109
|
+
*@ENG_START_DOX @brief Repeat start reads the OEM device data through the I2C bus of a GPU. @ENG_END_DOX
|
|
110
|
+
*
|
|
111
|
+
*@syntax
|
|
112
|
+
*@codeStart
|
|
113
|
+
* @ref ADLX_RESULT RepeatedStartRead (@ref ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data)
|
|
114
|
+
*@codeEnd
|
|
115
|
+
*
|
|
116
|
+
*@params
|
|
117
|
+
* @paramrow{1.,[in],line,@ref ADLX_I2C_LINE,@ENG_START_DOX The I2C line. @ENG_END_DOX}
|
|
118
|
+
* @paramrow{2.,[in],speed,adlx_int,@ENG_START_DOX The I2C clock speed (in KHz). @ENG_END_DOX}
|
|
119
|
+
* @paramrow{3.,[in],address,adlx_int,@ENG_START_DOX The 7-bit I2C slave device address which is shifted one bit to the left. @ENG_END_DOX}
|
|
120
|
+
* @paramrow{4.,[in],offset,adlx_int,@ENG_START_DOX The offset of the data from the address. @ENG_END_DOX}
|
|
121
|
+
* @paramrow{5.,[in],dataSize,adlx_int,@ENG_START_DOX The size (in bytes) of the buffer for the OEM device data. @ENG_END_DOX}
|
|
122
|
+
* @paramrow{6.,[in],data,adlx_byte*,@ENG_START_DOX The address to the buffer with the new OEM data. @ENG_END_DOX}
|
|
123
|
+
*
|
|
124
|
+
*@retvalues
|
|
125
|
+
*@ENG_START_DOX If the OEM device data is successfully returned, __ADLX_OK__ is returned. <br>
|
|
126
|
+
* If the OEM device data is not successfully returned, an error code is returned. <br>
|
|
127
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
128
|
+
*
|
|
129
|
+
*@detaileddesc
|
|
130
|
+
*@ENG_START_DOX @details The application is responsible to allocate a buffer sufficiently large to hold the requested OEM device data. @ENG_END_DOX
|
|
131
|
+
*
|
|
132
|
+
*
|
|
133
|
+
*@copydoc IADLXI2C_REQ_TABLE
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
virtual ADLX_RESULT ADLX_STD_CALL RepeatedStartRead (ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data) = 0;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
*@page DOX_IADLXI2C_Write Write
|
|
140
|
+
*@ENG_START_DOX @brief Writes the OEM device data through the I2C bus of a GPU. @ENG_END_DOX
|
|
141
|
+
*
|
|
142
|
+
*@syntax
|
|
143
|
+
*@codeStart
|
|
144
|
+
* @ref ADLX_RESULT Write (@ref ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data)
|
|
145
|
+
*@codeEnd
|
|
146
|
+
*
|
|
147
|
+
*@params
|
|
148
|
+
* @paramrow{1.,[in],line,@ref ADLX_I2C_LINE,@ENG_START_DOX The I2C line. @ENG_END_DOX}
|
|
149
|
+
* @paramrow{2.,[in],speed,adlx_int,@ENG_START_DOX The I2C clock speed (in KHz). @ENG_END_DOX}
|
|
150
|
+
* @paramrow{3.,[in],address,adlx_int,@ENG_START_DOX The 7-bit I2C slave device address which is shifted one bit to the left. @ENG_END_DOX}
|
|
151
|
+
* @paramrow{4.,[in],offset,adlx_int,@ENG_START_DOX The offset of the data from the address. @ENG_END_DOX}
|
|
152
|
+
* @paramrow{5.,[in],dataSize,adlx_int,@ENG_START_DOX The size (in bytes) of the buffer for the OEM device data. @ENG_END_DOX}
|
|
153
|
+
* @paramrow{6.,[in],data,adlx_byte*,@ENG_START_DOX . The address to the buffer with the new OEM data. @ENG_END_DOX}
|
|
154
|
+
*
|
|
155
|
+
*@retvalues
|
|
156
|
+
*@ENG_START_DOX If the OEM device data is successfully written, __ADLX_OK__ is returned. <br>
|
|
157
|
+
* If the OEM device data is not successfully written, an error code is returned. <br>
|
|
158
|
+
* Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
|
|
159
|
+
*
|
|
160
|
+
*@detaileddesc
|
|
161
|
+
*@ENG_START_DOX @details The application is responsible to allocate a buffer sufficiently large to hold the requested OEM device data. @ENG_END_DOX
|
|
162
|
+
*
|
|
163
|
+
*
|
|
164
|
+
*@copydoc IADLXI2C_REQ_TABLE
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
virtual ADLX_RESULT ADLX_STD_CALL Write (ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data) = 0;
|
|
168
|
+
|
|
169
|
+
}; //IADLXI2C
|
|
170
|
+
//----------------------------------------------------------------------------------------------
|
|
171
|
+
typedef IADLXInterfacePtr_T<IADLXI2C> IADLXI2CPtr;
|
|
172
|
+
} //namespace adlx
|
|
173
|
+
#else //__cplusplus
|
|
174
|
+
ADLX_DECLARE_IID (IADLXI2C, L"IADLXI2C")
|
|
175
|
+
|
|
176
|
+
typedef struct IADLXI2C IADLXI2C;
|
|
177
|
+
|
|
178
|
+
typedef struct IADLXI2CVtbl
|
|
179
|
+
{
|
|
180
|
+
//IADLXInterface
|
|
181
|
+
adlx_long (ADLX_STD_CALL *Acquire)(IADLXI2C* pThis);
|
|
182
|
+
adlx_long (ADLX_STD_CALL *Release)(IADLXI2C* pThis);
|
|
183
|
+
ADLX_RESULT (ADLX_STD_CALL *QueryInterface)(IADLXI2C* pThis, const wchar_t* interfaceId, void** ppInterface);
|
|
184
|
+
|
|
185
|
+
//IADLXI2C
|
|
186
|
+
ADLX_RESULT(ADLX_STD_CALL *Version)(IADLXI2C* pThis, adlx_int* major, adlx_int* minor);
|
|
187
|
+
ADLX_RESULT(ADLX_STD_CALL *IsSupported)(IADLXI2C* pThis, ADLX_I2C_LINE line, adlx_int address, adlx_bool* isSupported);
|
|
188
|
+
ADLX_RESULT(ADLX_STD_CALL *Read)(IADLXI2C* pThis, ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data);
|
|
189
|
+
ADLX_RESULT(ADLX_STD_CALL *RepeatedStartRead)(IADLXI2C* pThis, ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data);
|
|
190
|
+
ADLX_RESULT(ADLX_STD_CALL *Write)(IADLXI2C* pThis, ADLX_I2C_LINE line, adlx_int speed, adlx_int address, adlx_int offset, adlx_int dataSize, adlx_byte* data);
|
|
191
|
+
|
|
192
|
+
}IADLXI2CVtbl;
|
|
193
|
+
|
|
194
|
+
struct IADLXI2C { const IADLXI2CVtbl *pVtbl; };
|
|
195
|
+
#endif //__cplusplus
|
|
196
|
+
#pragma endregion IADLXI2C
|
|
197
|
+
|
|
198
|
+
#endif //ADLX_II2C_H
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
//-------------------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
//-------------------------------------------------------------------------------------------------
|
|
7
|
+
//ILog.h - Interfaces for ADLX log functionality
|
|
8
|
+
#ifndef ADLX_LOG_H
|
|
9
|
+
#define ADLX_LOG_H
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include "ADLXDefines.h"
|
|
13
|
+
|
|
14
|
+
#pragma region IADLXLog interface
|
|
15
|
+
#if defined (__cplusplus)
|
|
16
|
+
|
|
17
|
+
namespace adlx
|
|
18
|
+
{
|
|
19
|
+
class ADLX_NO_VTABLE IADLXLog
|
|
20
|
+
{
|
|
21
|
+
public:
|
|
22
|
+
/**
|
|
23
|
+
* @page DOX_IADLXLog_WriteLog WriteLog
|
|
24
|
+
* @ENG_START_DOX
|
|
25
|
+
* @brief The __WriteLog__ method is called by ADLX when a new ADLX log message is available.
|
|
26
|
+
* @ENG_END_DOX
|
|
27
|
+
* @syntax
|
|
28
|
+
* @codeStart
|
|
29
|
+
* @ref ADLX_RESULT WriteLog (const wchar_t* msg)
|
|
30
|
+
* @codeEnd
|
|
31
|
+
*
|
|
32
|
+
* @params
|
|
33
|
+
* @paramrow{1.,[out], msg, const wchar_t*, @ENG_START_DOX The new log message from the internal code execution of ADLX. @ENG_END_DOX}
|
|
34
|
+
*
|
|
35
|
+
* @retvalues
|
|
36
|
+
* @ENG_START_DOX
|
|
37
|
+
* The method must return __ADLX_OK__.<br>
|
|
38
|
+
* @ENG_END_DOX
|
|
39
|
+
*
|
|
40
|
+
* @detaileddesc
|
|
41
|
+
* @ENG_START_DOX
|
|
42
|
+
* @details Once the application enables the ADLX logs with @ref DOX_IADLXSystem_EnableLog using __APPLICATION__ for the @ref ADLX_LOG_DESTINATION parameter, ADLX will call this method when a new log trace is generated. <br>
|
|
43
|
+
* The method should return quickly to not block the execution path in ADLX. If the method requires a long processing of the log trace, the application must copy the log message and process it asynchronously.
|
|
44
|
+
* @ENG_END_DOX
|
|
45
|
+
*
|
|
46
|
+
* @copydoc IADLXLog_REQ_TABLE
|
|
47
|
+
*
|
|
48
|
+
* @seealso
|
|
49
|
+
* @ref DOX_IADLXSystem_EnableLog
|
|
50
|
+
*/
|
|
51
|
+
virtual ADLX_RESULT ADLX_STD_CALL WriteLog (const wchar_t* msg) = 0;
|
|
52
|
+
}; //IADLXLog
|
|
53
|
+
}
|
|
54
|
+
#else
|
|
55
|
+
ADLX_DECLARE_IID (IADLXLog, L"IADLXLog");
|
|
56
|
+
typedef struct IADLXLog IADLXLog;
|
|
57
|
+
|
|
58
|
+
typedef struct IADLXLogVtbl
|
|
59
|
+
{
|
|
60
|
+
//IADLXLog
|
|
61
|
+
ADLX_RESULT (ADLX_STD_CALL *WriteLog)(IADLXLog* pThis, const wchar_t* msg);
|
|
62
|
+
} IADLXLogVtbl;
|
|
63
|
+
|
|
64
|
+
struct IADLXLog
|
|
65
|
+
{
|
|
66
|
+
const IADLXLogVtbl *pVtbl;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
#endif
|
|
70
|
+
#pragma region IADLXLog interface
|
|
71
|
+
|
|
72
|
+
#endif //ADLX_LOG_H
|