-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathsycl.pxd
More file actions
87 lines (70 loc) · 2.89 KB
/
sycl.pxd
File metadata and controls
87 lines (70 loc) · 2.89 KB
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
# Copyright 2022-2025 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# distutils: language = c++
# cython: language_level=3
# SYCL static imports for Cython
from . cimport _backend as dpctl_backend
cdef extern from "sycl/sycl.hpp" namespace "sycl":
cdef cppclass queue "sycl::queue":
void wait() nogil
pass
cdef cppclass device "sycl::device":
pass
cdef cppclass context "sycl::context":
pass
cdef cppclass event "sycl::event":
void wait() nogil
pass
cdef cppclass kernel "sycl::kernel":
pass
cdef cppclass executable_kernel_bundle \
"sycl::kernel_bundle<sycl::bundle_state::executable>":
pass
cdef extern from "syclinterface/dpctl_sycl_extension_interface.h":
cdef struct RawWorkGroupMemoryTy
ctypedef RawWorkGroupMemoryTy RawWorkGroupMemory
cdef extern from "syclinterface/dpctl_sycl_type_casters.hpp" \
namespace "dpctl::syclinterface":
# queue
cdef dpctl_backend.DPCTLSyclQueueRef wrap_queue \
"dpctl::syclinterface::wrap<sycl::queue>" (const queue *)
cdef queue * unwrap_queue "dpctl::syclinterface::unwrap<sycl::queue>" (
dpctl_backend.DPCTLSyclQueueRef)
# device
cdef dpctl_backend.DPCTLSyclDeviceRef wrap_device \
"dpctl::syclinterface::wrap<sycl::device>" (const device *)
cdef device * unwrap_device "dpctl::syclinterface::unwrap<sycl::device>" (
dpctl_backend.DPCTLSyclDeviceRef)
# context
cdef dpctl_backend.DPCTLSyclContextRef wrap_context \
"dpctl::syclinterface::wrap<sycl::context>" (const context *)
cdef context * unwrap_context \
"dpctl::syclinterface::unwrap<sycl::context>" (
dpctl_backend.DPCTLSyclContextRef
)
# event
cdef dpctl_backend.DPCTLSyclEventRef wrap_event \
"dpctl::syclinterface::wrap<sycl::event>" (const event *)
cdef event * unwrap_event \
"dpctl::syclinterface::unwrap<sycl::event>" (
dpctl_backend.DPCTLSyclEventRef
)
# work group memory extension
cdef dpctl_backend.DPCTLSyclWorkGroupMemoryRef wrap_work_group_memory \
"dpctl::syclinterface::wrap<RawWorkGroupMemory>" \
(const RawWorkGroupMemory *)
cdef RawWorkGroupMemory * unwrap_work_group_memory \
"dpctl::syclinterface::unwrap<RawWorkGroupMemory>" (
dpctl_backend.DPCTLSyclWorkGroupMemoryRef
)