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,397 @@
1
+ //
2
+ // Copyright (c) 2023 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_IAPPLICATIONS_H
7
+ #define ADLX_IAPPLICATIONS_H
8
+ #pragma once
9
+
10
+ #include "ADLXStructures.h"
11
+ #include "ICollections.h"
12
+
13
+ //-------------------------------------------------------------------------------------------------
14
+ //IDesktops.h - Interfaces for ADLX Applications functionality
15
+
16
+ #pragma region IADLXApplication
17
+ #if defined (__cplusplus)
18
+ namespace adlx
19
+ {
20
+ class ADLX_NO_VTABLE IADLXApplication : public IADLXInterface
21
+ {
22
+ public:
23
+ ADLX_DECLARE_IID(L"IADLXApplication")
24
+
25
+ /**
26
+ * @page DOX_IADLXApplication_ProcessID ProcessID
27
+ * @ENG_START_DOX
28
+ * @brief Gets the process ID for an application.
29
+ * @ENG_END_DOX
30
+ *
31
+ * @syntax
32
+ * @codeStart
33
+ * @ref ADLX_RESULT ProcessID (adlx_ulong* pid)
34
+ * @codeEnd
35
+ *
36
+ * @params
37
+ * @paramrow{1.,[out] ,pid,adlx_ulong* ,@ENG_START_DOX The pointer to a variable where the process ID for an application is returned. @ENG_END_DOX}
38
+ *
39
+ * @retvalues
40
+ * @ENG_START_DOX
41
+ * If the process ID is successfully returned, __ADLX_OK__ is returned.<br>
42
+ * If the process ID is not successfully returned, an error code is returned.<br>
43
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
44
+ * @ENG_END_DOX
45
+ *
46
+ * @copydoc IADLXApplication_REQ_TABLE
47
+ *
48
+ */
49
+ virtual ADLX_RESULT ADLX_STD_CALL ProcessID(adlx_ulong* pid) = 0;
50
+
51
+ /**
52
+ * @page DOX_IADLXApplication_Name Name
53
+ * @ENG_START_DOX
54
+ * @brief Gets the name for an application.
55
+ * @ENG_END_DOX
56
+ *
57
+ * @syntax
58
+ * @codeStart
59
+ * @ref ADLX_RESULT Name (const wchar_t** ppAppName)
60
+ * @codeEnd
61
+ *
62
+ * @params
63
+ * @paramrow{1.,[out] ,ppAppName,const wchar_t** ,@ENG_START_DOX The pointer to a zero-terminated string where the name of the application is returned the returned\, memory buffer is valid within a lifetime of the IADLXApplication interface. @ENG_END_DOX}
64
+ *
65
+ * @retvalues
66
+ * @ENG_START_DOX
67
+ * If the name is successfully returned, __ADLX_OK__ is returned.<br>
68
+ * If the name is not successfully returned, an error code is returned.<br>
69
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
70
+ * @ENG_END_DOX
71
+ *
72
+ * @copydoc IADLXApplication_REQ_TABLE
73
+ *
74
+ */
75
+ virtual ADLX_RESULT ADLX_STD_CALL Name(const wchar_t** ppAppName) = 0;
76
+
77
+ /**
78
+ * @page DOX_IADLXApplication_FullPath FullPath
79
+ * @ENG_START_DOX
80
+ * @brief Gets the full-qualified path for an application.
81
+ * @ENG_END_DOX
82
+ *
83
+ * @syntax
84
+ * @codeStart
85
+ * @ref ADLX_RESULT FullPath (const wchar_t** ppAppPath)
86
+ * @codeEnd
87
+ *
88
+ * @params
89
+ * @paramrow{1.,[out] ,ppAppName,const wchar_t** ,@ENG_START_DOX The pointer to a zero-terminated string where the full path of the application is returned the returned\, memory buffer is valid within a lifetime of the IADLXApplication interface. @ENG_END_DOX}
90
+ *
91
+ * @retvalues
92
+ * @ENG_START_DOX
93
+ * If the full path is successfully returned, __ADLX_OK__ is returned.<br>
94
+ * If the full path is not successfully returned, an error code is returned.<br>
95
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
96
+ * @ENG_END_DOX
97
+ *
98
+ * @copydoc IADLXApplication_REQ_TABLE
99
+ *
100
+ */
101
+ virtual ADLX_RESULT ADLX_STD_CALL FullPath(const wchar_t** ppAppPath) = 0;
102
+
103
+ /**
104
+ * @page DOX_IADLXApplication_GPUDependencyType GPUDependencyType
105
+ * @ENG_START_DOX
106
+ * @brief Gets the GPU dependency type for an application.
107
+ * @ENG_END_DOX
108
+ *
109
+ * @syntax
110
+ * @codeStart
111
+ * @ref ADLX_RESULT GPUDependencyType (@ref ADLX_APP_GPU_DEPENDENCY* gpuDependency)
112
+ * @codeEnd
113
+ *
114
+ * @params
115
+ * @paramrow{1.,[out] ,gpuDependency,ADLX_APP_GPU_DEPENDENCY* ,@ENG_START_DOX The pointer to a variable where the GPU dependency type for an application is returned. @ENG_END_DOX}
116
+ *
117
+ * @retvalues
118
+ * @ENG_START_DOX
119
+ * If the GPU dependency type is successfully returned, __ADLX_OK__ is returned.<br>
120
+ * If the GPU dependency type is not successfully returned, an error code is returned.<br>
121
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
122
+ * @ENG_END_DOX
123
+ *
124
+ * @copydoc IADLXApplication_REQ_TABLE
125
+ *
126
+ */
127
+ virtual ADLX_RESULT ADLX_STD_CALL GPUDependencyType(ADLX_APP_GPU_DEPENDENCY* gpuDependency) = 0;
128
+ }; // IADLXApplication
129
+ //------------------------------------------------------------------------------
130
+ typedef IADLXInterfacePtr_T<IADLXApplication> IADLXApplicationPtr;
131
+ } // namespace adlx
132
+ #else // __cplusplus
133
+ ADLX_DECLARE_IID(IADLXApplication, L"IADLXApplication")
134
+ typedef struct IADLXApplication IADLXApplication;
135
+ typedef struct IADLXApplicationVtbl
136
+ {
137
+ // IADLXInterface
138
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXApplication* pThis);
139
+ adlx_long(ADLX_STD_CALL* Release)(IADLXApplication* pThis);
140
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXApplication* pThis, const wchar_t* interfaceId, void** ppInterface);
141
+
142
+ // IADLXApplication
143
+ ADLX_RESULT(ADLX_STD_CALL* ProcessID)(IADLXApplication* pThis, adlx_ulong* pid);
144
+ ADLX_RESULT(ADLX_STD_CALL* Name)(IADLXApplication* pThis, const wchar_t** ppAppName);
145
+ ADLX_RESULT(ADLX_STD_CALL* FullPath)(IADLXApplication* pThis, const wchar_t** ppAppPath);
146
+ ADLX_RESULT(ADLX_STD_CALL* GPUDependencyType)(IADLXApplication* pThis, ADLX_APP_GPU_DEPENDENCY* gpuDependency);
147
+ } IADLXApplicationVtbl;
148
+ struct IADLXApplication { const IADLXApplicationVtbl* pVtbl; };
149
+ #endif
150
+ #pragma endregion IADLXApplication
151
+
152
+ #pragma region IADLXApplicationList
153
+ #if defined (__cplusplus)
154
+ namespace adlx
155
+ {
156
+ class ADLX_NO_VTABLE IADLXApplicationList : public IADLXList
157
+ {
158
+ public:
159
+ ADLX_DECLARE_IID(L"IADLXApplicationList")
160
+
161
+ //Lists must declare the type of items it holds - what was passed as ADLX_DECLARE_IID() in that interface
162
+ ADLX_DECLARE_ITEM_IID(IADLXApplication::IID())
163
+
164
+ /**
165
+ * @page DOX_IADLXApplicationList_At At
166
+ * @ENG_START_DOX
167
+ * @brief Returns the reference counted interface at the requested location.
168
+ * @ENG_END_DOX
169
+ * @syntax
170
+ * @codeStart
171
+ * @ref ADLX_RESULT At (const adlx_uint location, IADLXApplication** ppItem)
172
+ * @codeEnd
173
+ *
174
+ * @params
175
+ * @paramrow{1.,[in] ,location,const adlx_uint ,@ENG_START_DOX The location of the requested interface. @ENG_END_DOX}
176
+ * @paramrow{2.,[out] ,ppItem,@ref DOX_IADLXApplication** ,@ENG_START_DOX The address of a pointer to the returned interface. If the interface is not successfully returned then the method sets the dereferenced address __*ppItem__ to __nullptr__. @ENG_END_DOX}
177
+ *
178
+ * @retvalues
179
+ * @ENG_START_DOX
180
+ * If the location is within the list bounds, __ADLX_OK__ is returned.<br>
181
+ * If the location is not within the list bounds, an error code is returned.<br>
182
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
183
+ * @ENG_END_DOX
184
+ *
185
+ * @detaileddesc
186
+ * @ENG_START_DOX
187
+ * @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when it is no longer needed.
188
+ * @ENG_END_DOX
189
+ *
190
+ * @addinfo
191
+ * @ENG_START_DOX
192
+ * 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.
193
+ * @ENG_END_DOX
194
+ *
195
+ * @copydoc IADLXApplicationList_REQ_TABLE
196
+ *
197
+ */
198
+ virtual ADLX_RESULT ADLX_STD_CALL At(const adlx_uint location, IADLXApplication** ppItem) = 0;
199
+
200
+ /**
201
+ * @page DOX_IADLXApplicationList_Add_Back Add_Back
202
+ * @ENG_START_DOX
203
+ * @brief Adds an interface to the end of a list.
204
+ * @ENG_END_DOX
205
+ * @syntax
206
+ * @codeStart
207
+ * @ref ADLX_RESULT Add_Back (IADLXApplication* pItem)
208
+ * @codeEnd
209
+ *
210
+ * @params
211
+ * @paramrow{1.,[in] ,pItem,@ref DOX_IADLXApplication* ,@ENG_START_DOX The pointer to the interface to be added to the list. @ENG_END_DOX}
212
+ *
213
+ * @retvalues
214
+ * @ENG_START_DOX
215
+ * If the interface is added successfully to the end of the list, __ADLX_OK__ is returned.<br>
216
+ * If the interface is not added to the end of the list, an error code is returned.<br>
217
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
218
+ * @ENG_END_DOX
219
+ *
220
+ * @detaileddesc
221
+ * @ENG_START_DOX
222
+ * @details
223
+ * @ENG_END_DOX
224
+ *
225
+ *
226
+ * @copydoc IADLXApplicationList_REQ_TABLE
227
+ *
228
+ */
229
+ virtual ADLX_RESULT ADLX_STD_CALL Add_Back(IADLXApplication* pItem) = 0;
230
+ }; //IADLXApplicationList
231
+ //----------------------------------------------------------------------------------------------
232
+ typedef IADLXInterfacePtr_T<IADLXApplicationList> IADLXApplicationListPtr;
233
+ } //namespace adlx
234
+ #else // __cplusplus
235
+ ADLX_DECLARE_IID(IADLXApplicationList, L"IADLXApplicationList")
236
+ ADLX_DECLARE_ITEM_IID(IADLXApplication, IID_IADLXApplication())
237
+
238
+ typedef struct IADLXApplicationList IADLXApplicationList;
239
+ typedef struct IADLXApplicationListVtbl
240
+ {
241
+ //IADLXInterface
242
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXApplicationList* pThis);
243
+ adlx_long(ADLX_STD_CALL* Release)(IADLXApplicationList* pThis);
244
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXApplicationList* pThis, const wchar_t* interfaceId, void** ppInterface);
245
+
246
+ //IADLXList
247
+ adlx_uint(ADLX_STD_CALL* Size)(IADLXApplicationList* pThis);
248
+ adlx_uint8(ADLX_STD_CALL* Empty)(IADLXApplicationList* pThis);
249
+ adlx_uint(ADLX_STD_CALL* Begin)(IADLXApplicationList* pThis);
250
+ adlx_uint(ADLX_STD_CALL* End)(IADLXApplicationList* pThis);
251
+ ADLX_RESULT(ADLX_STD_CALL* At)(IADLXApplicationList* pThis, const adlx_uint location, IADLXInterface** ppItem);
252
+ ADLX_RESULT(ADLX_STD_CALL* Clear)(IADLXApplicationList* pThis);
253
+ ADLX_RESULT(ADLX_STD_CALL* Remove_Back)(IADLXApplicationList* pThis);
254
+ ADLX_RESULT(ADLX_STD_CALL* Add_Back)(IADLXApplicationList* pThis, IADLXInterface* pItem);
255
+
256
+ //IADLXApplicationList
257
+ ADLX_RESULT(ADLX_STD_CALL* At_ApplicationList)(IADLXApplicationList* pThis, const adlx_uint location, IADLXApplication** ppItem);
258
+ ADLX_RESULT(ADLX_STD_CALL* Add_Back_ApplicationList)(IADLXApplicationList* pThis, IADLXApplication* pItem);
259
+
260
+ } IADLXApplicationListVtbl;
261
+
262
+ struct IADLXApplicationList { const IADLXApplicationListVtbl* pVtbl; };
263
+ #endif
264
+ #pragma endregion IADLXApplicationList
265
+
266
+ #pragma region IADLXGPUAppsListEventListener
267
+ #if defined (__cplusplus)
268
+ namespace adlx
269
+ {
270
+ class ADLX_NO_VTABLE IADLXGPU2;
271
+ class ADLX_NO_VTABLE IADLXGPUAppsListEventListener
272
+ {
273
+ public:
274
+ /**
275
+ *@page DOX_IADLXGPUAppsListEventListener_OnGPUAppsListChanged OnGPUAppsListChanged
276
+ *@ENG_START_DOX @brief __OnGPUAppsListChanged__ is called by ADLX to provide an updated list of GPU applications. @ENG_END_DOX
277
+ *
278
+ *@syntax
279
+ *@codeStart
280
+ * adlx_bool OnGPUAppsListChanged (@ref DOX_IADLXGPU2* pGPU, @ref DOX_IADLXApplicationList* pApplications)
281
+ *@codeEnd
282
+ *
283
+ *@params
284
+ *@paramrow{1.,[out] ,pGPU,@ref DOX_IADLXGPU2* ,@ENG_START_DOX The pointer to a GPU that is changed. @ENG_END_DOX}
285
+ *@paramrow{2.,[out] ,pApplications,@ref DOX_IADLXApplicationList* ,@ENG_START_DOX The pointer to a list of applications that is changed. @ENG_END_DOX}
286
+ *
287
+ *@retvalues
288
+ *@ENG_START_DOX If the application requires ADLX to continue notifying the next listener, __true__ must be returned.<br>
289
+ * If the application requires ADLX to stop notifying the next listener, __false__ must be returned.<br> @ENG_END_DOX
290
+ *
291
+ *@detaileddesc
292
+ *@ENG_START_DOX Once the application registers to the notifications with @ref DOX_IADLXGPUAppsListChangedHandling_AddGPUAppsListEventListener,
293
+ * ADLX will call this method until the application unregisters from the notifications with @ref DOX_IADLXGPUAppsListChangedHandling_RemoveGPUAppsListEventListener.
294
+ * The method should return quickly to not block the execution path in ADLX. If the method requires a long processing of the event notification, the application
295
+ * must hold onto a reference to the new GPU application list with @ref DOX_IADLXInterface_Acquire and make it available on an asynchronous thread and return immediately.
296
+ * When the asynchronous thread is done processing, it must discard the new GPU application list with @ref DOX_IADLXInterface_Release. @ENG_END_DOX
297
+ *
298
+ *@copydoc IADLXGPUAppsListEventListener_REQ_TABLE
299
+ *
300
+ */
301
+ virtual adlx_bool ADLX_STD_CALL OnGPUAppsListChanged (IADLXGPU2* pGPU, IADLXApplicationList* pApplications) = 0;
302
+ }; //IADLXGPUAppsListEventListener
303
+ } //namespace adlx
304
+ #else //__cplusplus
305
+ typedef struct IADLXGPUAppsListEventListener IADLXGPUAppsListEventListener;
306
+ typedef struct IADLXGPUAppsListEventListenerVtbl
307
+ {
308
+ adlx_bool (ADLX_STD_CALL* OnGPUAppsListChanged)(IADLXGPUAppsListEventListener* pThis, IADLXGPU2* pGPU, IADLXApplicationList* pApplications);
309
+ } IADLXGPUAppsListEventListenerVtbl;
310
+ struct IADLXGPUAppsListEventListener { const IADLXGPUAppsListEventListenerVtbl* pVtbl; };
311
+ #endif //__cplusplus
312
+ #pragma endregion IADLXGPUAppsListEventListener
313
+
314
+ #pragma region IADLXGPUAppsListChangedHandling
315
+ #if defined (__cplusplus)
316
+ namespace adlx
317
+ {
318
+ class ADLX_NO_VTABLE IADLXGPUAppsListChangedHandling : public IADLXInterface
319
+ {
320
+ public:
321
+ ADLX_DECLARE_IID(L"IADLXGPUAppsListChangedHandling")
322
+
323
+ /**
324
+ *@page DOX_IADLXGPUAppsListChangedHandling_AddGPUAppsListEventListener AddGPUAppsListEventListener
325
+ *@ENG_START_DOX @brief Registers an event listener for notifications when the list of applications running on a GPU changes. @ENG_END_DOX
326
+ *
327
+ *@syntax
328
+ *@codeStart
329
+ * @ref ADLX_RESULT AddGPUAppsListEventListener (@ref DOX_IADLXGPUAppsListEventListener* pGPUAppsListEventListener)
330
+ *@codeEnd
331
+ *
332
+ *@params
333
+ *@paramrow{1.,[in] ,pGPUAppsListEventListener,@ref DOX_IADLXGPUAppsListEventListener* ,@ENG_START_DOX The pointer to the event listener interface to register for receiving list of applications running on a GPU change notifications. @ENG_END_DOX}
334
+ *
335
+ *@retvalues
336
+ *@ENG_START_DOX If the event listener is successfully registered, __ADLX_OK__ is returned.<br>
337
+ * If the event listener is not successfully registered, an error code is returned.<br>
338
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
339
+ *
340
+ *@detaileddesc
341
+ *@ENG_START_DOX After the event listener is successfully registered, ADLX calls the @ref DOX_IADLXGPUAppsListEventListener_OnGPUAppsListChanged method of the listener when power tuning settings change.<br>
342
+ * The event listener instance must exist until the application unregisters the event listener with @ref DOX_IADLXGPUAppsListChangedHandling_RemoveGPUAppsListEventListener.<br> @ENG_END_DOX
343
+ *
344
+ *@copydoc IADLXGPUAppsListChangedHandling_REQ_TABLE
345
+ *
346
+ */
347
+ virtual ADLX_RESULT ADLX_STD_CALL AddGPUAppsListEventListener (IADLXGPUAppsListEventListener* pGPUAppsListEventListener) = 0;
348
+
349
+ /**
350
+ *@page DOX_IADLXGPUAppsListChangedHandling_RemoveGPUAppsListEventListener RemoveGPUAppsListEventListener
351
+ *@ENG_START_DOX @brief Unregisters an event listener from notifications when the list of applications running on a GPU changes. @ENG_END_DOX
352
+ *
353
+ *@syntax
354
+ *@codeStart
355
+ * @ref ADLX_RESULT RemoveGPUAppsListEventListener (@ref DOX_IADLXGPUAppsListEventListener* pGPUAppsListEventListener)
356
+ *@codeEnd
357
+ *
358
+ *@params
359
+ *@paramrow{1.,[in] ,pGPUAppsListEventListener,@ref DOX_IADLXGPUAppsListEventListener* ,@ENG_START_DOX The pointer to the event listener interface to unregister from receiving list of applications running on a GPU change notifications. @ENG_END_DOX}
360
+ *
361
+ *@retvalues
362
+ *@ENG_START_DOX If the event listener is successfully unregistered, __ADLX_OK__ is returned.<br>
363
+ * If the event listener is not successfully unregistered, an error code is returned.<br>
364
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
365
+ *
366
+ *@detaileddesc
367
+ *@ENG_START_DOX After the event listener is successfully unregistered, ADLX will no longer call @ref DOX_IADLXGPUAppsListEventListener_OnGPUAppsListChanged method of the listener when Power Tuning settings change.
368
+ * The application can discard the event listener instance. @ENG_END_DOX
369
+ *
370
+ *@copydoc IADLXGPUAppsListChangedHandling_REQ_TABLE
371
+ *
372
+ */
373
+ virtual ADLX_RESULT ADLX_STD_CALL RemoveGPUAppsListEventListener (IADLXGPUAppsListEventListener* pGPUAppsListEventListener) = 0;
374
+
375
+ }; //IADLXGPUAppsListChangedHandling
376
+ //----------------------------------------------------------------------------------------------
377
+ typedef IADLXInterfacePtr_T<IADLXGPUAppsListChangedHandling> IADLXGPUAppsListChangedHandlingPtr;
378
+ } //namespace adlx
379
+ #else //__cplusplus
380
+ ADLX_DECLARE_IID(IADLXGPUAppsListChangedHandling, L"IADLXGPUAppsListChangedHandling")
381
+ typedef struct IADLXGPUAppsListChangedHandling IADLXGPUAppsListChangedHandling;
382
+ typedef struct IADLXGPUAppsListChangedHandlingVtbl
383
+ {
384
+ //IADLXInterface
385
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXGPUAppsListChangedHandling* pThis);
386
+ adlx_long(ADLX_STD_CALL* Release)(IADLXGPUAppsListChangedHandling* pThis);
387
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXGPUAppsListChangedHandling* pThis, const wchar_t* interfaceId, void** ppInterface);
388
+
389
+ //IADLXGPUAppsListChangedHandling
390
+ ADLX_RESULT(ADLX_STD_CALL* AddGPUAppsListEventListener)(IADLXGPUAppsListChangedHandling* pThis, IADLXGPUAppsListEventListener* pGPUAppsListEventListener);
391
+ ADLX_RESULT(ADLX_STD_CALL* RemoveGPUAppsListEventListener)(IADLXGPUAppsListChangedHandling* pThis, IADLXGPUAppsListEventListener* pGPUAppsListEventListener);
392
+ } IADLXGPUAppsListChangedHandlingVtbl;
393
+ struct IADLXGPUAppsListChangedHandling { const IADLXGPUAppsListChangedHandlingVtbl* pVtbl; };
394
+ #endif //__cplusplus
395
+ #pragma endregion IADLXGPUAppsListChangedHandling
396
+
397
+ #endif
@@ -0,0 +1,71 @@
1
+ //
2
+ // Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_CHANGEDE_EVENT_H
7
+ #define ADLX_CHANGEDE_EVENT_H
8
+ #pragma once
9
+
10
+ #include "ADLXDefines.h"
11
+
12
+ #pragma region IADLXChangedEvent
13
+ #if defined (__cplusplus)
14
+ namespace adlx
15
+ {
16
+ class ADLX_NO_VTABLE IADLXChangedEvent : public IADLXInterface
17
+ {
18
+ public:
19
+ ADLX_DECLARE_IID(L"IADLXChangedEvent")
20
+
21
+ /**
22
+ *@page DOX_IADLXChangedEvent_GetOrigin GetOrigin
23
+ *@ENG_START_DOX @brief Gets the origin of an event. @ENG_END_DOX
24
+ *
25
+ *@syntax
26
+ *@codeStart
27
+ * @ref ADLX_SYNC_ORIGIN GetOrigin ()
28
+ *@codeEnd
29
+ *
30
+ *@params
31
+ *N/A
32
+ *
33
+ *@retvalues
34
+ *@ENG_START_DOX
35
+ * If the event is triggered by a change in settings using ADLX in this application, __SYNC_ORIGIN_INTERNAL__ is returned. <br>
36
+ * If the event is triggered by a change in settings using ADLX in another application, __SYNC_ORIGIN_EXTERNAL__ is returned. <br>
37
+ * If the event has an unknown trigger, __SYNC_ORIGIN_UNKNOWN__ is returned. <br>
38
+ *@ENG_END_DOX
39
+ *
40
+ *@copydoc IADLXChangedEvent_REQ_TABLE
41
+ *
42
+ */
43
+ virtual ADLX_SYNC_ORIGIN ADLX_STD_CALL GetOrigin() = 0;
44
+ }; //IADLXList
45
+ //----------------------------------------------------------------------------------------------
46
+ typedef IADLXInterfacePtr_T<IADLXChangedEvent> IADLXChangedEventPtr;
47
+ } // namespace adlx
48
+ #else
49
+ ADLX_DECLARE_IID(IADLXChangedEvent, L"IADLXChangedEvent")
50
+ typedef struct IADLXChangedEvent IADLXChangedEvent;
51
+ typedef struct IADLXChangedEventVtbl
52
+ {
53
+ //IADLXInterface
54
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXChangedEvent* pThis);
55
+ adlx_long(ADLX_STD_CALL* Release)(IADLXChangedEvent* pThis);
56
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXChangedEvent* pThis, const wchar_t* interfaceId, void** ppInterface);
57
+
58
+ //IADLXChangedEvent
59
+ ADLX_SYNC_ORIGIN(ADLX_STD_CALL* GetOrigin)(IADLXChangedEvent* pThis);
60
+
61
+ }IADLXChangedEventVtbl;
62
+
63
+ struct IADLXChangedEvent
64
+ {
65
+ const IADLXChangedEventVtbl* pVtbl;
66
+ };
67
+
68
+ #endif
69
+ #pragma endregion IADLXChangedEvent
70
+
71
+ #endif //ADLX_CHANGEDE_EVENT_H