@@ -30,6 +30,9 @@ def _build_dpctl_function(llvm_module, return_ty, arg_list, func_name):
30
30
return fn
31
31
32
32
33
+ # --------------------- DpctlSyclQueue functions ------------------------------#
34
+
35
+
33
36
def dpctl_queue_copy (builder : llvmir .IRBuilder , * args ):
34
37
"""Inserts LLVM IR to call DPCTLQueue_Copy to create a copy of a
35
38
DpctlSyclQueueRef pointer passed in to the function.
@@ -66,42 +69,255 @@ def dpctl_queue_memcpy(builder: llvmir.IRBuilder, *args):
66
69
return ret
67
70
68
71
69
- def dpctl_event_wait (builder : llvmir .IRBuilder , * args ):
70
- """Inserts LLVM IR to call DPCTLEvent_Wait ."""
72
+ def dpctl_queue_delete (builder : llvmir .IRBuilder , * args ):
73
+ """Inserts LLVM IR to call DPCTLQueue_Delete ."""
71
74
mod = builder .module
72
75
fn = _build_dpctl_function (
73
76
llvm_module = mod ,
74
- return_ty = llvmir .VoidType (),
77
+ return_ty = llvmir .types . VoidType (),
75
78
arg_list = [cgutils .voidptr_t ],
76
- func_name = "DPCTLEvent_Wait " ,
79
+ func_name = "DPCTLQueue_Delete " ,
77
80
)
78
81
ret = builder .call (fn , args )
79
82
80
83
return ret
81
84
82
85
83
- def dpctl_event_delete (builder : llvmir .IRBuilder , * args ):
84
- """Inserts LLVM IR to call DPCTLEvent_Delete."""
86
+ def dpctl_queue_get_context (builder : llvmir .IRBuilder , * args ):
87
+ """Inserts LLVM IR to call DPCTLQueue_GetContext."""
88
+ mod = builder .module
89
+ fn = _build_dpctl_function (
90
+ llvm_module = mod ,
91
+ return_ty = cgutils .voidptr_t ,
92
+ arg_list = [cgutils .voidptr_t ],
93
+ func_name = "DPCTLQueue_GetContext" ,
94
+ )
95
+ ret = builder .call (fn , args )
96
+
97
+ return ret
98
+
99
+
100
+ def dpctl_queue_get_device (builder : llvmir .IRBuilder , * args ):
101
+ """Inserts LLVM IR to call DPCTLQueue_GetDevice."""
102
+ mod = builder .module
103
+ fn = _build_dpctl_function (
104
+ llvm_module = mod ,
105
+ return_ty = cgutils .voidptr_t ,
106
+ arg_list = [cgutils .voidptr_t ],
107
+ func_name = "DPCTLQueue_GetDevice" ,
108
+ )
109
+ ret = builder .call (fn , args )
110
+
111
+ return ret
112
+
113
+
114
+ def dpctl_queue_submit_range (builder : llvmir .IRBuilder , * args ):
115
+ """Inserts LLVM IR to call DPCTLQueue_SubmitRange.
116
+
117
+ DPCTLSyclEventRef
118
+ DPCTLQueue_SubmitRange(
119
+ const DPCTLSyclKernelRef KRef,
120
+ const DPCTLSyclQueueRef QRef,
121
+ void** Args,
122
+ const DPCTLKernelArgType* ArgTypes,
123
+ size_t NArgs,
124
+ const size_t Range[3],
125
+ size_t NRange,
126
+ const DPCTLSyclEventRef* DepEvents,
127
+ size_t NDepEvents
128
+ );
129
+
130
+ """
131
+ mod = builder .module
132
+ fn = _build_dpctl_function (
133
+ llvm_module = mod ,
134
+ return_ty = cgutils .voidptr_t ,
135
+ arg_list = [
136
+ cgutils .voidptr_t ,
137
+ cgutils .voidptr_t ,
138
+ cgutils .voidptr_t .as_pointer (),
139
+ cgutils .int32_t .as_pointer (),
140
+ llvmir .IntType (64 ),
141
+ llvmir .IntType (64 ).as_pointer (),
142
+ llvmir .IntType (64 ),
143
+ cgutils .voidptr_t ,
144
+ llvmir .IntType (64 ),
145
+ ],
146
+ func_name = "DPCTLQueue_SubmitRange" ,
147
+ )
148
+ ret = builder .call (fn , args )
149
+
150
+ return ret
151
+
152
+
153
+ def dpctl_queue_submit_ndrange (builder : llvmir .IRBuilder , * args ):
154
+ """Inserts LLVM IR to call DPCTLQueue_SubmitNDRange.
155
+
156
+ DPCTLSyclEventRef
157
+ DPCTLQueue_SubmitNDRange(
158
+ const DPCTLSyclKernelRef KRef,
159
+ const DPCTLSyclQueueRef QRef,
160
+ void** Args,
161
+ const DPCTLKernelArgType* ArgTypes,
162
+ size_t NArgs,
163
+ const size_t gRange[3],
164
+ const size_t lRange[3],
165
+ size_t NDims,
166
+ const DPCTLSyclEventRef* DepEvents,
167
+ size_t NDepEvents
168
+ );
169
+
170
+ """
171
+ mod = builder .module
172
+ fn = _build_dpctl_function (
173
+ llvm_module = mod ,
174
+ return_ty = cgutils .voidptr_t ,
175
+ arg_list = [
176
+ cgutils .voidptr_t ,
177
+ cgutils .voidptr_t ,
178
+ cgutils .voidptr_t .as_pointer (),
179
+ cgutils .int32_t .as_pointer (),
180
+ llvmir .IntType (64 ),
181
+ llvmir .IntType (64 ).as_pointer (),
182
+ llvmir .IntType (64 ).as_pointer (),
183
+ llvmir .IntType (64 ),
184
+ cgutils .voidptr_t ,
185
+ llvmir .IntType (64 ),
186
+ ],
187
+ func_name = "DPCTLQueue_SubmitNDRange" ,
188
+ )
189
+ ret = builder .call (fn , args )
190
+
191
+ return ret
192
+
193
+
194
+ # --------------------- DpctlSyclDevice functions -----------------------------#
195
+
196
+
197
+ def dpctl_device_delete (builder : llvmir .IRBuilder , * args ):
198
+ """Inserts LLVM IR to call DPCTLDevice_Delete."""
199
+ mod = builder .module
200
+ fn = _build_dpctl_function (
201
+ llvm_module = mod ,
202
+ return_ty = llvmir .types .VoidType (),
203
+ arg_list = [cgutils .voidptr_t ],
204
+ func_name = "DPCTLDevice_Delete" ,
205
+ )
206
+ ret = builder .call (fn , args )
207
+
208
+ return ret
209
+
210
+
211
+ # --------------------- DpctlSyclKernelBundle functions -----------------------#
212
+
213
+
214
+ def dpctl_kernel_bundle_create_from_spirv (builder : llvmir .IRBuilder , * args ):
215
+ """Inserts LLVM IR to call DPCTLKernelBundle_CreateFromSpirv."""
216
+ mod = builder .module
217
+ fn = _build_dpctl_function (
218
+ llvm_module = mod ,
219
+ return_ty = cgutils .voidptr_t ,
220
+ arg_list = [
221
+ cgutils .voidptr_t ,
222
+ cgutils .voidptr_t ,
223
+ cgutils .voidptr_t ,
224
+ llvmir .IntType (64 ),
225
+ cgutils .voidptr_t ,
226
+ ],
227
+ func_name = "DPCTLKernelBundle_CreateFromSpirv" ,
228
+ )
229
+ ret = builder .call (fn , args )
230
+
231
+ return ret
232
+
233
+
234
+ def dpctl_kernel_bundle_delete (builder : llvmir .IRBuilder , * args ):
235
+ """Inserts LLVM IR to call DPCTLKernelBundle_Delete."""
236
+ mod = builder .module
237
+ fn = _build_dpctl_function (
238
+ llvm_module = mod ,
239
+ return_ty = llvmir .types .VoidType (),
240
+ arg_list = [cgutils .voidptr_t ],
241
+ func_name = "DPCTLKernelBundle_Delete" ,
242
+ )
243
+ ret = builder .call (fn , args )
244
+
245
+ return ret
246
+
247
+
248
+ def dpctl_kernel_bundle_get_kernel (builder : llvmir .IRBuilder , * args ):
249
+ """Inserts LLVM IR to call DPCTLKernelBundle_GetKernel."""
250
+ mod = builder .module
251
+ fn = _build_dpctl_function (
252
+ llvm_module = mod ,
253
+ return_ty = cgutils .voidptr_t ,
254
+ arg_list = [cgutils .voidptr_t , cgutils .voidptr_t ],
255
+ func_name = "DPCTLKernelBundle_GetKernel" ,
256
+ )
257
+ ret = builder .call (fn , args )
258
+
259
+ return ret
260
+
261
+
262
+ # --------------------- DpctlSyclKernel functions -----------------------------#
263
+
264
+
265
+ def dpctl_kernel_delete (builder : llvmir .IRBuilder , * args ):
266
+ """Inserts LLVM IR to call DPCTLKernel_Delete."""
267
+ mod = builder .module
268
+ fn = _build_dpctl_function (
269
+ llvm_module = mod ,
270
+ return_ty = llvmir .types .VoidType (),
271
+ arg_list = [cgutils .voidptr_t ],
272
+ func_name = "DPCTLKernel_Delete" ,
273
+ )
274
+ ret = builder .call (fn , args )
275
+
276
+ return ret
277
+
278
+
279
+ # --------------------- DpctlSyclContext functions ----------------------------#
280
+
281
+
282
+ def dpctl_context_delete (builder : llvmir .IRBuilder , * args ):
283
+ """Inserts LLVM IR to call DPCTLContext_Delete."""
284
+ mod = builder .module
285
+ fn = _build_dpctl_function (
286
+ llvm_module = mod ,
287
+ return_ty = llvmir .types .VoidType (),
288
+ arg_list = [cgutils .voidptr_t ],
289
+ func_name = "DPCTLContext_Delete" ,
290
+ )
291
+ ret = builder .call (fn , args )
292
+
293
+ return ret
294
+
295
+
296
+ # --------------------- DpctlSyclEvent functions ------------------------------#
297
+
298
+
299
+ def dpctl_event_wait (builder : llvmir .IRBuilder , * args ):
300
+ """Inserts LLVM IR to call DPCTLEvent_Wait."""
85
301
mod = builder .module
86
302
fn = _build_dpctl_function (
87
303
llvm_module = mod ,
88
304
return_ty = llvmir .VoidType (),
89
305
arg_list = [cgutils .voidptr_t ],
90
- func_name = "DPCTLEvent_Delete " ,
306
+ func_name = "DPCTLEvent_Wait " ,
91
307
)
92
308
ret = builder .call (fn , args )
93
309
94
310
return ret
95
311
96
312
97
- def dpctl_queue_delete (builder : llvmir .IRBuilder , * args ):
98
- """Inserts LLVM IR to call DPCTLQueue_Delete ."""
313
+ def dpctl_event_delete (builder : llvmir .IRBuilder , * args ):
314
+ """Inserts LLVM IR to call DPCTLEvent_Delete ."""
99
315
mod = builder .module
100
316
fn = _build_dpctl_function (
101
317
llvm_module = mod ,
102
318
return_ty = llvmir .VoidType (),
103
319
arg_list = [cgutils .voidptr_t ],
104
- func_name = "DPCTLQueue_Delete " ,
320
+ func_name = "DPCTLEvent_Delete " ,
105
321
)
106
322
ret = builder .call (fn , args )
107
323
0 commit comments