File: zet_debug_api_entrypoints.h

package info (click to toggle)
intel-compute-runtime 22.43.24595.41-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,740 kB
  • sloc: cpp: 631,142; lisp: 3,515; sh: 470; makefile: 76; python: 21
file content (232 lines) | stat: -rw-r--r-- 6,169 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
/*
 * Copyright (C) 2020-2022 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once

#include "level_zero/core/source/device/device.h"
#include "level_zero/tools/source/debug/debug_handlers.h"
#include <level_zero/zet_api.h>

namespace L0 {
ze_result_t zetDeviceGetDebugProperties(
    zet_device_handle_t hDevice,
    zet_device_debug_properties_t *pDebugProperties) {
    return L0::Device::fromHandle(hDevice)->getDebugProperties(pDebugProperties);
}

ze_result_t zetDebugAttach(
    zet_device_handle_t hDevice,
    const zet_debug_config_t *config,
    zet_debug_session_handle_t *phDebug) {
    return L0::DebugApiHandlers::debugAttach(hDevice, config, phDebug);
}

ze_result_t zetDebugDetach(
    zet_debug_session_handle_t hDebug) {
    return L0::DebugApiHandlers::debugDetach(hDebug);
}

ze_result_t zetDebugReadEvent(
    zet_debug_session_handle_t hDebug,
    uint64_t timeout,
    zet_debug_event_t *event) {
    return L0::DebugApiHandlers::debugReadEvent(hDebug, timeout, event);
}

ze_result_t zetDebugInterrupt(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread) {
    return L0::DebugApiHandlers::debugInterrupt(hDebug, thread);
}

ze_result_t zetDebugResume(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread) {
    return L0::DebugApiHandlers::debugResume(hDebug, thread);
}

ze_result_t zetDebugReadMemory(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    const zet_debug_memory_space_desc_t *desc,
    size_t size,
    void *buffer) {
    return L0::DebugApiHandlers::debugReadMemory(hDebug, thread, desc, size, buffer);
}

ze_result_t zetDebugWriteMemory(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    const zet_debug_memory_space_desc_t *desc,
    size_t size,
    const void *buffer) {
    return L0::DebugApiHandlers::debugWriteMemory(hDebug, thread, desc, size, buffer);
}

ze_result_t zetDebugAcknowledgeEvent(
    zet_debug_session_handle_t hDebug,
    const zet_debug_event_t *event) {
    return L0::DebugApiHandlers::debugAcknowledgeEvent(hDebug, event);
}

ze_result_t zetDebugGetRegisterSetProperties(
    zet_device_handle_t hDevice,
    uint32_t *pCount,
    zet_debug_regset_properties_t *pRegisterSetProperties) {
    return L0::DebugApiHandlers::debugGetRegisterSetProperties(hDevice, pCount, pRegisterSetProperties);
}

ze_result_t zetDebugReadRegisters(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    uint32_t type,
    uint32_t start,
    uint32_t count,
    void *pRegisterValues) {
    return L0::DebugApiHandlers::debugReadRegisters(hDebug, thread, type, start, count, pRegisterValues);
}

ze_result_t zetDebugWriteRegisters(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    uint32_t type,
    uint32_t start,
    uint32_t count,
    void *pRegisterValues) {
    return L0::DebugApiHandlers::debugWriteRegisters(hDebug, thread, type, start, count, pRegisterValues);
}
} // namespace L0

extern "C" {
ZE_APIEXPORT ze_result_t ZE_APICALL zetDeviceGetDebugProperties(
    zet_device_handle_t hDevice,
    zet_device_debug_properties_t *pDebugProperties) {
    return L0::zetDeviceGetDebugProperties(
        hDevice,
        pDebugProperties);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugAttach(
    zet_device_handle_t hDevice,
    const zet_debug_config_t *config,
    zet_debug_session_handle_t *phDebug) {
    return L0::zetDebugAttach(
        hDevice,
        config,
        phDebug);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugDetach(
    zet_debug_session_handle_t hDebug) {
    return L0::zetDebugDetach(
        hDebug);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadEvent(
    zet_debug_session_handle_t hDebug,
    uint64_t timeout,
    zet_debug_event_t *event) {
    return L0::zetDebugReadEvent(
        hDebug,
        timeout,
        event);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugAcknowledgeEvent(
    zet_debug_session_handle_t hDebug,
    const zet_debug_event_t *event) {
    return L0::zetDebugAcknowledgeEvent(
        hDebug,
        event);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugInterrupt(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread) {
    return L0::zetDebugInterrupt(
        hDebug,
        thread);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugResume(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread) {
    return L0::zetDebugResume(
        hDebug,
        thread);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadMemory(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    const zet_debug_memory_space_desc_t *desc,
    size_t size,
    void *buffer) {
    return L0::zetDebugReadMemory(
        hDebug,
        thread,
        desc,
        size,
        buffer);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugWriteMemory(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    const zet_debug_memory_space_desc_t *desc,
    size_t size,
    const void *buffer) {
    return L0::zetDebugWriteMemory(
        hDebug,
        thread,
        desc,
        size,
        buffer);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugGetRegisterSetProperties(
    zet_device_handle_t hDevice,
    uint32_t *pCount,
    zet_debug_regset_properties_t *pRegisterSetProperties) {
    return L0::zetDebugGetRegisterSetProperties(
        hDevice,
        pCount,
        pRegisterSetProperties);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadRegisters(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    uint32_t type,
    uint32_t start,
    uint32_t count,
    void *pRegisterValues) {
    return L0::zetDebugReadRegisters(
        hDebug,
        thread,
        type,
        start,
        count,
        pRegisterValues);
}

ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugWriteRegisters(
    zet_debug_session_handle_t hDebug,
    ze_device_thread_t thread,
    uint32_t type,
    uint32_t start,
    uint32_t count,
    void *pRegisterValues) {
    return L0::zetDebugWriteRegisters(
        hDebug,
        thread,
        type,
        start,
        count,
        pRegisterValues);
}
}