File: zer_ddi.h

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 (96 lines) | stat: -rw-r--r-- 3,337 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
/*
 *
 * Copyright (C) 2019-2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 * @file zer_ddi.h
 * @version v1.14-r1.14.33
 *
 */
#ifndef _ZER_DDI_H
#define _ZER_DDI_H
#if defined(__cplusplus)
#pragma once
#endif
#include "zer_api.h"

#if defined(__cplusplus)
extern "C" {
#endif

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zerGetLastErrorDescription 
typedef ze_result_t (ZE_APICALL *zer_pfnGetLastErrorDescription_t)(
    const char**
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zerTranslateDeviceHandleToIdentifier 
typedef uint32_t (ZE_APICALL *zer_pfnTranslateDeviceHandleToIdentifier_t)(
    ze_device_handle_t
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zerTranslateIdentifierToDeviceHandle 
typedef ze_device_handle_t (ZE_APICALL *zer_pfnTranslateIdentifierToDeviceHandle_t)(
    uint32_t
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zerGetDefaultContext 
typedef ze_context_handle_t (ZE_APICALL *zer_pfnGetDefaultContext_t)(
    void
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Table of Global functions pointers
typedef struct _zer_global_dditable_t
{
    zer_pfnGetLastErrorDescription_t                            pfnGetLastErrorDescription;
    zer_pfnTranslateDeviceHandleToIdentifier_t                  pfnTranslateDeviceHandleToIdentifier;
    zer_pfnTranslateIdentifierToDeviceHandle_t                  pfnTranslateIdentifierToDeviceHandle;
    zer_pfnGetDefaultContext_t                                  pfnGetDefaultContext;
} zer_global_dditable_t;

///////////////////////////////////////////////////////////////////////////////
/// @brief Exported function for filling application's Global table
///        with current process' addresses
///
/// @returns
///     - ::ZE_RESULT_SUCCESS
///     - ::ZE_RESULT_ERROR_UNINITIALIZED
///     - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
///     - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION
ZE_DLLEXPORT ze_result_t ZE_APICALL
zerGetGlobalProcAddrTable(
    ze_api_version_t version,                                               ///< [in] API version requested
    zer_global_dditable_t* pDdiTable                                        ///< [in,out] pointer to table of DDI function pointers
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zerGetGlobalProcAddrTable
typedef ze_result_t (ZE_APICALL *zer_pfnGetGlobalProcAddrTable_t)(
    ze_api_version_t,
    zer_global_dditable_t*
    );

///////////////////////////////////////////////////////////////////////////////
/// @brief Container for all DDI tables
typedef struct _zer_dditable_t
{
    zer_global_dditable_t               Global;
} zer_dditable_t;
/// @brief Container for all DDI tables with version and tables set by the Driver
typedef struct _zer_dditable_driver_t
{
    ze_api_version_t    version;
    uint8_t             isValidFlag;
    zer_global_dditable_t *             Global;
} zer_dditable_driver_t;

#if defined(__cplusplus)
} // extern "C"
#endif

#endif // _ZER_DDI_H