numba-cuda 0.0.16__py3-none-any.whl → 0.0.17.1__py3-none-any.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.
- _numba_cuda_redirector.py +9 -3
- numba_cuda/VERSION +1 -1
- numba_cuda/numba/cuda/printimpl.py +11 -0
- numba_cuda/numba/cuda/tests/cudapy/test_print.py +20 -0
- {numba_cuda-0.0.16.dist-info → numba_cuda-0.0.17.1.dist-info}/METADATA +1 -1
- {numba_cuda-0.0.16.dist-info → numba_cuda-0.0.17.1.dist-info}/RECORD +9 -9
- {numba_cuda-0.0.16.dist-info → numba_cuda-0.0.17.1.dist-info}/WHEEL +1 -1
- {numba_cuda-0.0.16.dist-info → numba_cuda-0.0.17.1.dist-info}/LICENSE +0 -0
- {numba_cuda-0.0.16.dist-info → numba_cuda-0.0.17.1.dist-info}/top_level.txt +0 -0
_numba_cuda_redirector.py
CHANGED
@@ -67,9 +67,15 @@ class NumbaCudaFinder(importlib.abc.MetaPathFinder):
|
|
67
67
|
oot_path = [p.replace(self.numba_path, self.numba_cuda_path)
|
68
68
|
for p in path]
|
69
69
|
for finder in sys.meta_path:
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
try:
|
71
|
+
spec = finder.find_spec(name, oot_path, target)
|
72
|
+
except AttributeError:
|
73
|
+
# Finders written to a pre-Python 3.4 spec for finders will
|
74
|
+
# not implement find_spec. We can skip those altogether.
|
75
|
+
continue
|
76
|
+
else:
|
77
|
+
if spec is not None:
|
78
|
+
return spec
|
73
79
|
|
74
80
|
|
75
81
|
finder = NumbaCudaFinder()
|
numba_cuda/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.17.1
|
@@ -63,6 +63,17 @@ def dim3_print_impl(ty, context, builder, val):
|
|
63
63
|
return rawfmt, [x, y, z]
|
64
64
|
|
65
65
|
|
66
|
+
@print_item.register(types.Boolean)
|
67
|
+
def bool_print_impl(ty, context, builder, val):
|
68
|
+
true_string = context.insert_string_const_addrspace(builder, "True")
|
69
|
+
false_string = context.insert_string_const_addrspace(builder, "False")
|
70
|
+
res_ptr = cgutils.alloca_once_value(builder, false_string)
|
71
|
+
with builder.if_then(val):
|
72
|
+
builder.store(true_string, res_ptr)
|
73
|
+
rawfmt = "%s"
|
74
|
+
return rawfmt, [builder.load(res_ptr)]
|
75
|
+
|
76
|
+
|
66
77
|
@lower(print, types.VarArg(types.Any))
|
67
78
|
def print_varargs(context, builder, sig, args):
|
68
79
|
"""This function is a generic 'print' wrapper for arbitrary types.
|
@@ -32,6 +32,21 @@ cuda.synchronize()
|
|
32
32
|
"""
|
33
33
|
|
34
34
|
|
35
|
+
printbool_usecase = """\
|
36
|
+
from numba import cuda
|
37
|
+
|
38
|
+
@cuda.jit
|
39
|
+
def printbool(x):
|
40
|
+
print(True)
|
41
|
+
print(False)
|
42
|
+
print(x == 0)
|
43
|
+
|
44
|
+
printbool[1, 1](0)
|
45
|
+
printbool[1, 1](1)
|
46
|
+
cuda.synchronize()
|
47
|
+
"""
|
48
|
+
|
49
|
+
|
35
50
|
printstring_usecase = """\
|
36
51
|
from numba import cuda
|
37
52
|
|
@@ -109,6 +124,11 @@ class TestPrint(CUDATestCase):
|
|
109
124
|
expected_cases = ["0 23 34.750000 321", "0 23 34.75 321"]
|
110
125
|
self.assertIn(output.strip(), expected_cases)
|
111
126
|
|
127
|
+
def test_bool(self):
|
128
|
+
output, _ = self.run_code(printbool_usecase)
|
129
|
+
expected = "True\nFalse\nTrue\nTrue\nFalse\nFalse"
|
130
|
+
self.assertEqual(output.strip(), expected)
|
131
|
+
|
112
132
|
def test_printempty(self):
|
113
133
|
output, _ = self.run_code(printempty_usecase)
|
114
134
|
self.assertEqual(output.strip(), "")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
_numba_cuda_redirector.pth,sha256=cmfMMmV0JPh3yEpl4bGeM9AuXiVVMSo6Z_b7RaQL3XE,30
|
2
|
-
_numba_cuda_redirector.py,sha256=
|
3
|
-
numba_cuda/VERSION,sha256=
|
2
|
+
_numba_cuda_redirector.py,sha256=QKJmYICSQvjvph0Zw9OW015MsuKxIF28GPFjR35AXLM,2681
|
3
|
+
numba_cuda/VERSION,sha256=6FCxgDgZBaWXSrJJXsqWQEsixHPQbo-d1U4n83DSH7g,9
|
4
4
|
numba_cuda/__init__.py,sha256=atXeUvJKR3JHcAiCFbXCVOJQUHgB1TulmsqSL_9RT3Q,114
|
5
5
|
numba_cuda/_version.py,sha256=jbdUsbR7sVllw0KxQNB0-FMd929CGg3kH2fhHdrlkuc,719
|
6
6
|
numba_cuda/numba/cuda/__init__.py,sha256=idyVHOObC9lTYnp62v7rVprSacRM4d5F6vhXfG5ElTI,621
|
@@ -34,7 +34,7 @@ numba_cuda/numba/cuda/libdeviceimpl.py,sha256=a9BmJ5kRtZ_mB7KjbDWW-PEpRuNiO_SMOx
|
|
34
34
|
numba_cuda/numba/cuda/mathimpl.py,sha256=d_gCoQ4hJzNBFNc2hvRON5h1F052epgQ8zh_RKTlLlI,14416
|
35
35
|
numba_cuda/numba/cuda/models.py,sha256=2c_seT-cWX-VyWYmcapaqOEl1M4FX6_kdIOusj4s5aE,1328
|
36
36
|
numba_cuda/numba/cuda/nvvmutils.py,sha256=W1zr1TpnmFjTkHF0qeu5wnBHub6gzrnpzsvgmu2OLcU,8295
|
37
|
-
numba_cuda/numba/cuda/printimpl.py,sha256=
|
37
|
+
numba_cuda/numba/cuda/printimpl.py,sha256=Y1BCQ7EgO2wQ7O6LibNVYBG3tmjVTvmURATW403rLao,3504
|
38
38
|
numba_cuda/numba/cuda/random.py,sha256=khX8iDdde_RTUPWhAqrxZacHRQAorFr7BokPuxRWzrg,10456
|
39
39
|
numba_cuda/numba/cuda/simulator_init.py,sha256=W_bPRtmPGOQVuiprbgt7ENnnnELv_LPCeLDIsfsvFZ8,460
|
40
40
|
numba_cuda/numba/cuda/stubs.py,sha256=W3tozv4ganMnfbdFqyPjgQXYeX8GQhwx_xXgv8jk6iM,22270
|
@@ -172,7 +172,7 @@ numba_cuda/numba/cuda/tests/cudapy/test_operator.py,sha256=0nJej4D898_JU-jhlif44
|
|
172
172
|
numba_cuda/numba/cuda/tests/cudapy/test_optimization.py,sha256=SvqRsSFgcGxkFDZS-kul5B-mi8GxINTS98uUzAy4dhw,2647
|
173
173
|
numba_cuda/numba/cuda/tests/cudapy/test_overload.py,sha256=u4yUDVFcV9E3NWMlNjM81e3IW4KaIkcDtXig8JYevsw,8538
|
174
174
|
numba_cuda/numba/cuda/tests/cudapy/test_powi.py,sha256=TI82rYRnkSnwv9VN6PMpBnr9JqMJ_F3HhH4cKY6O8tw,3276
|
175
|
-
numba_cuda/numba/cuda/tests/cudapy/test_print.py,sha256
|
175
|
+
numba_cuda/numba/cuda/tests/cudapy/test_print.py,sha256=QXhhhnEz1d5BlldLINQVnmuHeM_dT3aLvfGS7jm24nE,4451
|
176
176
|
numba_cuda/numba/cuda/tests/cudapy/test_py2_div_issue.py,sha256=R88Vfgg3mSAZ0Jy6WT6dJNmkFTsxnVnEmO7XqpqyxuU,986
|
177
177
|
numba_cuda/numba/cuda/tests/cudapy/test_random.py,sha256=rLw7_8a7BBhD_8GNqMal0l_AbWXzLs_Q0hC6_X8gdjA,3467
|
178
178
|
numba_cuda/numba/cuda/tests/cudapy/test_record_dtype.py,sha256=grR64kdRlsLcR0K3IxSfI2VKsTrrqxsXuROOpvj-6nw,18769
|
@@ -224,8 +224,8 @@ numba_cuda/numba/cuda/tests/nocuda/test_function_resolution.py,sha256=o4DYocyHK7
|
|
224
224
|
numba_cuda/numba/cuda/tests/nocuda/test_import.py,sha256=teiL8rpFGQOh41kyBSSNHHFYAJYgpdStXkTcpK4_fxo,1641
|
225
225
|
numba_cuda/numba/cuda/tests/nocuda/test_library_lookup.py,sha256=7kJOPHEcrjy_kTA9Ym-iT_B972bgFRu3UkRtwIgWtuI,7948
|
226
226
|
numba_cuda/numba/cuda/tests/nocuda/test_nvvm.py,sha256=n0_-xFaw6QqiZbhe55oy7lnEeOwqTvA55p5EUFiTpNw,2006
|
227
|
-
numba_cuda-0.0.
|
228
|
-
numba_cuda-0.0.
|
229
|
-
numba_cuda-0.0.
|
230
|
-
numba_cuda-0.0.
|
231
|
-
numba_cuda-0.0.
|
227
|
+
numba_cuda-0.0.17.1.dist-info/LICENSE,sha256=eHeYE-XjASmwbxfsP5AImgfzRwZurZGqH1f6OFwJ4io,1326
|
228
|
+
numba_cuda-0.0.17.1.dist-info/METADATA,sha256=G8bWlMk6jnn9gsU_Bo0WTDlG3EvU4ODk54tLQC9Rrq0,1395
|
229
|
+
numba_cuda-0.0.17.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
230
|
+
numba_cuda-0.0.17.1.dist-info/top_level.txt,sha256=C50SsH-8tXDmt7I0Y3nlJYhS5s6pqWflCPdobe9vx2M,11
|
231
|
+
numba_cuda-0.0.17.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|