pyopencl 2024.3__cp311-cp311-macosx_10_14_x86_64.whl → 2025.1__cp311-cp311-macosx_10_14_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyopencl might be problematic. Click here for more details.
- pyopencl/_cl.cpython-311-darwin.so +0 -0
- pyopencl/array.py +8 -83
- pyopencl/cltypes.py +2 -2
- pyopencl/version.py +1 -1
- {pyopencl-2024.3.dist-info → pyopencl-2025.1.dist-info}/METADATA +1 -1
- {pyopencl-2024.3.dist-info → pyopencl-2025.1.dist-info}/RECORD +8 -8
- {pyopencl-2024.3.dist-info → pyopencl-2025.1.dist-info}/WHEEL +0 -0
- {pyopencl-2024.3.dist-info → pyopencl-2025.1.dist-info}/licenses/LICENSE +0 -0
|
Binary file
|
pyopencl/array.py
CHANGED
|
@@ -32,7 +32,7 @@ import builtins
|
|
|
32
32
|
from dataclasses import dataclass
|
|
33
33
|
from functools import reduce
|
|
34
34
|
from numbers import Number
|
|
35
|
-
from typing import Any, Dict,
|
|
35
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
36
36
|
from warnings import warn
|
|
37
37
|
|
|
38
38
|
import numpy as np
|
|
@@ -58,20 +58,14 @@ else:
|
|
|
58
58
|
_SVMPointer_or_nothing = ()
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
_NUMPY_PRE_2 = np.__version__.startswith("1.")
|
|
62
|
-
|
|
63
|
-
|
|
64
61
|
# {{{ _get_common_dtype
|
|
65
62
|
|
|
66
|
-
_COMMON_DTYPE_CACHE: Dict[Tuple[Hashable, ...], np.dtype] = {}
|
|
67
|
-
|
|
68
|
-
|
|
69
63
|
class DoubleDowncastWarning(UserWarning):
|
|
70
64
|
pass
|
|
71
65
|
|
|
72
66
|
|
|
73
67
|
_DOUBLE_DOWNCAST_WARNING = (
|
|
74
|
-
"The operation you requested would result in a double-
|
|
68
|
+
"The operation you requested would result in a double-precision "
|
|
75
69
|
"quantity according to numpy semantics. Since your device does not "
|
|
76
70
|
"support double precision, a single-precision quantity is being returned.")
|
|
77
71
|
|
|
@@ -81,78 +75,12 @@ def _get_common_dtype(obj1, obj2, queue):
|
|
|
81
75
|
raise ValueError("PyOpenCL array has no queue; call .with_queue() to "
|
|
82
76
|
"add one in order to be able to perform operations")
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if o1_is_array and o2_is_array:
|
|
90
|
-
o1_dtype = obj1.dtype
|
|
91
|
-
o2_dtype = obj2.dtype
|
|
92
|
-
cache_key = (obj1.dtype, obj2.dtype, allow_double)
|
|
93
|
-
else:
|
|
94
|
-
o1_dtype = getattr(obj1, "dtype", type(obj1))
|
|
95
|
-
o2_dtype = getattr(obj2, "dtype", type(obj2))
|
|
96
|
-
|
|
97
|
-
o1_is_integral = np.issubdtype(o1_dtype, np.integer)
|
|
98
|
-
o2_is_integral = np.issubdtype(o1_dtype, np.integer)
|
|
99
|
-
|
|
100
|
-
o1_key = obj1 if o1_is_integral and not o1_is_array else o1_dtype
|
|
101
|
-
o2_key = obj2 if o2_is_integral and not o2_is_array else o2_dtype
|
|
78
|
+
# Note: We are calling np.result_type with pyopencl arrays here.
|
|
79
|
+
# Luckily, np.result_type only looks at the dtype of input arrays up until
|
|
80
|
+
# at least numpy v2.1.
|
|
81
|
+
result = np.result_type(obj1, obj2)
|
|
102
82
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
try:
|
|
106
|
-
return _COMMON_DTYPE_CACHE[cache_key]
|
|
107
|
-
except KeyError:
|
|
108
|
-
pass
|
|
109
|
-
|
|
110
|
-
# Numpy's behavior around integers is a bit bizarre, and definitely value-
|
|
111
|
-
# and not just type-sensitive when it comes to scalars. We'll just do our
|
|
112
|
-
# best to emulate it.
|
|
113
|
-
#
|
|
114
|
-
# Some samples that are true as of numpy 1.23.1.
|
|
115
|
-
#
|
|
116
|
-
# >>> a = np.zeros(1, dtype=np.int16)
|
|
117
|
-
# >>> (a + 123123123312).dtype
|
|
118
|
-
# dtype('int64')
|
|
119
|
-
# >>> (a + 12312).dtype
|
|
120
|
-
# dtype('int16')
|
|
121
|
-
# >>> (a + 12312444).dtype
|
|
122
|
-
# dtype('int32')
|
|
123
|
-
# >>> (a + np.int32(12312444)).dtype
|
|
124
|
-
# dtype('int32')
|
|
125
|
-
# >>> (a + np.int32(1234)).dtype
|
|
126
|
-
# dtype('int16')
|
|
127
|
-
#
|
|
128
|
-
# Note that np.find_common_type, while appealing, won't be able to tell
|
|
129
|
-
# the full story.
|
|
130
|
-
|
|
131
|
-
if (_NUMPY_PRE_2
|
|
132
|
-
and not (o1_is_array and o2_is_array)
|
|
133
|
-
and o1_is_integral and o2_is_integral):
|
|
134
|
-
if o1_is_array:
|
|
135
|
-
obj1 = np.zeros(1, dtype=o1_dtype)
|
|
136
|
-
if o2_is_array:
|
|
137
|
-
obj2 = np.zeros(1, dtype=o2_dtype)
|
|
138
|
-
|
|
139
|
-
result = (obj1 + obj2).dtype
|
|
140
|
-
else:
|
|
141
|
-
array_types = []
|
|
142
|
-
scalars = []
|
|
143
|
-
|
|
144
|
-
if o1_is_array:
|
|
145
|
-
array_types.append(o1_dtype)
|
|
146
|
-
else:
|
|
147
|
-
scalars.append(obj1)
|
|
148
|
-
if o2_is_array:
|
|
149
|
-
array_types.append(o2_dtype)
|
|
150
|
-
else:
|
|
151
|
-
scalars.append(obj2)
|
|
152
|
-
|
|
153
|
-
result = np.result_type(*array_types, *scalars)
|
|
154
|
-
|
|
155
|
-
if not allow_double:
|
|
83
|
+
if not has_double_support(queue.device):
|
|
156
84
|
if result == np.float64:
|
|
157
85
|
result = np.dtype(np.float32)
|
|
158
86
|
warn(_DOUBLE_DOWNCAST_WARNING, DoubleDowncastWarning, stacklevel=3)
|
|
@@ -160,9 +88,6 @@ def _get_common_dtype(obj1, obj2, queue):
|
|
|
160
88
|
result = np.dtype(np.complex64)
|
|
161
89
|
warn(_DOUBLE_DOWNCAST_WARNING, DoubleDowncastWarning, stacklevel=3)
|
|
162
90
|
|
|
163
|
-
if cache_key is not None:
|
|
164
|
-
_COMMON_DTYPE_CACHE[cache_key] = result
|
|
165
|
-
|
|
166
91
|
return result
|
|
167
92
|
|
|
168
93
|
# }}}
|
|
@@ -2518,7 +2443,7 @@ def arange(queue, *args, **kwargs):
|
|
|
2518
2443
|
raise TypeError("arange requires a dtype argument")
|
|
2519
2444
|
|
|
2520
2445
|
from math import ceil
|
|
2521
|
-
size =
|
|
2446
|
+
size = ceil((stop-start)/step)
|
|
2522
2447
|
|
|
2523
2448
|
result = Array(queue, (size,), dtype, allocator=inf.allocator)
|
|
2524
2449
|
result.add_event(_arange_knl(result, start, step, queue=queue))
|
pyopencl/cltypes.py
CHANGED
|
@@ -50,7 +50,7 @@ double = np.float64
|
|
|
50
50
|
# {{{ vector types
|
|
51
51
|
|
|
52
52
|
def _create_vector_types():
|
|
53
|
-
|
|
53
|
+
mapping = [(k, globals()[k]) for k in
|
|
54
54
|
["char", "uchar", "short", "ushort", "int",
|
|
55
55
|
"uint", "long", "ulong", "float", "double"]]
|
|
56
56
|
|
|
@@ -64,7 +64,7 @@ def _create_vector_types():
|
|
|
64
64
|
|
|
65
65
|
counts = [2, 3, 4, 8, 16]
|
|
66
66
|
|
|
67
|
-
for base_name, base_type in
|
|
67
|
+
for base_name, base_type in mapping:
|
|
68
68
|
for count in counts:
|
|
69
69
|
name = "%s%d" % (base_name, count)
|
|
70
70
|
|
pyopencl/version.py
CHANGED
|
@@ -3,7 +3,7 @@ from importlib import metadata
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
VERSION_TEXT = metadata.version("pyopencl")
|
|
6
|
-
_match = re.match("^([0-9.]+)([a-z0-9]*?)$", VERSION_TEXT)
|
|
6
|
+
_match = re.match(r"^([0-9.]+)([a-z0-9]*?)$", VERSION_TEXT)
|
|
7
7
|
assert _match is not None
|
|
8
8
|
VERSION_STATUS = _match.group(2)
|
|
9
9
|
VERSION = tuple(int(nr) for nr in _match.group(1).split("."))
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
pyopencl/algorithm.py,sha256=8qqD_GqvuQguSCDWcrJCeA05xFMj8mpJH1y5O0tUqmM,51293
|
|
2
2
|
pyopencl/clmath.py,sha256=lOxQzE6BEp5-nVRuGu0hgxzk_gcx7aTiy_hRFxAPmcI,8222
|
|
3
|
-
pyopencl/version.py,sha256=
|
|
3
|
+
pyopencl/version.py,sha256=k4ev2_LuJAomsl8CUq1IHcINH3DUnLqTuGkf5q-ua10,268
|
|
4
4
|
pyopencl/capture_call.py,sha256=B2d4SkPrj4f8j5jLDmKHSmSLxK0k9646gKL2FYZkejQ,5694
|
|
5
5
|
pyopencl/reduction.py,sha256=CrWJPDYNy4hxtCGgwq2fkWAQXjJ8zMLxV5CEbAh3Wb8,25533
|
|
6
6
|
pyopencl/tools.py,sha256=eZdKtkwY34kPbMR9FuFAmQbDQG8vJdv1az_UPiGNxjE,45940
|
|
7
7
|
pyopencl/elementwise.py,sha256=HxSSpC944TeJkok8LGeNjqRgfKucbjpLEw3IoGOqLGc,38625
|
|
8
8
|
pyopencl/cache.py,sha256=EbTTIxXmrdcgjzqWQl7O_1EG1RqniHg5sjJQS_5LXIs,16000
|
|
9
9
|
pyopencl/__init__.py,sha256=BDkk5adIO4tHSYxxx_O7W4cyTHALwJB1aPpX5BrKep8,81443
|
|
10
|
-
pyopencl/cltypes.py,sha256=
|
|
10
|
+
pyopencl/cltypes.py,sha256=Pkr7_oTkQhVHP-1JyfIWiE8ORpkQ3molOL986Sodvl0,4816
|
|
11
11
|
pyopencl/invoker.py,sha256=hL5qMYOJpXEh2X1xbkkDaoYWRXgP-9fISY0N5VtL--8,14060
|
|
12
12
|
pyopencl/ipython_ext.py,sha256=TUgxJa_w7tvXaKj6kPjiXNEKlxrwsJScQCD0khAA1kk,1915
|
|
13
13
|
pyopencl/scan.py,sha256=Z4Ew6NE0VRNhxPItM4M8oCtPdif0yCclW-CcsFqScu0,65638
|
|
14
14
|
pyopencl/_cluda.py,sha256=KKUxizD1iQEuZ_TmmFZNJ8IdXa8x8uT9HgB0nmAlYLw,2074
|
|
15
|
-
pyopencl/_cl.cpython-311-darwin.so,sha256=
|
|
15
|
+
pyopencl/_cl.cpython-311-darwin.so,sha256=ZQ41WkNNDQXY9oFcjEKqtKUBRP2H32HTQEYxKP_g3dY,552120
|
|
16
16
|
pyopencl/_mymako.py,sha256=WzmwJ-9EyenDo6RNOcXZmVum886PsmPS2gLNmUBORsA,620
|
|
17
|
-
pyopencl/array.py,sha256=
|
|
17
|
+
pyopencl/array.py,sha256=tENUt-t3tso0LjQS4o6s2nXFwIOxzazOeTS3V-YpN2M,109612
|
|
18
18
|
pyopencl/bitonic_sort.py,sha256=cHd7PHX0arDGJbhaB7AJVI9THVJE69lGuGiB08zeZJ0,8021
|
|
19
19
|
pyopencl/bitonic_sort_templates.py,sha256=x2hJaR-9AO74C_X7bVTTSxQxGqoDrF2-nQxzmMCSCXs,16151
|
|
20
20
|
pyopencl/clrandom.py,sha256=BciZJkcKaNzmqP8tfGdb5SPI4qMACSUtLbQTJaOT5kE,13044
|
|
@@ -36,7 +36,7 @@ pyopencl/cl/pyopencl-random123/threefry.cl,sha256=2WmQGxx5gPSv22UL9_MlXv0eMug91k
|
|
|
36
36
|
pyopencl/cl/pyopencl-random123/philox.cl,sha256=vYcQH7Vw13Q3qkW5Nhy1HTUDbWLGKoloE1YP0VWk6vU,21740
|
|
37
37
|
pyopencl/cl/pyopencl-random123/array.h,sha256=nIV0zDWYuybldNgtsh79icNtDXHYdDsSpFaWIvDTyw4,17088
|
|
38
38
|
pyopencl/cl/pyopencl-random123/openclfeatures.h,sha256=pAPbl7JkQgJxulSuGGevpaI43P7PwiH2mYxtNfHq59M,2881
|
|
39
|
-
pyopencl-
|
|
40
|
-
pyopencl-
|
|
41
|
-
pyopencl-
|
|
42
|
-
pyopencl-
|
|
39
|
+
pyopencl-2025.1.dist-info/RECORD,,
|
|
40
|
+
pyopencl-2025.1.dist-info/WHEEL,sha256=KEGFkeKhpIXnpo3O52Lh8ueC3-31r69536bUTFfcapU,116
|
|
41
|
+
pyopencl-2025.1.dist-info/METADATA,sha256=WUY6JEb89dxhMwOVvX9OJVBYPqzlqPNt1TypeIxsCkQ,4783
|
|
42
|
+
pyopencl-2025.1.dist-info/licenses/LICENSE,sha256=wiBvs-UC54bB5DswWuvB66B96b4hkYw_VLt8IR0cBPI,15284
|
|
File without changes
|
|
File without changes
|