-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path__init__.py
More file actions
146 lines (135 loc) · 3.44 KB
/
__init__.py
File metadata and controls
146 lines (135 loc) · 3.44 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
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
# Data Parallel Control (dpctl)
#
# Copyright 2020-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.
"""
**Data Parallel Control (dpctl)** is a Python abstraction layer over SYCL.
Dpctl implements a subset of SYCL's API providing wrappers for the
SYCL runtime classes described in :sycl_runtime_classes:`Section 4.6 <>` of
the :sycl_spec_2020:`SYCL 2020 spec <>`.
"""
__author__ = "Intel Corp."
import os
import os.path
from . import _init_helper
from ._device_selection import select_device_with_aspects
from ._sycl_context import SyclContext, SyclContextCreationError
from ._sycl_device import (
SyclDevice,
SyclDeviceCreationError,
SyclSubDeviceCreationError,
)
from ._sycl_device_factory import (
get_composite_devices,
get_devices,
get_num_devices,
has_accelerator_devices,
has_cpu_devices,
has_gpu_devices,
select_accelerator_device,
select_cpu_device,
select_default_device,
select_gpu_device,
)
from ._sycl_event import SyclEvent
from ._sycl_platform import SyclPlatform, get_platforms, lsplatform
from ._sycl_queue import (
LocalAccessor,
RawKernelArg,
SyclKernelInvalidRangeError,
SyclKernelSubmitError,
SyclQueue,
SyclQueueCreationError,
WorkGroupMemory,
)
from ._sycl_queue_manager import get_device_cached_queue
from ._sycl_timer import SyclTimer
from ._version import get_versions
from .enum_types import (
backend_type,
device_type,
event_status_type,
global_mem_cache_type,
)
__all__ = [
"SyclContext",
"SyclContextCreationError",
]
__all__ += [
"SyclDevice",
"SyclDeviceCreationError",
"SyclSubDeviceCreationError",
]
__all__ += [
"get_devices",
"select_accelerator_device",
"select_cpu_device",
"select_default_device",
"select_gpu_device",
"select_host_device",
"select_device_with_aspects",
"get_num_devices",
"has_cpu_devices",
"has_gpu_devices",
"has_accelerator_devices",
"has_host_device",
"get_composite_devices",
]
__all__ += [
"SyclEvent",
"SyclTimer",
]
__all__ += [
"get_platforms",
"lsplatform",
"SyclPlatform",
]
__all__ += [
"SyclQueue",
"SyclKernelInvalidRangeError",
"SyclKernelSubmitError",
"SyclQueueCreationError",
"WorkGroupMemory",
"LocalAccessor",
"RawKernelArg",
]
__all__ += [
"get_device_cached_queue",
]
__all__ += [
"device_type",
"backend_type",
"event_status_type",
"global_mem_cache_type",
]
__all__ += [
"get_include",
]
# add submodules
__all__ += [
"memory",
"program",
"tensor",
"utils",
]
def get_include():
r"""
Return the directory that contains the dpctl \*.h header files.
Extension modules that need to be compiled against dpctl should use
this function to locate the appropriate include directory.
"""
return os.path.join(os.path.dirname(__file__), "include")
__version__ = get_versions()["version"]
del get_versions
del _init_helper