File: zet_libddi.cpp

package info (click to toggle)
level-zero 1.26.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,468 kB
  • sloc: cpp: 130,327; ansic: 16,197; python: 9,824; makefile: 4
file content (415 lines) | stat: -rw-r--r-- 23,045 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
/*
 *
 * Copyright (C) 2019-2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 * @file zet_libddi.cpp
 *
 */
#include "ze_lib.h"
#ifndef L0_STATIC_LOADER_BUILD
#include "zet_ddi.h"
#endif

namespace ze_lib
{
    ///////////////////////////////////////////////////////////////////////////////

#ifdef L0_STATIC_LOADER_BUILD
    __zedlllocal ze_result_t context_t::zetDdiTableInit(ze_api_version_t version)
    {
        ze_result_t result = ZE_RESULT_SUCCESS;

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetMetricDecoderExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricDecoderExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.MetricDecoderExp );
            initialzetDdiTable.MetricDecoderExp.pfnCreateExp = reinterpret_cast<zet_pfnMetricDecoderCreateExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricDecoderCreateExp") );
            initialzetDdiTable.MetricDecoderExp.pfnDestroyExp = reinterpret_cast<zet_pfnMetricDecoderDestroyExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricDecoderDestroyExp") );
            initialzetDdiTable.MetricDecoderExp.pfnGetDecodableMetricsExp = reinterpret_cast<zet_pfnMetricDecoderGetDecodableMetricsExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricDecoderGetDecodableMetricsExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetMetricProgrammableExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricProgrammableExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.MetricProgrammableExp );
            initialzetDdiTable.MetricProgrammableExp.pfnGetExp = reinterpret_cast<zet_pfnMetricProgrammableGetExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricProgrammableGetExp") );
            initialzetDdiTable.MetricProgrammableExp.pfnGetPropertiesExp = reinterpret_cast<zet_pfnMetricProgrammableGetPropertiesExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricProgrammableGetPropertiesExp") );
            initialzetDdiTable.MetricProgrammableExp.pfnGetParamInfoExp = reinterpret_cast<zet_pfnMetricProgrammableGetParamInfoExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricProgrammableGetParamInfoExp") );
            initialzetDdiTable.MetricProgrammableExp.pfnGetParamValueInfoExp = reinterpret_cast<zet_pfnMetricProgrammableGetParamValueInfoExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricProgrammableGetParamValueInfoExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetMetricTracerExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricTracerExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.MetricTracerExp );
            initialzetDdiTable.MetricTracerExp.pfnCreateExp = reinterpret_cast<zet_pfnMetricTracerCreateExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerCreateExp") );
            initialzetDdiTable.MetricTracerExp.pfnDestroyExp = reinterpret_cast<zet_pfnMetricTracerDestroyExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerDestroyExp") );
            initialzetDdiTable.MetricTracerExp.pfnEnableExp = reinterpret_cast<zet_pfnMetricTracerEnableExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerEnableExp") );
            initialzetDdiTable.MetricTracerExp.pfnDisableExp = reinterpret_cast<zet_pfnMetricTracerDisableExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerDisableExp") );
            initialzetDdiTable.MetricTracerExp.pfnReadDataExp = reinterpret_cast<zet_pfnMetricTracerReadDataExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerReadDataExp") );
            initialzetDdiTable.MetricTracerExp.pfnDecodeExp = reinterpret_cast<zet_pfnMetricTracerDecodeExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricTracerDecodeExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetDeviceProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetDeviceProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Device );
            initialzetDdiTable.Device.pfnGetDebugProperties = reinterpret_cast<zet_pfnDeviceGetDebugProperties_t>(
                GET_FUNCTION_PTR(loader, "zetDeviceGetDebugProperties") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetDeviceExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetDeviceExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.DeviceExp );
            initialzetDdiTable.DeviceExp.pfnGetConcurrentMetricGroupsExp = reinterpret_cast<zet_pfnDeviceGetConcurrentMetricGroupsExp_t>(
                GET_FUNCTION_PTR(loader, "zetDeviceGetConcurrentMetricGroupsExp") );
            initialzetDdiTable.DeviceExp.pfnCreateMetricGroupsFromMetricsExp = reinterpret_cast<zet_pfnDeviceCreateMetricGroupsFromMetricsExp_t>(
                GET_FUNCTION_PTR(loader, "zetDeviceCreateMetricGroupsFromMetricsExp") );
            initialzetDdiTable.DeviceExp.pfnEnableMetricsExp = reinterpret_cast<zet_pfnDeviceEnableMetricsExp_t>(
                GET_FUNCTION_PTR(loader, "zetDeviceEnableMetricsExp") );
            initialzetDdiTable.DeviceExp.pfnDisableMetricsExp = reinterpret_cast<zet_pfnDeviceDisableMetricsExp_t>(
                GET_FUNCTION_PTR(loader, "zetDeviceDisableMetricsExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetContextProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetContextProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Context );
            initialzetDdiTable.Context.pfnActivateMetricGroups = reinterpret_cast<zet_pfnContextActivateMetricGroups_t>(
                GET_FUNCTION_PTR(loader, "zetContextActivateMetricGroups") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetCommandListProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetCommandListProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.CommandList );
            initialzetDdiTable.CommandList.pfnAppendMetricStreamerMarker = reinterpret_cast<zet_pfnCommandListAppendMetricStreamerMarker_t>(
                GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricStreamerMarker") );
            initialzetDdiTable.CommandList.pfnAppendMetricQueryBegin = reinterpret_cast<zet_pfnCommandListAppendMetricQueryBegin_t>(
                GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricQueryBegin") );
            initialzetDdiTable.CommandList.pfnAppendMetricQueryEnd = reinterpret_cast<zet_pfnCommandListAppendMetricQueryEnd_t>(
                GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricQueryEnd") );
            initialzetDdiTable.CommandList.pfnAppendMetricMemoryBarrier = reinterpret_cast<zet_pfnCommandListAppendMetricMemoryBarrier_t>(
                GET_FUNCTION_PTR(loader, "zetCommandListAppendMetricMemoryBarrier") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetCommandListExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetCommandListExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.CommandListExp );
            initialzetDdiTable.CommandListExp.pfnAppendMarkerExp = reinterpret_cast<zet_pfnCommandListAppendMarkerExp_t>(
                GET_FUNCTION_PTR(loader, "zetCommandListAppendMarkerExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetKernelProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetKernelProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Kernel );
            initialzetDdiTable.Kernel.pfnGetProfileInfo = reinterpret_cast<zet_pfnKernelGetProfileInfo_t>(
                GET_FUNCTION_PTR(loader, "zetKernelGetProfileInfo") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetModuleProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetModuleProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Module );
            initialzetDdiTable.Module.pfnGetDebugInfo = reinterpret_cast<zet_pfnModuleGetDebugInfo_t>(
                GET_FUNCTION_PTR(loader, "zetModuleGetDebugInfo") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetDebugProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetDebugProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Debug );
            initialzetDdiTable.Debug.pfnAttach = reinterpret_cast<zet_pfnDebugAttach_t>(
                GET_FUNCTION_PTR(loader, "zetDebugAttach") );
            initialzetDdiTable.Debug.pfnDetach = reinterpret_cast<zet_pfnDebugDetach_t>(
                GET_FUNCTION_PTR(loader, "zetDebugDetach") );
            initialzetDdiTable.Debug.pfnReadEvent = reinterpret_cast<zet_pfnDebugReadEvent_t>(
                GET_FUNCTION_PTR(loader, "zetDebugReadEvent") );
            initialzetDdiTable.Debug.pfnAcknowledgeEvent = reinterpret_cast<zet_pfnDebugAcknowledgeEvent_t>(
                GET_FUNCTION_PTR(loader, "zetDebugAcknowledgeEvent") );
            initialzetDdiTable.Debug.pfnInterrupt = reinterpret_cast<zet_pfnDebugInterrupt_t>(
                GET_FUNCTION_PTR(loader, "zetDebugInterrupt") );
            initialzetDdiTable.Debug.pfnResume = reinterpret_cast<zet_pfnDebugResume_t>(
                GET_FUNCTION_PTR(loader, "zetDebugResume") );
            initialzetDdiTable.Debug.pfnReadMemory = reinterpret_cast<zet_pfnDebugReadMemory_t>(
                GET_FUNCTION_PTR(loader, "zetDebugReadMemory") );
            initialzetDdiTable.Debug.pfnWriteMemory = reinterpret_cast<zet_pfnDebugWriteMemory_t>(
                GET_FUNCTION_PTR(loader, "zetDebugWriteMemory") );
            initialzetDdiTable.Debug.pfnGetRegisterSetProperties = reinterpret_cast<zet_pfnDebugGetRegisterSetProperties_t>(
                GET_FUNCTION_PTR(loader, "zetDebugGetRegisterSetProperties") );
            initialzetDdiTable.Debug.pfnReadRegisters = reinterpret_cast<zet_pfnDebugReadRegisters_t>(
                GET_FUNCTION_PTR(loader, "zetDebugReadRegisters") );
            initialzetDdiTable.Debug.pfnWriteRegisters = reinterpret_cast<zet_pfnDebugWriteRegisters_t>(
                GET_FUNCTION_PTR(loader, "zetDebugWriteRegisters") );
            initialzetDdiTable.Debug.pfnGetThreadRegisterSetProperties = reinterpret_cast<zet_pfnDebugGetThreadRegisterSetProperties_t>(
                GET_FUNCTION_PTR(loader, "zetDebugGetThreadRegisterSetProperties") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetMetricProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.Metric );
            initialzetDdiTable.Metric.pfnGet = reinterpret_cast<zet_pfnMetricGet_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGet") );
            initialzetDdiTable.Metric.pfnGetProperties = reinterpret_cast<zet_pfnMetricGetProperties_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGetProperties") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetMetricExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.MetricExp );
            initialzetDdiTable.MetricExp.pfnCreateFromProgrammableExp2 = reinterpret_cast<zet_pfnMetricCreateFromProgrammableExp2_t>(
                GET_FUNCTION_PTR(loader, "zetMetricCreateFromProgrammableExp2") );
            initialzetDdiTable.MetricExp.pfnCreateFromProgrammableExp = reinterpret_cast<zet_pfnMetricCreateFromProgrammableExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricCreateFromProgrammableExp") );
            initialzetDdiTable.MetricExp.pfnDestroyExp = reinterpret_cast<zet_pfnMetricDestroyExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricDestroyExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetMetricGroupProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricGroupProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.MetricGroup );
            initialzetDdiTable.MetricGroup.pfnGet = reinterpret_cast<zet_pfnMetricGroupGet_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupGet") );
            initialzetDdiTable.MetricGroup.pfnGetProperties = reinterpret_cast<zet_pfnMetricGroupGetProperties_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupGetProperties") );
            initialzetDdiTable.MetricGroup.pfnCalculateMetricValues = reinterpret_cast<zet_pfnMetricGroupCalculateMetricValues_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupCalculateMetricValues") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            auto getTable = reinterpret_cast<zet_pfnGetMetricGroupExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricGroupExpProcAddrTable") );
            getTableWithCheck(getTable, version, &initialzetDdiTable.MetricGroupExp );
            initialzetDdiTable.MetricGroupExp.pfnCalculateMultipleMetricValuesExp = reinterpret_cast<zet_pfnMetricGroupCalculateMultipleMetricValuesExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupCalculateMultipleMetricValuesExp") );
            initialzetDdiTable.MetricGroupExp.pfnGetGlobalTimestampsExp = reinterpret_cast<zet_pfnMetricGroupGetGlobalTimestampsExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupGetGlobalTimestampsExp") );
            initialzetDdiTable.MetricGroupExp.pfnGetExportDataExp = reinterpret_cast<zet_pfnMetricGroupGetExportDataExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupGetExportDataExp") );
            initialzetDdiTable.MetricGroupExp.pfnCalculateMetricExportDataExp = reinterpret_cast<zet_pfnMetricGroupCalculateMetricExportDataExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupCalculateMetricExportDataExp") );
            initialzetDdiTable.MetricGroupExp.pfnCreateExp = reinterpret_cast<zet_pfnMetricGroupCreateExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupCreateExp") );
            initialzetDdiTable.MetricGroupExp.pfnAddMetricExp = reinterpret_cast<zet_pfnMetricGroupAddMetricExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupAddMetricExp") );
            initialzetDdiTable.MetricGroupExp.pfnRemoveMetricExp = reinterpret_cast<zet_pfnMetricGroupRemoveMetricExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupRemoveMetricExp") );
            initialzetDdiTable.MetricGroupExp.pfnCloseExp = reinterpret_cast<zet_pfnMetricGroupCloseExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupCloseExp") );
            initialzetDdiTable.MetricGroupExp.pfnDestroyExp = reinterpret_cast<zet_pfnMetricGroupDestroyExp_t>(
                GET_FUNCTION_PTR(loader, "zetMetricGroupDestroyExp") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetMetricQueryProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricQueryProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.MetricQuery );
            initialzetDdiTable.MetricQuery.pfnCreate = reinterpret_cast<zet_pfnMetricQueryCreate_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryCreate") );
            initialzetDdiTable.MetricQuery.pfnDestroy = reinterpret_cast<zet_pfnMetricQueryDestroy_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryDestroy") );
            initialzetDdiTable.MetricQuery.pfnReset = reinterpret_cast<zet_pfnMetricQueryReset_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryReset") );
            initialzetDdiTable.MetricQuery.pfnGetData = reinterpret_cast<zet_pfnMetricQueryGetData_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryGetData") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetMetricQueryPoolProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricQueryPoolProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.MetricQueryPool );
            initialzetDdiTable.MetricQueryPool.pfnCreate = reinterpret_cast<zet_pfnMetricQueryPoolCreate_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryPoolCreate") );
            initialzetDdiTable.MetricQueryPool.pfnDestroy = reinterpret_cast<zet_pfnMetricQueryPoolDestroy_t>(
                GET_FUNCTION_PTR(loader, "zetMetricQueryPoolDestroy") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetMetricStreamerProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetMetricStreamerProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.MetricStreamer );
            initialzetDdiTable.MetricStreamer.pfnOpen = reinterpret_cast<zet_pfnMetricStreamerOpen_t>(
                GET_FUNCTION_PTR(loader, "zetMetricStreamerOpen") );
            initialzetDdiTable.MetricStreamer.pfnClose = reinterpret_cast<zet_pfnMetricStreamerClose_t>(
                GET_FUNCTION_PTR(loader, "zetMetricStreamerClose") );
            initialzetDdiTable.MetricStreamer.pfnReadData = reinterpret_cast<zet_pfnMetricStreamerReadData_t>(
                GET_FUNCTION_PTR(loader, "zetMetricStreamerReadData") );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            auto getTable = reinterpret_cast<zet_pfnGetTracerExpProcAddrTable_t>(
                GET_FUNCTION_PTR(loader, "zetGetTracerExpProcAddrTable") );
            result = getTableWithCheck(getTable, version, &initialzetDdiTable.TracerExp );
            initialzetDdiTable.TracerExp.pfnCreate = reinterpret_cast<zet_pfnTracerExpCreate_t>(
                GET_FUNCTION_PTR(loader, "zetTracerExpCreate") );
            initialzetDdiTable.TracerExp.pfnDestroy = reinterpret_cast<zet_pfnTracerExpDestroy_t>(
                GET_FUNCTION_PTR(loader, "zetTracerExpDestroy") );
            initialzetDdiTable.TracerExp.pfnSetPrologues = reinterpret_cast<zet_pfnTracerExpSetPrologues_t>(
                GET_FUNCTION_PTR(loader, "zetTracerExpSetPrologues") );
            initialzetDdiTable.TracerExp.pfnSetEpilogues = reinterpret_cast<zet_pfnTracerExpSetEpilogues_t>(
                GET_FUNCTION_PTR(loader, "zetTracerExpSetEpilogues") );
            initialzetDdiTable.TracerExp.pfnSetEnabled = reinterpret_cast<zet_pfnTracerExpSetEnabled_t>(
                GET_FUNCTION_PTR(loader, "zetTracerExpSetEnabled") );
        }

        return result;
    }
#else
    __zedlllocal ze_result_t context_t::zetDdiTableInit(ze_api_version_t version)
    {
        ze_result_t result = ZE_RESULT_SUCCESS;

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetMetricDecoderExpProcAddrTable( version, &initialzetDdiTable.MetricDecoderExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetMetricProgrammableExpProcAddrTable( version, &initialzetDdiTable.MetricProgrammableExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetMetricTracerExpProcAddrTable( version, &initialzetDdiTable.MetricTracerExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetDeviceProcAddrTable( version, &initialzetDdiTable.Device );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetDeviceExpProcAddrTable( version, &initialzetDdiTable.DeviceExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetContextProcAddrTable( version, &initialzetDdiTable.Context );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetCommandListProcAddrTable( version, &initialzetDdiTable.CommandList );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetCommandListExpProcAddrTable( version, &initialzetDdiTable.CommandListExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetKernelProcAddrTable( version, &initialzetDdiTable.Kernel );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetModuleProcAddrTable( version, &initialzetDdiTable.Module );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetDebugProcAddrTable( version, &initialzetDdiTable.Debug );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetMetricProcAddrTable( version, &initialzetDdiTable.Metric );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetMetricExpProcAddrTable( version, &initialzetDdiTable.MetricExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetMetricGroupProcAddrTable( version, &initialzetDdiTable.MetricGroup );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            // Optional
            zetGetMetricGroupExpProcAddrTable( version, &initialzetDdiTable.MetricGroupExp );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetMetricQueryProcAddrTable( version, &initialzetDdiTable.MetricQuery );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetMetricQueryPoolProcAddrTable( version, &initialzetDdiTable.MetricQueryPool );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetMetricStreamerProcAddrTable( version, &initialzetDdiTable.MetricStreamer );
        }

        if( ZE_RESULT_SUCCESS == result )
        {
            result = zetGetTracerExpProcAddrTable( version, &initialzetDdiTable.TracerExp );
        }

        return result;
    }
#endif

} // namespace ze_lib