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.
Files changed (71) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +336 -0
  3. package/binding.gyp +69 -0
  4. package/build/Release/gpu.exp +0 -0
  5. package/build/Release/gpu.lib +0 -0
  6. package/build/Release/gpu.node +0 -0
  7. package/build/Release/gpu.pdb +0 -0
  8. package/build/binding.sln +19 -0
  9. package/build/gpu.vcxproj +175 -0
  10. package/build/gpu.vcxproj.filters +169 -0
  11. package/example.js +69 -0
  12. package/index.js +33 -0
  13. package/package.json +68 -0
  14. package/src/binding.cpp +201 -0
  15. package/src/gpu_info.c +130 -0
  16. package/src/gpu_info.h +86 -0
  17. package/src/includes/adlx/ADLX.h +367 -0
  18. package/src/includes/adlx/ADLXDefines.h +1345 -0
  19. package/src/includes/adlx/ADLXHelper/ADLXHelper.c +175 -0
  20. package/src/includes/adlx/ADLXHelper/ADLXHelper.h +245 -0
  21. package/src/includes/adlx/ADLXHelper/WinAPIS.c +64 -0
  22. package/src/includes/adlx/ADLXStructures.h +206 -0
  23. package/src/includes/adlx/ADLXVersion.h +18 -0
  24. package/src/includes/adlx/I3DSettings.h +3476 -0
  25. package/src/includes/adlx/I3DSettings1.h +292 -0
  26. package/src/includes/adlx/I3DSettings2.h +317 -0
  27. package/src/includes/adlx/IApplications.h +397 -0
  28. package/src/includes/adlx/IChangedEvent.h +71 -0
  29. package/src/includes/adlx/ICollections.h +325 -0
  30. package/src/includes/adlx/IDesktops.h +918 -0
  31. package/src/includes/adlx/IDisplay3DLUT.h +663 -0
  32. package/src/includes/adlx/IDisplayGamma.h +683 -0
  33. package/src/includes/adlx/IDisplayGamut.h +760 -0
  34. package/src/includes/adlx/IDisplaySettings.h +3476 -0
  35. package/src/includes/adlx/IDisplays.h +2676 -0
  36. package/src/includes/adlx/IDisplays1.h +191 -0
  37. package/src/includes/adlx/IDisplays2.h +188 -0
  38. package/src/includes/adlx/IDisplays3.h +256 -0
  39. package/src/includes/adlx/IGPUAutoTuning.h +460 -0
  40. package/src/includes/adlx/IGPUManualFanTuning.h +1007 -0
  41. package/src/includes/adlx/IGPUManualGFXTuning.h +607 -0
  42. package/src/includes/adlx/IGPUManualPowerTuning.h +340 -0
  43. package/src/includes/adlx/IGPUManualVRAMTuning.h +576 -0
  44. package/src/includes/adlx/IGPUPresetTuning.h +469 -0
  45. package/src/includes/adlx/IGPUTuning.h +1239 -0
  46. package/src/includes/adlx/IGPUTuning1.h +197 -0
  47. package/src/includes/adlx/II2C.h +198 -0
  48. package/src/includes/adlx/ILog.h +72 -0
  49. package/src/includes/adlx/IMultiMedia.h +578 -0
  50. package/src/includes/adlx/IPerformanceMonitoring.h +2520 -0
  51. package/src/includes/adlx/IPerformanceMonitoring1.h +134 -0
  52. package/src/includes/adlx/IPerformanceMonitoring2.h +341 -0
  53. package/src/includes/adlx/IPerformanceMonitoring3.h +199 -0
  54. package/src/includes/adlx/IPowerTuning.h +473 -0
  55. package/src/includes/adlx/IPowerTuning1.h +515 -0
  56. package/src/includes/adlx/ISmartAccessMemory.h +114 -0
  57. package/src/includes/adlx/ISystem.h +1557 -0
  58. package/src/includes/adlx/ISystem1.h +237 -0
  59. package/src/includes/adlx/ISystem2.h +643 -0
  60. package/src/linux/amd_linux.c +269 -0
  61. package/src/linux/intel_linux.c +20 -0
  62. package/src/linux/nvidia_linux.c +257 -0
  63. package/src/macos/amd_mac.c +131 -0
  64. package/src/macos/intel_mac.c +131 -0
  65. package/src/macos/nvidia_mac.c +21 -0
  66. package/src/vendor/amd.c +37 -0
  67. package/src/vendor/intel.c +37 -0
  68. package/src/vendor/nvidia.c +37 -0
  69. package/src/windows/amd_windows.c +468 -0
  70. package/src/windows/intel_windows.c +157 -0
  71. package/src/windows/nvidia_windows.c +252 -0
@@ -0,0 +1,515 @@
1
+ //
2
+ // Copyright (c) 2023 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_POWERTUNING1_H
7
+ #define ADLX_POWERTUNING1_H
8
+ #pragma once
9
+
10
+ #include "IPowerTuning.h"
11
+ #include "ICollections.h"
12
+
13
+ #pragma region IADLXSmartShiftEco
14
+ #if defined (__cplusplus)
15
+ namespace adlx
16
+ {
17
+ class ADLX_NO_VTABLE IADLXSmartShiftEco : public IADLXInterface
18
+ {
19
+ public:
20
+ ADLX_DECLARE_IID(L"IADLXSmartShiftEco")
21
+
22
+ /**
23
+ *@page DOX_IADLXSmartShiftEco_IsSupported IsSupported
24
+ *@ENG_START_DOX @brief Checks if AMD SmartShift Eco is supported. @ENG_END_DOX
25
+ *
26
+ *@syntax
27
+ *@codeStart
28
+ * @ref ADLX_RESULT IsSupported (adlx_bool* supported)
29
+ *@codeEnd
30
+ *
31
+ *@params
32
+ * @paramrow{1.,[out],supported,adlx_bool*,@ENG_START_DOX The pointer to a variable where the support status of AMD SmartShift Eco is returned. The variable is __true__ if AMD SmartShift Eco is supported. The variable is __false__ if AMD SmartShift Eco is not supported. @ENG_END_DOX}
33
+ *
34
+ *@retvalues
35
+ *@ENG_START_DOX If the support status of AMD SmartShift Eco is successfully returned, __ADLX_OK__ is returned.<br>
36
+ * If the support status of AMD SmartShift Eco is not successfully returned, an error code is returned.<br>
37
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
38
+ *
39
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
40
+ *
41
+ */
42
+ virtual ADLX_RESULT ADLX_STD_CALL IsSupported (adlx_bool* supported) = 0;
43
+
44
+ /**
45
+ *@page DOX_IADLXSmartShiftEco_IsEnabled IsEnabled
46
+ *@ENG_START_DOX @brief Checks if AMD SmartShift Eco is enabled. @ENG_END_DOX
47
+ *
48
+ *@syntax
49
+ *@codeStart
50
+ * @ref ADLX_RESULT IsEnabled (adlx_bool* enabled)
51
+ *@codeEnd
52
+ *
53
+ *@params
54
+ * @paramrow{1.,[out],enabled,adlx_bool*,@ENG_START_DOX The pointer to a variable where the enabled state of AMD Smartshift Eco is returned. The variable is __true__ if AMD Smartshift Eco is enabled. The variable is __false__ if AMD Smartshift Eco is not enabled. @ENG_END_DOX}
55
+ *
56
+ *@retvalues
57
+ *@ENG_START_DOX If the enabled state of AMD Smartshift Eco is successfully returned, __ADLX_OK__ is returned.<br>
58
+ * If the enabled state of AMD Smartshift Eco is not successfully returned, an error code is returned.<br>
59
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
60
+ *
61
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
62
+ *
63
+ */
64
+ virtual ADLX_RESULT ADLX_STD_CALL IsEnabled (adlx_bool* enabled) = 0;
65
+
66
+ /**
67
+ *@page DOX_IADLXSmartShiftEco_SetEnabled SetEnabled
68
+ *@ENG_START_DOX @brief Sets AMD Smartshift Eco to enabled or disabled. @ENG_END_DOX
69
+ *
70
+ *@syntax
71
+ *@codeStart
72
+ * @ref ADLX_RESULT SetEnabled (adlx_bool enable)
73
+ *@codeEnd
74
+ *
75
+ *@params
76
+ * @paramrow{1.,[in],enable,adlx_bool,@ENG_START_DOX The new AMD Smartshift Eco state. Set __true__ to enable AMD Smartshift Eco. Set __false__ to disable AMD Smartshift Eco. @ENG_END_DOX}
77
+ *
78
+ *@retvalues
79
+ *@ENG_START_DOX If the state of AMD Smartshift Eco is successfully set, __ADLX_OK__ is returned.<br>
80
+ * If the state of AMD Smartshift Eco is not successfully set, an error code is returned.<br>
81
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
82
+ *
83
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
84
+ *
85
+ */
86
+ virtual ADLX_RESULT ADLX_STD_CALL SetEnabled (adlx_bool enabled) = 0;
87
+
88
+ /**
89
+ *@page DOX_IADLXSmartShiftEco_IsInactive IsInactive
90
+ *@ENG_START_DOX @brief Checks if AMD SmartShift Eco is inactive. @ENG_END_DOX
91
+ *
92
+ *@syntax
93
+ *@codeStart
94
+ * @ref ADLX_RESULT IsInactive (adlx_bool* inactive)
95
+ *@codeEnd
96
+ *
97
+ *@params
98
+ * @paramrow{1.,[out],inactive,adlx_bool*,@ENG_START_DOX The pointer to a variable where the inactive state of AMD Smartshift Eco is returned. The variable is __true__ if AMD Smartshift Eco is inactive. The variable is __false__ if AMD Smartshift Eco is active. @ENG_END_DOX}
99
+ *
100
+ *@retvalues
101
+ *@ENG_START_DOX If the inactive state of AMD Smartshift Eco is successfully returned, __ADLX_OK__ is returned.<br>
102
+ * If the inactive state of AMD Smartshift Eco is not successfully returned, an error code is returned.<br>
103
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
104
+ *
105
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
106
+ *
107
+ */
108
+ virtual ADLX_RESULT ADLX_STD_CALL IsInactive (adlx_bool* inactive) = 0;
109
+
110
+ /**
111
+ *@page DOX_IADLXSmartShiftEco_GetInactiveReason GetInactiveReason
112
+ *@ENG_START_DOX @brief Gets the reason why AMD SmartShift Eco is inactive. @ENG_END_DOX
113
+ *
114
+ *@syntax
115
+ *@codeStart
116
+ * @ref ADLX_RESULT GetInactiveReason (@ref ADLX_SMARTSHIFT_ECO_INACTIVE_REASON* reason)
117
+ *@codeEnd
118
+ *
119
+ *@params
120
+ * @paramrow{1.,[out],reason,@ref ADLX_SMARTSHIFT_ECO_INACTIVE_REASON*,@ENG_START_DOX The pointer to a variable where the AMD SmartShift Eco inactive reason is returned. @ENG_END_DOX}
121
+ *
122
+ *@retvalues
123
+ *@ENG_START_DOX If the inactive reason of AMD Smartshift Eco is successfully returned, __ADLX_OK__ is returned.<br>
124
+ * If the inactive reason of AMD Smartshift Eco is not successfully returned, an error code is returned.<br>
125
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
126
+ *
127
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
128
+ *
129
+ */
130
+ virtual ADLX_RESULT ADLX_STD_CALL GetInactiveReason(ADLX_SMARTSHIFT_ECO_INACTIVE_REASON* reason) = 0;
131
+ }; //IADLXSmartShiftEco
132
+ //----------------------------------------------------------------------------------------------
133
+ typedef IADLXInterfacePtr_T<IADLXSmartShiftEco> IADLXSmartShiftEcoPtr;
134
+ } //namespace adlx
135
+ #else //__cplusplus
136
+ ADLX_DECLARE_IID(IADLXSmartShiftEco, L"IADLXSmartShiftEco")
137
+ typedef struct IADLXSmartShiftEco IADLXSmartShiftEco;
138
+ typedef struct IADLXSmartShiftEcoVtbl
139
+ {
140
+ //IADLXInterface
141
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXSmartShiftEco* pThis);
142
+ adlx_long(ADLX_STD_CALL* Release)(IADLXSmartShiftEco* pThis);
143
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXSmartShiftEco* pThis, const wchar_t* interfaceId, void** ppInterface);
144
+
145
+ //IADLXSmartShiftEco
146
+ ADLX_RESULT(ADLX_STD_CALL* IsSupported)(IADLXSmartShiftEco* pThis, adlx_bool* supported);
147
+ ADLX_RESULT(ADLX_STD_CALL* IsEnabled)(IADLXSmartShiftEco* pThis, adlx_bool* enabled);
148
+ ADLX_RESULT(ADLX_STD_CALL* SetEnabled)(IADLXSmartShiftEco* pThis, adlx_bool enabled);
149
+ ADLX_RESULT(ADLX_STD_CALL* IsInactive)(IADLXSmartShiftEco* pThis, adlx_bool* inactive);
150
+ ADLX_RESULT(ADLX_STD_CALL* GetInactiveReason)(IADLXSmartShiftEco* pThis, ADLX_SMARTSHIFT_ECO_INACTIVE_REASON* reason);
151
+ } IADLXSmartShiftEcoVtbl;
152
+ struct IADLXSmartShiftEco { const IADLXSmartShiftEcoVtbl* pVtbl; };
153
+ #endif //__cplusplus
154
+ #pragma endregion IADLXSmartShiftEco
155
+
156
+ #pragma region IADLXGPUConnectChangedEvent
157
+ #if defined (__cplusplus)
158
+ namespace adlx
159
+ {
160
+ class ADLX_NO_VTABLE IADLXGPU2;
161
+ class ADLX_NO_VTABLE IADLXGPUConnectChangedEvent : public IADLXChangedEvent
162
+ {
163
+ public:
164
+ ADLX_DECLARE_IID(L"IADLXGPUConnectChangedEvent")
165
+
166
+ /**
167
+ *@page DOX_IADLXGPUConnectChangedEvent_GetGPU GetGPU
168
+ *@ENG_START_DOX @brief Gets the reference counted GPU interface on which the GPU Connect is changed. @ENG_END_DOX
169
+ *
170
+ *@syntax
171
+ *@codeStart
172
+ * @ref ADLX_RESULT GetGPU (@ref DOX_IADLXGPU2** ppGPU)
173
+ *@codeEnd
174
+ *
175
+ *@params
176
+ *@paramrow{1.,[out] ,ppGPU,@ref DOX_IADLXGPU** ,@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 __*ppGPU__ to __nullptr__. @ENG_END_DOX}
177
+ *
178
+ *
179
+ *@retvalues
180
+ *@ENG_START_DOX If the interface is successfully returned, __ADLX_OK__ is returned.<br>
181
+ * If the interface is not successfully returned, an error code is returned.<br>
182
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
183
+ *
184
+ *@detaileddesc
185
+ *@ENG_START_DOX @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when it is no longer needed. @ENG_END_DOX
186
+ *
187
+ *@addinfo
188
+ *@ENG_START_DOX 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. <br>
189
+ * __Note:__ @ref DOX_IADLXGPUConnectChangedEvent_GetGPU returns the reference counted GPU interface used by all the methods in this interface to check if there are any changes in GPU Connect.
190
+ *@ENG_END_DOX
191
+ *
192
+ *@copydoc IADLXGPUConnectChangedEvent_REQ_TABLE
193
+ *
194
+ */
195
+ virtual ADLX_RESULT ADLX_STD_CALL GetGPU(IADLXGPU2** ppGPU) = 0;
196
+
197
+ /**
198
+ *@page DOX_IADLXGPUConnectChangedEvent_IsGPUAppsListChanged IsGPUAppsListChanged
199
+ *@ENG_START_DOX @brief Checks if the list of applications created in the context of a GPU is changed. @ENG_END_DOX
200
+ *
201
+ *@syntax
202
+ *@codeStart
203
+ * adlx_bool IsGPUAppsListChanged ()
204
+ *@codeEnd
205
+ *
206
+ *@params
207
+ *N/A
208
+ *
209
+ *@retvalues
210
+ *@ENG_START_DOX If the GPU applications list is changed, __true__ is returned.<br>
211
+ * If the GPU applications list is not changed, __false__ is returned.<br> @ENG_END_DOX
212
+ *
213
+ *@addinfo
214
+ *@ENG_START_DOX
215
+ * __Note:__ To obtain the GPU, use @ref DOX_IADLXGPUConnectChangedEvent_GetGPU.
216
+ *@ENG_END_DOX
217
+ *
218
+ *@copydoc IADLXGPUConnectChangedEvent_REQ_TABLE
219
+ *
220
+ */
221
+ virtual adlx_bool ADLX_STD_CALL IsGPUAppsListChanged() = 0;
222
+
223
+ /**
224
+ *@page DOX_IADLXGPUConnectChangedEvent_IsGPUPowerChanged IsGPUPowerChanged
225
+ *@ENG_START_DOX @brief Checks if the power state of a GPU changed. @ENG_END_DOX
226
+ *
227
+ *@syntax
228
+ *@codeStart
229
+ * adlx_bool IsGPUPowerChanged ()
230
+ *@codeEnd
231
+ *
232
+ *@params
233
+ *N/A
234
+ *
235
+ *@retvalues
236
+ *@ENG_START_DOX If the GPU power state are changed, __true__ is returned.<br>
237
+ * If the GPU power state are not changed, __false__ is returned.<br> @ENG_END_DOX
238
+ *
239
+ *@addinfo
240
+ *@ENG_START_DOX
241
+ * __Note:__ To obtain the GPU, use @ref DOX_IADLXGPUConnectChangedEvent_GetGPU.
242
+ *@ENG_END_DOX
243
+ *
244
+ *@copydoc IADLXGPUConnectChangedEvent_REQ_TABLE
245
+ *
246
+ */
247
+ virtual adlx_bool ADLX_STD_CALL IsGPUPowerChanged() = 0;
248
+
249
+ /**
250
+ *@page DOX_IADLXGPUConnectChangedEvent_IsGPUPowerChangeError IsGPUPowerChangeError
251
+ *@ENG_START_DOX @brief Checks if an error occurred during powering off a GPU. @ENG_END_DOX
252
+ *
253
+ *@syntax
254
+ *@codeStart
255
+ * adlx_bool IsGPUPowerChangeError ()
256
+ *@codeEnd
257
+ *
258
+ *@params
259
+ *N/A
260
+ *
261
+ *@retvalues
262
+ *@ENG_START_DOX If an error occurred during powering off a GPU, __true__ is returned.<br>
263
+ * If no error occurred during powering off a GPU, __false__ is returned.<br> @ENG_END_DOX
264
+ *
265
+ *@addinfo
266
+ *@ENG_START_DOX
267
+ * __Note:__ To obtain the GPU, use @ref DOX_IADLXGPUConnectChangedEvent_GetGPU.
268
+ *@ENG_END_DOX
269
+ *
270
+ *@copydoc IADLXGPUConnectChangedEvent_REQ_TABLE
271
+ *
272
+ */
273
+ virtual adlx_bool ADLX_STD_CALL IsGPUPowerChangeError(ADLX_RESULT* pPowerChangeError) = 0;
274
+ }; // IADLXGPUConnectChangedEvent
275
+ typedef IADLXInterfacePtr_T<IADLXGPUConnectChangedEvent> IADLXGPUConnectChangedEventPtr;
276
+ } // namespace adlx
277
+ #else // __cplusplus
278
+ ADLX_DECLARE_IID(ADLXGPUConnectChangedEvent, L"ADLXGPUConnectChangedEvent")
279
+ typedef struct IADLXGPU2 IADLXGPU2;
280
+ typedef struct IADLXGPUConnectChangedEvent IADLXGPUConnectChangedEvent;
281
+ typedef struct IADLXGPUConnectChangedEventVtbl
282
+ {
283
+ // IADLXInterface
284
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXGPUConnectChangedEvent* pThis);
285
+ adlx_long(ADLX_STD_CALL* Release)(IADLXGPUConnectChangedEvent* pThis);
286
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXGPUConnectChangedEvent* pThis, const wchar_t* interfaceId, void** ppInterface);
287
+
288
+ // IADLXChangedEvent
289
+ ADLX_SYNC_ORIGIN(ADLX_STD_CALL* GetOrigin)(IADLXChangedEvent* pThis);
290
+
291
+ // IADLXGPUConnectChangedEvent
292
+ ADLX_RESULT(ADLX_STD_CALL* GetGPU)(IADLXGPUConnectChangedEvent* pThis, IADLXGPU2** ppGPU);
293
+ adlx_bool(ADLX_STD_CALL* IsGPUAppsListChanged)(IADLXGPUConnectChangedEvent* pThis);
294
+ adlx_bool(ADLX_STD_CALL* IsGPUPowerChanged)(IADLXGPUConnectChangedEvent* pThis);
295
+ adlx_bool(ADLX_STD_CALL* IsGPUPowerChangeError)(IADLXGPUConnectChangedEvent* pThis, ADLX_RESULT* pPowerChangeError);
296
+ } IADLXGPUConnectChangedEventVtbl;
297
+ struct IADLXGPUConnectChangedEvent { const IADLXGPUConnectChangedEventVtbl* pVtbl; };
298
+ #endif
299
+ #pragma endregion IADLXGPUConnectChangedEvent
300
+
301
+ #pragma region IADLXGPUConnectChangedListener
302
+ #if defined (__cplusplus)
303
+ namespace adlx
304
+ {
305
+ class ADLX_NO_VTABLE IADLXGPUConnectChangedListener
306
+ {
307
+ public:
308
+ /**
309
+ *@page DOX_IADLXGPUConnectChangedListener_OnGPUConnectChanged OnGPUConnectChanged
310
+ *@ENG_START_DOX @brief __OnGPUConnectChanged__ is called by ADLX when GPU connect settings change. @ENG_END_DOX
311
+ *
312
+ *@syntax
313
+ *@codeStart
314
+ * adlx_bool OnGPUConnectChanged (@ref DOX_IADLXGPUConnectChangedEvent* pGPUConnectChangedEvent)
315
+ *@codeEnd
316
+ *
317
+ *@params
318
+ *@paramrow{1.,[in] ,pGPUConnectChangedEvent,@ref DOX_IADLXGPUConnectChangedEvent* ,@ENG_START_DOX The pointer to a GPU connect settings change event. @ENG_END_DOX}
319
+ *
320
+ *@retvalues
321
+ *@ENG_START_DOX If the application requires ADLX to continue notifying the next listener, __true__ must be returned.<br>
322
+ * If the application requires ADLX to stop notifying the next listener, __false__ must be returned.<br> @ENG_END_DOX
323
+ *
324
+ *@detaileddesc
325
+ *@ENG_START_DOX Once the application registers to the notification with @ref DOX_IADLXGPU2_StartPowerOff, ADLX will call this method when AMD GPUConnect state changes.
326
+ * This method should return quickly to not block the execution of ADLX. If the method requires a long processing of the event notification, the application must hold onto
327
+ * a reference to the AMD GPUConnect change event with @ref DOX_IADLXInterface_Acquire and make it available on an asynchronous thread and return immediately.
328
+ * When the asynchronous thread is done processing, it must discard the AMD GPUConnect change event with @ref DOX_IADLXInterface_Release. @ENG_END_DOX
329
+ *
330
+ *@copydoc IADLXGPUConnectChangedListener_REQ_TABLE
331
+ *
332
+ */
333
+ virtual adlx_bool ADLX_STD_CALL OnGPUConnectChanged(IADLXGPUConnectChangedEvent* pGPUConnectChangedEvent) = 0;
334
+ }; //IADLXGPUConnectChangedListener
335
+ } //namespace adlx
336
+ #else //__cplusplus
337
+ typedef struct IADLXGPUConnectChangedListener IADLXGPUConnectChangedListener;
338
+ typedef struct IADLXGPUConnectChangedListenerVtbl
339
+ {
340
+ adlx_bool(ADLX_STD_CALL* OnGPUConnectChanged)(IADLXGPUConnectChangedListener* pThis, IADLXGPUConnectChangedEvent* pGPUConnectChangedEvent);
341
+ } IADLXGPUConnectChangedListenerVtbl;
342
+ struct IADLXGPUConnectChangedListener { const IADLXGPUConnectChangedListenerVtbl* pVtbl; };
343
+ #endif //__cplusplus
344
+ #pragma endregion IADLXGPUConnectChangedListener
345
+
346
+ #pragma region IADLXPowerTuningChangedEvent1
347
+ #if defined (__cplusplus)
348
+ namespace adlx
349
+ {
350
+ class ADLX_NO_VTABLE IADLXPowerTuningChangedEvent1 : public IADLXPowerTuningChangedEvent
351
+ {
352
+ public:
353
+ ADLX_DECLARE_IID (L"IADLXPowerTuningChangedEvent1")
354
+
355
+ /**
356
+ *@page DOX_IADLXPowerTuningChangedEvent1_IsSmartShiftEcoChanged IsSmartShiftEcoChanged
357
+ *@ENG_START_DOX @brief Checks for changes to the AMD SmartShift Eco enable/disable and active/inactive state. @ENG_END_DOX
358
+ *
359
+ *@syntax
360
+ *@codeStart
361
+ * adlx_bool IsSmartShiftEcoChanged ()
362
+ *@codeEnd
363
+ *
364
+ *@params
365
+ *N/A
366
+ *
367
+ *@retvalues
368
+ *@ENG_START_DOX If there are any changes to the AMD SmartShift Eco state, __true__ is returned.<br>
369
+ * If there are on changes to the AMD SmartShift Eco state, __false__ is returned.<br> @ENG_END_DOX
370
+ *
371
+ *@copydoc IADLXPowerTuningChangedEvent1_REQ_TABLE
372
+ *
373
+ */
374
+ virtual adlx_bool ADLX_STD_CALL IsSmartShiftEcoChanged () = 0;
375
+ }; //IADLXPowerTuningChangedEvent1
376
+ //----------------------------------------------------------------------------------------------
377
+ typedef IADLXInterfacePtr_T<IADLXPowerTuningChangedEvent1> IADLXPowerTuningChangedEvent1Ptr;
378
+ } //namespace adlx
379
+ #else //__cplusplus
380
+ ADLX_DECLARE_IID (IADLXPowerTuningChangedEvent1, L"IADLXPowerTuningChangedEvent1")
381
+ typedef struct IADLXPowerTuningChangedEvent1 IADLXPowerTuningChangedEvent1;
382
+ typedef struct IADLXPowerTuningChangedEvent1Vtbl
383
+ {
384
+ //IADLXInterface
385
+ adlx_long (ADLX_STD_CALL *Acquire)(IADLXPowerTuningChangedEvent1* pThis);
386
+ adlx_long (ADLX_STD_CALL *Release)(IADLXPowerTuningChangedEvent1* pThis);
387
+ ADLX_RESULT (ADLX_STD_CALL *QueryInterface)(IADLXPowerTuningChangedEvent1* pThis, const wchar_t* interfaceId, void** ppInterface);
388
+
389
+ //IADLXChangedEvent
390
+ ADLX_SYNC_ORIGIN(ADLX_STD_CALL* GetOrigin)(IADLXPowerTuningChangedEvent1* pThis);
391
+
392
+ //IADLXPowerTuningChangedEvent
393
+ adlx_bool (ADLX_STD_CALL *IsSmartShiftMaxChanged)(IADLXPowerTuningChangedEvent1* pThis);
394
+
395
+ //IADLXPowerTuningChangedEvent1
396
+ adlx_bool (ADLX_STD_CALL *IsSmartShiftEcoChanged)(IADLXPowerTuningChangedEvent1* pThis);
397
+ }IADLXPowerTuningChangedEvent1Vtbl;
398
+ struct IADLXPowerTuningChangedEvent1 { const IADLXPowerTuningChangedEvent1Vtbl *pVtbl; };
399
+ #endif //__cplusplus
400
+ #pragma endregion IADLXPowerTuningChangedEvent1
401
+
402
+ #pragma region IADLXPowerTuningServices1
403
+ #if defined (__cplusplus)
404
+ namespace adlx
405
+ {
406
+ class ADLX_NO_VTABLE IADLXGPU2List;
407
+ class ADLX_NO_VTABLE IADLXPowerTuningServices1 : public IADLXPowerTuningServices
408
+ {
409
+ public:
410
+ ADLX_DECLARE_IID(L"IADLXPowerTuningServices1")
411
+
412
+ /**
413
+ *@page DOX_IADLXPowerTuningServices1_GetSmartShiftEco GetSmartShiftEco
414
+ *@ENG_START_DOX @brief Gets the reference counted AMD SmartShift Eco interface. @ENG_END_DOX
415
+ *@syntax
416
+ *@codeStart
417
+ * @ref ADLX_RESULT GetSmartShiftEco (@ref DOX_IADLXSmartShiftEco** ppSmartShiftEco)
418
+ *@codeEnd
419
+ *
420
+ *@params
421
+ *@paramrow{1.,[out] ,ppSmartShiftEco,@ref DOX_IADLXSmartShiftEco** ,@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 __*ppSmartShiftEco__ to __nullptr__. @ENG_END_DOX}
422
+ *
423
+ *@retvalues
424
+ *@ENG_START_DOX If the interface is successfully returned, __ADLX_OK__ is returned.<br>
425
+ * If the interface is not successfully returned, an error code is returned.<br>
426
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
427
+ *
428
+ *@detaileddesc
429
+ *@ENG_START_DOX @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when it is no longer needed. @ENG_END_DOX
430
+ *
431
+ *@addinfo
432
+ *@ENG_START_DOX 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
433
+ *
434
+ *@copydoc IADLXPowerTuningServices1_REQ_TABLE
435
+ *
436
+ */
437
+ virtual ADLX_RESULT ADLX_STD_CALL GetSmartShiftEco (IADLXSmartShiftEco** ppSmartShiftEco) = 0;
438
+
439
+ /**
440
+ *@page DOX_IADLXPowerTuningServices1_IsGPUConnectSupported IsGPUConnectSupported
441
+ *@ENG_START_DOX @brief Checks if AMD GPUConnect is supported on this system. @ENG_END_DOX
442
+ *
443
+ *@syntax
444
+ *@codeStart
445
+ * @ref ADLX_RESULT IsGPUConnectSupported (adlx_bool* supported)
446
+ *@codeEnd
447
+ *
448
+ *@params
449
+ * @paramrow{1.,[out],supported,adlx_bool*,@ENG_START_DOX The pointer to a variable where the support status of AMD SmartShift Eco is returned. The variable is __true__ if GPU connect is supported. The variable is __false__ if GPU connect is not supported. @ENG_END_DOX}
450
+ *
451
+ *@retvalues
452
+ *@ENG_START_DOX If the support status of GPU connect is successfully returned, __ADLX_OK__ is returned.<br>
453
+ * If the support status of GPU connect is not successfully returned, an error code is returned.<br>
454
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
455
+ *
456
+ *@copydoc IADLXSmartShiftEco_REQ_TABLE
457
+ *
458
+ */
459
+ virtual ADLX_RESULT ADLX_STD_CALL IsGPUConnectSupported (adlx_bool* supported) = 0;
460
+
461
+ /**
462
+ *@page DOX_IADLXPowerTuningServices1_GetGPUConnectGPUs GetGPUConnectGPUs
463
+ *@ENG_START_DOX @brief Gets the reference counted list of all the GPUs which support AMD GPUConnect. @ENG_END_DOX
464
+ *@syntax
465
+ *@codeStart
466
+ * @ref ADLX_RESULT GetGPUConnectGPUs (@ref DOX_IADLXGPU2List** ppGPUs)
467
+ *@codeEnd
468
+ *
469
+ *@params
470
+ *@paramrow{1.,[out] ,ppGPUs,@ref DOX_IADLXGPU2List** ,@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 __*ppGPUs__ to __nullptr__. @ENG_END_DOX}
471
+ *
472
+ *@retvalues
473
+ *@ENG_START_DOX If the interface is successfully returned, __ADLX_OK__ is returned.<br>
474
+ * If the interface is not successfully returned, an error code is returned.<br>
475
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
476
+ *
477
+ *@detaileddesc
478
+ *@ENG_START_DOX @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when it is no longer needed. @ENG_END_DOX
479
+ *
480
+ *@addinfo
481
+ *@ENG_START_DOX 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
482
+ *
483
+ *@copydoc IADLXPowerTuningServices1_REQ_TABLE
484
+ *
485
+ */
486
+ virtual ADLX_RESULT ADLX_STD_CALL GetGPUConnectGPUs (IADLXGPU2List** ppGPUs) = 0;
487
+ }; //IADLXPowerTuningServices1
488
+ //----------------------------------------------------------------------------------------------
489
+ typedef IADLXInterfacePtr_T<IADLXPowerTuningServices1> IADLXPowerTuningServices1Ptr;
490
+ } //namespace adlx
491
+ #else //__cplusplus
492
+ ADLX_DECLARE_IID(IADLXPowerTuningServices1, L"IADLXPowerTuningServices1")
493
+ typedef struct IADLXPowerTuningServices1 IADLXPowerTuningServices1;
494
+ typedef struct IADLXGPU2List IADLXGPU2List;
495
+ typedef struct IADLXPowerTuningServices1Vtbl
496
+ {
497
+ //IADLXInterface
498
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXPowerTuningServices1* pThis);
499
+ adlx_long(ADLX_STD_CALL* Release)(IADLXPowerTuningServices1* pThis);
500
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXPowerTuningServices1* pThis, const wchar_t* interfaceId, void** ppInterface);
501
+
502
+ //IADLXPowerTuningServices
503
+ ADLX_RESULT(ADLX_STD_CALL* GetPowerTuningChangedHandling)(IADLXPowerTuningServices1* pThis, IADLXPowerTuningChangedHandling** ppPowerTuningChangedHandling);
504
+ ADLX_RESULT(ADLX_STD_CALL* GetSmartShiftMax)(IADLXPowerTuningServices1* pThis, IADLXSmartShiftMax** ppSmartShiftMax);
505
+
506
+ //IADLXPowerTuningServices1
507
+ ADLX_RESULT(ADLX_STD_CALL* GetSmartShiftEco)(IADLXPowerTuningServices1* pThis, IADLXSmartShiftEco** ppSmartShiftEco);
508
+ ADLX_RESULT(ADLX_STD_CALL* IsGPUConnectSupported)(IADLXPowerTuningServices1* pThis, adlx_bool* supported);
509
+ ADLX_RESULT(ADLX_STD_CALL* GetGPUConnectGPUs)(IADLXPowerTuningServices1* pThis, IADLXGPU2List** ppGPUs);
510
+ }IADLXPowerTuningServices1Vtbl;
511
+ struct IADLXPowerTuningServices1 { const IADLXPowerTuningServices1Vtbl* pVtbl; };
512
+ #endif //__cplusplus
513
+ #pragma endregion IADLXPowerTuningServices1
514
+
515
+ #endif //ADLX_POWERTUNING1_H
@@ -0,0 +1,114 @@
1
+ //
2
+ // Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_ISMARTACCESSMEMORY_H
7
+ #define ADLX_ISMARTACCESSMEMORY_H
8
+ #pragma once
9
+
10
+ #include "ADLXStructures.h"
11
+
12
+ //-------------------------------------------------------------------------------------------------
13
+ //ISmartAccessMemory.h - Interfaces for ADLX AMD SmartAccess Memory functionality
14
+
15
+ // AMD SmartAccess Memory interface
16
+ #pragma region IADLXSmartAccessMemory
17
+ #if defined (__cplusplus)
18
+ namespace adlx
19
+ {
20
+ class ADLX_NO_VTABLE IADLXSmartAccessMemory : public IADLXInterface
21
+ {
22
+ public:
23
+ ADLX_DECLARE_IID(L"IADLXSmartAccessMemory")
24
+
25
+ /**
26
+ *@page DOX_IADLXSmartAccessMemory_IsSupported IsSupported
27
+ *@ENG_START_DOX @brief Checks if AMD SmartAccess Memory is supported on a GPU. @ENG_END_DOX
28
+ *
29
+ *@syntax
30
+ *@codeStart
31
+ * @ref ADLX_RESULT IsSupported (adlx_bool* supported)
32
+ *@codeEnd
33
+ *
34
+ *@params
35
+ * @paramrow{1.,[out],supported,adlx_bool*,@ENG_START_DOX The pointer to a variable where the state of AMD SmartAccess Memory is returned. The variable is __true__ if AMD SmartAccess Memory is supported. The variable is __false__ if AMD SmartAccess Memory is not supported. @ENG_END_DOX}
36
+ *
37
+ *@retvalues
38
+ *@ENG_START_DOX If the state of AMD SmartAccess Memory is successfully returned, __ADLX_OK__ is returned. <br>
39
+ * If the state of AMD SmartAccess Memory is not successfully returned, an error code is returned. <br>
40
+ * Refer to @ref ADLX_RESULT for success codes and error codes. @ENG_END_DOX
41
+ *
42
+ *@copydoc IADLXSmartAccessMemory_REQ_TABLE
43
+ *
44
+ */
45
+ virtual ADLX_RESULT ADLX_STD_CALL IsSupported(adlx_bool* supported) = 0;
46
+
47
+ /**
48
+ *@page DOX_IADLXSmartAccessMemory_IsEnabled IsEnabled
49
+ *@ENG_START_DOX @brief Checks if AMD SmartAccess Memory is enabled on a GPU. @ENG_END_DOX
50
+ *
51
+ *@syntax
52
+ *@codeStart
53
+ * @ref ADLX_RESULT IsEnabled (adlx_bool* enabled)
54
+ *@codeEnd
55
+ *
56
+ *@params
57
+ * @paramrow{1.,[out],enabled,adlx_bool*,@ENG_START_DOX The pointer to a variable where the 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 not enabled. @ENG_END_DOX}
58
+ *
59
+ *@retvalues
60
+ *@ENG_START_DOX If the state of AMD SmartAccess Memory is successfully returned, __ADLX_OK__ is returned.<br>
61
+ * If the state of AMD SmartAccess Memory is not successfully returned, an error code is returned.<br>
62
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
63
+ *
64
+ *@copydoc IADLXSmartAccessMemory_REQ_TABLE
65
+ *
66
+ */
67
+ virtual ADLX_RESULT ADLX_STD_CALL IsEnabled(adlx_bool* enabled) = 0;
68
+
69
+ /**
70
+ *@page DOX_IADLXSmartAccessMemory_SetEnabled SetEnabled
71
+ *@ENG_START_DOX @brief This method is deprecated. To enable or disable the state of the AMD SmartAccess Memory, enable or disable Re-Size BAR Support into the system BIOS. @ENG_END_DOX
72
+ *
73
+ *@syntax
74
+ *@codeStart
75
+ * @ref ADLX_RESULT SetEnabled (adlx_bool enable)
76
+ *@codeEnd
77
+ *
78
+ *@params
79
+ * @paramrow{1.,[in],enable,adlx_bool,@ENG_START_DOX The new AMD SmartAccess Memory state. Set __true__ to enable AMD SmartAccess Memory. Set __false__ to disable AMD SmartAccess Memory. @ENG_END_DOX}
80
+ *
81
+ *@retvalues
82
+ *@ENG_START_DOX ADLX_NOT_SUPPORTED @ENG_END_DOX
83
+ *
84
+ *@copydoc IADLXSmartAccessMemory_REQ_TABLE
85
+ *
86
+ */
87
+ virtual ADLX_RESULT ADLX_STD_CALL SetEnabled(adlx_bool enabled) = 0;
88
+ };
89
+ //----------------------------------------------------------------------------------------------
90
+ typedef IADLXInterfacePtr_T<IADLXSmartAccessMemory> IADLXSmartAccessMemoryPtr;
91
+ } //namespace adlx
92
+ #else //__cplusplus
93
+ ADLX_DECLARE_IID(IADLXSmartAccessMemory, L"IADLXSmartAccessMemory")
94
+
95
+ typedef struct IADLXSmartAccessMemory IADLXSmartAccessMemory;
96
+
97
+ typedef struct IADLXSmartAccessMemoryVtbl
98
+ {
99
+ //IADLXInterface
100
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXSmartAccessMemory* pThis);
101
+ adlx_long(ADLX_STD_CALL* Release)(IADLXSmartAccessMemory* pThis);
102
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXSmartAccessMemory* pThis, const wchar_t* interfaceId, void** ppInterface);
103
+
104
+ //IADLXSmartAccessMemory
105
+ ADLX_RESULT(ADLX_STD_CALL* IsSupported)(IADLXSmartAccessMemory* pThis, adlx_bool* supported);
106
+ ADLX_RESULT(ADLX_STD_CALL* IsEnabled)(IADLXSmartAccessMemory* pThis, adlx_bool* enabled);
107
+ ADLX_RESULT(ADLX_STD_CALL* SetEnabled)(IADLXSmartAccessMemory* pThis, adlx_bool enabled);
108
+ } IADLXSmartAccessMemoryVtbl;
109
+
110
+ struct IADLXSmartAccessMemory { const IADLXSmartAccessMemoryVtbl* pVtbl; };
111
+ #endif
112
+ #pragma endregion IADLXSmartAccessMemory
113
+
114
+ #endif // !ADLX_ISMARTACCESSMEMORY_H