numba-cuda 0.8.0__py3-none-any.whl → 0.9.0__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.
Files changed (227) hide show
  1. _numba_cuda_redirector.py +17 -13
  2. numba_cuda/VERSION +1 -1
  3. numba_cuda/_version.py +4 -1
  4. numba_cuda/numba/cuda/__init__.py +6 -2
  5. numba_cuda/numba/cuda/api.py +129 -86
  6. numba_cuda/numba/cuda/api_util.py +3 -3
  7. numba_cuda/numba/cuda/args.py +12 -16
  8. numba_cuda/numba/cuda/cg.py +6 -6
  9. numba_cuda/numba/cuda/codegen.py +74 -43
  10. numba_cuda/numba/cuda/compiler.py +232 -113
  11. numba_cuda/numba/cuda/cpp_function_wrappers.cu +1 -2
  12. numba_cuda/numba/cuda/cuda_fp16.h +661 -661
  13. numba_cuda/numba/cuda/cuda_fp16.hpp +3 -3
  14. numba_cuda/numba/cuda/cuda_paths.py +291 -99
  15. numba_cuda/numba/cuda/cudadecl.py +125 -69
  16. numba_cuda/numba/cuda/cudadrv/__init__.py +3 -1
  17. numba_cuda/numba/cuda/cudadrv/devicearray.py +185 -135
  18. numba_cuda/numba/cuda/cudadrv/devices.py +16 -11
  19. numba_cuda/numba/cuda/cudadrv/driver.py +463 -297
  20. numba_cuda/numba/cuda/cudadrv/drvapi.py +241 -207
  21. numba_cuda/numba/cuda/cudadrv/dummyarray.py +66 -54
  22. numba_cuda/numba/cuda/cudadrv/enums.py +1 -1
  23. numba_cuda/numba/cuda/cudadrv/error.py +6 -2
  24. numba_cuda/numba/cuda/cudadrv/libs.py +67 -63
  25. numba_cuda/numba/cuda/cudadrv/linkable_code.py +16 -1
  26. numba_cuda/numba/cuda/cudadrv/mappings.py +16 -14
  27. numba_cuda/numba/cuda/cudadrv/nvrtc.py +138 -29
  28. numba_cuda/numba/cuda/cudadrv/nvvm.py +296 -161
  29. numba_cuda/numba/cuda/cudadrv/rtapi.py +1 -1
  30. numba_cuda/numba/cuda/cudadrv/runtime.py +20 -8
  31. numba_cuda/numba/cuda/cudaimpl.py +317 -233
  32. numba_cuda/numba/cuda/cudamath.py +1 -1
  33. numba_cuda/numba/cuda/debuginfo.py +8 -6
  34. numba_cuda/numba/cuda/decorators.py +75 -45
  35. numba_cuda/numba/cuda/descriptor.py +1 -1
  36. numba_cuda/numba/cuda/device_init.py +69 -18
  37. numba_cuda/numba/cuda/deviceufunc.py +143 -98
  38. numba_cuda/numba/cuda/dispatcher.py +300 -213
  39. numba_cuda/numba/cuda/errors.py +13 -10
  40. numba_cuda/numba/cuda/extending.py +1 -1
  41. numba_cuda/numba/cuda/initialize.py +5 -3
  42. numba_cuda/numba/cuda/intrinsic_wrapper.py +3 -3
  43. numba_cuda/numba/cuda/intrinsics.py +31 -27
  44. numba_cuda/numba/cuda/kernels/reduction.py +13 -13
  45. numba_cuda/numba/cuda/kernels/transpose.py +3 -6
  46. numba_cuda/numba/cuda/libdevice.py +317 -317
  47. numba_cuda/numba/cuda/libdeviceimpl.py +3 -2
  48. numba_cuda/numba/cuda/locks.py +16 -0
  49. numba_cuda/numba/cuda/mathimpl.py +62 -57
  50. numba_cuda/numba/cuda/models.py +1 -5
  51. numba_cuda/numba/cuda/nvvmutils.py +103 -88
  52. numba_cuda/numba/cuda/printimpl.py +9 -5
  53. numba_cuda/numba/cuda/random.py +46 -36
  54. numba_cuda/numba/cuda/reshape_funcs.cu +1 -1
  55. numba_cuda/numba/cuda/runtime/__init__.py +1 -1
  56. numba_cuda/numba/cuda/runtime/memsys.cu +1 -1
  57. numba_cuda/numba/cuda/runtime/memsys.cuh +1 -1
  58. numba_cuda/numba/cuda/runtime/nrt.cu +3 -3
  59. numba_cuda/numba/cuda/runtime/nrt.py +48 -43
  60. numba_cuda/numba/cuda/simulator/__init__.py +22 -12
  61. numba_cuda/numba/cuda/simulator/api.py +38 -22
  62. numba_cuda/numba/cuda/simulator/compiler.py +2 -2
  63. numba_cuda/numba/cuda/simulator/cudadrv/__init__.py +8 -2
  64. numba_cuda/numba/cuda/simulator/cudadrv/devicearray.py +63 -55
  65. numba_cuda/numba/cuda/simulator/cudadrv/devices.py +13 -11
  66. numba_cuda/numba/cuda/simulator/cudadrv/driver.py +5 -5
  67. numba_cuda/numba/cuda/simulator/cudadrv/drvapi.py +2 -2
  68. numba_cuda/numba/cuda/simulator/cudadrv/libs.py +1 -1
  69. numba_cuda/numba/cuda/simulator/cudadrv/nvvm.py +3 -3
  70. numba_cuda/numba/cuda/simulator/cudadrv/runtime.py +3 -3
  71. numba_cuda/numba/cuda/simulator/kernel.py +43 -34
  72. numba_cuda/numba/cuda/simulator/kernelapi.py +31 -26
  73. numba_cuda/numba/cuda/simulator/reduction.py +1 -0
  74. numba_cuda/numba/cuda/simulator/vector_types.py +13 -9
  75. numba_cuda/numba/cuda/simulator_init.py +2 -4
  76. numba_cuda/numba/cuda/stubs.py +139 -102
  77. numba_cuda/numba/cuda/target.py +64 -47
  78. numba_cuda/numba/cuda/testing.py +24 -19
  79. numba_cuda/numba/cuda/tests/__init__.py +14 -12
  80. numba_cuda/numba/cuda/tests/cudadrv/test_array_attr.py +16 -17
  81. numba_cuda/numba/cuda/tests/cudadrv/test_context_stack.py +7 -7
  82. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_array_slicing.py +73 -54
  83. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_auto_context.py +1 -1
  84. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_devicerecord.py +48 -50
  85. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_driver.py +47 -29
  86. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_libraries.py +3 -3
  87. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_memory.py +19 -19
  88. numba_cuda/numba/cuda/tests/cudadrv/test_cuda_ndarray.py +108 -103
  89. numba_cuda/numba/cuda/tests/cudadrv/test_deallocations.py +20 -11
  90. numba_cuda/numba/cuda/tests/cudadrv/test_detect.py +20 -17
  91. numba_cuda/numba/cuda/tests/cudadrv/test_emm_plugins.py +8 -6
  92. numba_cuda/numba/cuda/tests/cudadrv/test_events.py +1 -1
  93. numba_cuda/numba/cuda/tests/cudadrv/test_host_alloc.py +8 -7
  94. numba_cuda/numba/cuda/tests/cudadrv/test_init.py +13 -13
  95. numba_cuda/numba/cuda/tests/cudadrv/test_inline_ptx.py +12 -9
  96. numba_cuda/numba/cuda/tests/cudadrv/test_linker.py +36 -31
  97. numba_cuda/numba/cuda/tests/cudadrv/test_managed_alloc.py +8 -7
  98. numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +294 -0
  99. numba_cuda/numba/cuda/tests/cudadrv/test_mvc.py +10 -7
  100. numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py +24 -15
  101. numba_cuda/numba/cuda/tests/cudadrv/test_nvvm_driver.py +43 -41
  102. numba_cuda/numba/cuda/tests/cudadrv/test_pinned.py +4 -5
  103. numba_cuda/numba/cuda/tests/cudadrv/test_profiler.py +2 -2
  104. numba_cuda/numba/cuda/tests/cudadrv/test_ptds.py +28 -17
  105. numba_cuda/numba/cuda/tests/cudadrv/test_reset_device.py +1 -2
  106. numba_cuda/numba/cuda/tests/cudadrv/test_runtime.py +22 -14
  107. numba_cuda/numba/cuda/tests/cudadrv/test_select_device.py +1 -1
  108. numba_cuda/numba/cuda/tests/cudadrv/test_streams.py +4 -3
  109. numba_cuda/numba/cuda/tests/cudapy/cache_usecases.py +10 -4
  110. numba_cuda/numba/cuda/tests/cudapy/cache_with_cpu_usecases.py +1 -0
  111. numba_cuda/numba/cuda/tests/cudapy/extensions_usecases.py +7 -6
  112. numba_cuda/numba/cuda/tests/cudapy/jitlink.ptx +0 -2
  113. numba_cuda/numba/cuda/tests/cudapy/recursion_usecases.py +1 -0
  114. numba_cuda/numba/cuda/tests/cudapy/test_alignment.py +6 -5
  115. numba_cuda/numba/cuda/tests/cudapy/test_array.py +52 -42
  116. numba_cuda/numba/cuda/tests/cudapy/test_array_args.py +5 -6
  117. numba_cuda/numba/cuda/tests/cudapy/test_array_methods.py +1 -1
  118. numba_cuda/numba/cuda/tests/cudapy/test_atomics.py +501 -304
  119. numba_cuda/numba/cuda/tests/cudapy/test_blackscholes.py +57 -21
  120. numba_cuda/numba/cuda/tests/cudapy/test_boolean.py +3 -3
  121. numba_cuda/numba/cuda/tests/cudapy/test_caching.py +50 -37
  122. numba_cuda/numba/cuda/tests/cudapy/test_casting.py +29 -24
  123. numba_cuda/numba/cuda/tests/cudapy/test_cffi.py +11 -6
  124. numba_cuda/numba/cuda/tests/cudapy/test_compiler.py +84 -50
  125. numba_cuda/numba/cuda/tests/cudapy/test_complex.py +144 -73
  126. numba_cuda/numba/cuda/tests/cudapy/test_complex_kernel.py +2 -2
  127. numba_cuda/numba/cuda/tests/cudapy/test_const_string.py +37 -27
  128. numba_cuda/numba/cuda/tests/cudapy/test_constmem.py +43 -45
  129. numba_cuda/numba/cuda/tests/cudapy/test_cooperative_groups.py +21 -14
  130. numba_cuda/numba/cuda/tests/cudapy/test_cuda_array_interface.py +60 -55
  131. numba_cuda/numba/cuda/tests/cudapy/test_cuda_jit_no_types.py +3 -2
  132. numba_cuda/numba/cuda/tests/cudapy/test_datetime.py +26 -22
  133. numba_cuda/numba/cuda/tests/cudapy/test_debug.py +29 -27
  134. numba_cuda/numba/cuda/tests/cudapy/test_debuginfo.py +31 -28
  135. numba_cuda/numba/cuda/tests/cudapy/test_device_func.py +52 -45
  136. numba_cuda/numba/cuda/tests/cudapy/test_dispatcher.py +55 -43
  137. numba_cuda/numba/cuda/tests/cudapy/test_enums.py +6 -7
  138. numba_cuda/numba/cuda/tests/cudapy/test_errors.py +30 -15
  139. numba_cuda/numba/cuda/tests/cudapy/test_exception.py +11 -12
  140. numba_cuda/numba/cuda/tests/cudapy/test_extending.py +19 -12
  141. numba_cuda/numba/cuda/tests/cudapy/test_fastmath.py +77 -66
  142. numba_cuda/numba/cuda/tests/cudapy/test_forall.py +5 -3
  143. numba_cuda/numba/cuda/tests/cudapy/test_freevar.py +5 -3
  144. numba_cuda/numba/cuda/tests/cudapy/test_frexp_ldexp.py +1 -1
  145. numba_cuda/numba/cuda/tests/cudapy/test_globals.py +3 -5
  146. numba_cuda/numba/cuda/tests/cudapy/test_gufunc.py +144 -126
  147. numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scalar.py +23 -18
  148. numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scheduling.py +16 -22
  149. numba_cuda/numba/cuda/tests/cudapy/test_idiv.py +1 -3
  150. numba_cuda/numba/cuda/tests/cudapy/test_inspect.py +29 -20
  151. numba_cuda/numba/cuda/tests/cudapy/test_intrinsics.py +147 -99
  152. numba_cuda/numba/cuda/tests/cudapy/test_ipc.py +50 -36
  153. numba_cuda/numba/cuda/tests/cudapy/test_iterators.py +1 -2
  154. numba_cuda/numba/cuda/tests/cudapy/test_lang.py +4 -4
  155. numba_cuda/numba/cuda/tests/cudapy/test_laplace.py +6 -6
  156. numba_cuda/numba/cuda/tests/cudapy/test_libdevice.py +24 -20
  157. numba_cuda/numba/cuda/tests/cudapy/test_lineinfo.py +36 -31
  158. numba_cuda/numba/cuda/tests/cudapy/test_localmem.py +13 -13
  159. numba_cuda/numba/cuda/tests/cudapy/test_mandel.py +13 -6
  160. numba_cuda/numba/cuda/tests/cudapy/test_math.py +83 -66
  161. numba_cuda/numba/cuda/tests/cudapy/test_matmul.py +1 -3
  162. numba_cuda/numba/cuda/tests/cudapy/test_minmax.py +19 -58
  163. numba_cuda/numba/cuda/tests/cudapy/test_montecarlo.py +4 -4
  164. numba_cuda/numba/cuda/tests/cudapy/test_multigpu.py +9 -7
  165. numba_cuda/numba/cuda/tests/cudapy/test_multiprocessing.py +9 -8
  166. numba_cuda/numba/cuda/tests/cudapy/test_multithreads.py +12 -10
  167. numba_cuda/numba/cuda/tests/cudapy/test_nondet.py +1 -1
  168. numba_cuda/numba/cuda/tests/cudapy/test_operator.py +180 -96
  169. numba_cuda/numba/cuda/tests/cudapy/test_optimization.py +5 -5
  170. numba_cuda/numba/cuda/tests/cudapy/test_overload.py +37 -18
  171. numba_cuda/numba/cuda/tests/cudapy/test_powi.py +7 -7
  172. numba_cuda/numba/cuda/tests/cudapy/test_print.py +9 -7
  173. numba_cuda/numba/cuda/tests/cudapy/test_py2_div_issue.py +1 -1
  174. numba_cuda/numba/cuda/tests/cudapy/test_random.py +15 -10
  175. numba_cuda/numba/cuda/tests/cudapy/test_record_dtype.py +88 -87
  176. numba_cuda/numba/cuda/tests/cudapy/test_recursion.py +12 -10
  177. numba_cuda/numba/cuda/tests/cudapy/test_reduction.py +26 -11
  178. numba_cuda/numba/cuda/tests/cudapy/test_retrieve_autoconverted_arrays.py +7 -10
  179. numba_cuda/numba/cuda/tests/cudapy/test_serialize.py +4 -6
  180. numba_cuda/numba/cuda/tests/cudapy/test_slicing.py +1 -1
  181. numba_cuda/numba/cuda/tests/cudapy/test_sm.py +10 -9
  182. numba_cuda/numba/cuda/tests/cudapy/test_sm_creation.py +62 -43
  183. numba_cuda/numba/cuda/tests/cudapy/test_stream_api.py +7 -3
  184. numba_cuda/numba/cuda/tests/cudapy/test_sync.py +7 -5
  185. numba_cuda/numba/cuda/tests/cudapy/test_transpose.py +18 -11
  186. numba_cuda/numba/cuda/tests/cudapy/test_ufuncs.py +111 -88
  187. numba_cuda/numba/cuda/tests/cudapy/test_userexc.py +2 -3
  188. numba_cuda/numba/cuda/tests/cudapy/test_vector_type.py +305 -130
  189. numba_cuda/numba/cuda/tests/cudapy/test_vectorize.py +33 -36
  190. numba_cuda/numba/cuda/tests/cudapy/test_vectorize_complex.py +5 -5
  191. numba_cuda/numba/cuda/tests/cudapy/test_vectorize_decor.py +16 -12
  192. numba_cuda/numba/cuda/tests/cudapy/test_vectorize_device.py +7 -7
  193. numba_cuda/numba/cuda/tests/cudapy/test_vectorize_scalar_arg.py +6 -7
  194. numba_cuda/numba/cuda/tests/cudapy/test_warning.py +31 -29
  195. numba_cuda/numba/cuda/tests/cudapy/test_warp_ops.py +31 -25
  196. numba_cuda/numba/cuda/tests/cudasim/test_cudasim_issues.py +19 -13
  197. numba_cuda/numba/cuda/tests/data/jitlink.cu +1 -1
  198. numba_cuda/numba/cuda/tests/data/jitlink.ptx +0 -2
  199. numba_cuda/numba/cuda/tests/doc_examples/test_cg.py +15 -8
  200. numba_cuda/numba/cuda/tests/doc_examples/test_cpu_gpu_compat.py +4 -7
  201. numba_cuda/numba/cuda/tests/doc_examples/test_ffi.py +14 -9
  202. numba_cuda/numba/cuda/tests/doc_examples/test_laplace.py +22 -18
  203. numba_cuda/numba/cuda/tests/doc_examples/test_matmul.py +7 -4
  204. numba_cuda/numba/cuda/tests/doc_examples/test_montecarlo.py +2 -0
  205. numba_cuda/numba/cuda/tests/doc_examples/test_random.py +8 -4
  206. numba_cuda/numba/cuda/tests/doc_examples/test_reduction.py +2 -1
  207. numba_cuda/numba/cuda/tests/doc_examples/test_sessionize.py +94 -19
  208. numba_cuda/numba/cuda/tests/doc_examples/test_vecadd.py +2 -2
  209. numba_cuda/numba/cuda/tests/nocuda/test_dummyarray.py +91 -62
  210. numba_cuda/numba/cuda/tests/nocuda/test_function_resolution.py +14 -5
  211. numba_cuda/numba/cuda/tests/nocuda/test_import.py +25 -25
  212. numba_cuda/numba/cuda/tests/nocuda/test_library_lookup.py +40 -40
  213. numba_cuda/numba/cuda/tests/nocuda/test_nvvm.py +12 -10
  214. numba_cuda/numba/cuda/tests/nrt/test_nrt.py +16 -20
  215. numba_cuda/numba/cuda/tests/nrt/test_nrt_refct.py +12 -10
  216. numba_cuda/numba/cuda/tests/test_binary_generation/generate_raw_ltoir.py +2 -2
  217. numba_cuda/numba/cuda/types.py +5 -2
  218. numba_cuda/numba/cuda/ufuncs.py +382 -362
  219. numba_cuda/numba/cuda/utils.py +2 -2
  220. numba_cuda/numba/cuda/vector_types.py +2 -2
  221. numba_cuda/numba/cuda/vectorizers.py +37 -32
  222. {numba_cuda-0.8.0.dist-info → numba_cuda-0.9.0.dist-info}/METADATA +1 -1
  223. numba_cuda-0.9.0.dist-info/RECORD +253 -0
  224. {numba_cuda-0.8.0.dist-info → numba_cuda-0.9.0.dist-info}/WHEEL +1 -1
  225. numba_cuda-0.8.0.dist-info/RECORD +0 -251
  226. {numba_cuda-0.8.0.dist-info → numba_cuda-0.9.0.dist-info}/licenses/LICENSE +0 -0
  227. {numba_cuda-0.8.0.dist-info → numba_cuda-0.9.0.dist-info}/top_level.txt +0 -0
@@ -78,24 +78,17 @@ def record_read_2d_array(r, a):
78
78
 
79
79
  recordtype = np.dtype(
80
80
  [
81
- ('a', np.float64),
82
- ('b', np.int32),
83
- ('c', np.complex64),
84
- ('d', (np.uint8, 5))
81
+ ("a", np.float64),
82
+ ("b", np.int32),
83
+ ("c", np.complex64),
84
+ ("d", (np.uint8, 5)),
85
85
  ],
86
- align=True
86
+ align=True,
87
87
  )
88
88
 
89
- recordwitharray = np.dtype(
90
- [
91
- ('g', np.int32),
92
- ('h', np.float32, 2)
93
- ],
94
- align=True
95
- )
89
+ recordwitharray = np.dtype([("g", np.int32), ("h", np.float32, 2)], align=True)
96
90
 
97
- recordwith2darray = np.dtype([('i', np.int32),
98
- ('j', np.float32, (3, 2))])
91
+ recordwith2darray = np.dtype([("i", np.int32), ("j", np.float32, (3, 2))])
99
92
 
100
93
  nested_array1_dtype = np.dtype([("array1", np.int16, (3,))], align=True)
101
94
 
@@ -104,12 +97,13 @@ nested_array2_dtype = np.dtype([("array2", np.int16, (3, 2))], align=True)
104
97
 
105
98
  # Functions used for "full array" tests
106
99
 
100
+
107
101
  def record_write_full_array(rec):
108
102
  rec.j[:, :] = np.ones((3, 2))
109
103
 
110
104
 
111
105
  def record_write_full_array_alt(rec):
112
- rec['j'][:, :] = np.ones((3, 2))
106
+ rec["j"][:, :] = np.ones((3, 2))
113
107
 
114
108
 
115
109
  def recarray_set_record(ary, rec):
@@ -122,7 +116,7 @@ def recarray_write_array_of_nestedarray_broadcast(ary):
122
116
 
123
117
 
124
118
  def record_setitem_array(rec_source, rec_dest):
125
- rec_dest['j'] = rec_source['j']
119
+ rec_dest["j"] = rec_source["j"]
126
120
 
127
121
 
128
122
  def recarray_write_array_of_nestedarray(ary):
@@ -135,7 +129,7 @@ def recarray_getitem_return(ary):
135
129
 
136
130
 
137
131
  def recarray_getitem_field_return(ary):
138
- return ary['h']
132
+ return ary["h"]
139
133
 
140
134
 
141
135
  def recarray_getitem_field_return2(ary):
@@ -171,15 +165,14 @@ def record_read_2d_array01(ary):
171
165
 
172
166
 
173
167
  def assign_array_to_nested(dest, src):
174
- dest['array1'] = src
168
+ dest["array1"] = src
175
169
 
176
170
 
177
171
  def assign_array_to_nested_2d(dest, src):
178
- dest['array2'] = src
172
+ dest["array2"] = src
179
173
 
180
174
 
181
175
  class TestRecordDtype(CUDATestCase):
182
-
183
176
  def _createSampleArrays(self):
184
177
  self.sample1d = np.recarray(3, dtype=recordtype)
185
178
  self.samplerec1darr = np.recarray(1, dtype=recordwitharray)[0]
@@ -192,10 +185,10 @@ class TestRecordDtype(CUDATestCase):
192
185
  ary = self.sample1d
193
186
  for i in range(ary.size):
194
187
  x = i + 1
195
- ary[i]['a'] = x / 2
196
- ary[i]['b'] = x
197
- ary[i]['c'] = x * 1j
198
- ary[i]['d'] = "%d" % x
188
+ ary[i]["a"] = x / 2
189
+ ary[i]["b"] = x
190
+ ary[i]["c"] = x * 1j
191
+ ary[i]["d"] = "%d" % x
199
192
 
200
193
  def get_cfunc(self, pyfunc, argspec):
201
194
  return cuda.jit()(pyfunc)
@@ -221,7 +214,7 @@ class TestRecordDtype(CUDATestCase):
221
214
  def test_set_a(self):
222
215
  self._test_set_equal(set_a, 3.1415, types.float64)
223
216
  # Test again to check if coercion works
224
- self._test_set_equal(set_a, 3., types.float32)
217
+ self._test_set_equal(set_a, 3.0, types.float32)
225
218
 
226
219
  def test_set_b(self):
227
220
  self._test_set_equal(set_b, 123, types.int32)
@@ -259,13 +252,13 @@ class TestRecordDtype(CUDATestCase):
259
252
  np.testing.assert_equal(rec[f], v)
260
253
 
261
254
  def test_rec_set_a(self):
262
- self._test_rec_set(np.float64(1.5), record_set_a, 'a')
255
+ self._test_rec_set(np.float64(1.5), record_set_a, "a")
263
256
 
264
257
  def test_rec_set_b(self):
265
- self._test_rec_set(np.int32(2), record_set_b, 'b')
258
+ self._test_rec_set(np.int32(2), record_set_b, "b")
266
259
 
267
260
  def test_rec_set_c(self):
268
- self._test_rec_set(np.complex64(4.0 + 5.0j), record_set_c, 'c')
261
+ self._test_rec_set(np.complex64(4.0 + 5.0j), record_set_c, "c")
269
262
 
270
263
  def _test_rec_read(self, v, pyfunc, f):
271
264
  rec = self.sample1d.copy()[0]
@@ -277,81 +270,83 @@ class TestRecordDtype(CUDATestCase):
277
270
  np.testing.assert_equal(arr[0], v)
278
271
 
279
272
  def test_rec_read_a(self):
280
- self._test_rec_read(np.float64(1.5), record_read_a, 'a')
273
+ self._test_rec_read(np.float64(1.5), record_read_a, "a")
281
274
 
282
275
  def test_rec_read_b(self):
283
- self._test_rec_read(np.int32(2), record_read_b, 'b')
276
+ self._test_rec_read(np.int32(2), record_read_b, "b")
284
277
 
285
278
  def test_rec_read_c(self):
286
- self._test_rec_read(np.complex64(4.0 + 5.0j), record_read_c, 'c')
279
+ self._test_rec_read(np.complex64(4.0 + 5.0j), record_read_c, "c")
287
280
 
288
281
  def test_record_write_1d_array(self):
289
- '''
282
+ """
290
283
  Test writing to a 1D array within a structured type
291
- '''
284
+ """
292
285
  rec = self.samplerec1darr.copy()
293
286
  nbrecord = numpy_support.from_dtype(recordwitharray)
294
287
  cfunc = self.get_cfunc(record_write_array, (nbrecord,))
295
288
 
296
289
  cfunc[1, 1](rec)
297
290
  expected = self.samplerec1darr.copy()
298
- expected['g'] = 2
299
- expected['h'][0] = 3.0
300
- expected['h'][1] = 4.0
291
+ expected["g"] = 2
292
+ expected["h"][0] = 3.0
293
+ expected["h"][1] = 4.0
301
294
 
302
295
  np.testing.assert_equal(expected, rec)
303
296
 
304
297
  def test_record_write_2d_array(self):
305
- '''
298
+ """
306
299
  Test writing to a 2D array within a structured type
307
- '''
300
+ """
308
301
  rec = self.samplerec2darr.copy()
309
302
  nbrecord = numpy_support.from_dtype(recordwith2darray)
310
303
  cfunc = self.get_cfunc(record_write_2d_array, (nbrecord,))
311
304
  cfunc[1, 1](rec)
312
305
 
313
306
  expected = self.samplerec2darr.copy()
314
- expected['i'] = 3
315
- expected['j'][:] = np.asarray([5.0, 6.0, 7.0, 8.0, 9.0, 10.0],
316
- np.float32).reshape(3, 2)
307
+ expected["i"] = 3
308
+ expected["j"][:] = np.asarray(
309
+ [5.0, 6.0, 7.0, 8.0, 9.0, 10.0], np.float32
310
+ ).reshape(3, 2)
317
311
  np.testing.assert_equal(expected, rec)
318
312
 
319
313
  def test_record_read_1d_array(self):
320
- '''
314
+ """
321
315
  Test reading from a 1D array within a structured type
322
- '''
316
+ """
323
317
  rec = self.samplerec1darr.copy()
324
- rec['h'][0] = 4.0
325
- rec['h'][1] = 5.0
318
+ rec["h"][0] = 4.0
319
+ rec["h"][1] = 5.0
326
320
 
327
321
  nbrecord = numpy_support.from_dtype(recordwitharray)
328
322
  cfunc = self.get_cfunc(record_read_array, (nbrecord,))
329
- arr = np.zeros(2, dtype=rec['h'].dtype)
323
+ arr = np.zeros(2, dtype=rec["h"].dtype)
330
324
  cfunc[1, 1](rec, arr)
331
325
 
332
- np.testing.assert_equal(rec['h'], arr)
326
+ np.testing.assert_equal(rec["h"], arr)
333
327
 
334
328
  def test_record_read_2d_array(self):
335
- '''
329
+ """
336
330
  Test reading from a 2D array within a structured type
337
- '''
331
+ """
338
332
  rec = self.samplerec2darr.copy()
339
- rec['j'][:] = np.asarray([5.0, 6.0, 7.0, 8.0, 9.0, 10.0],
340
- np.float32).reshape(3, 2)
333
+ rec["j"][:] = np.asarray(
334
+ [5.0, 6.0, 7.0, 8.0, 9.0, 10.0], np.float32
335
+ ).reshape(3, 2)
341
336
 
342
337
  nbrecord = numpy_support.from_dtype(recordwith2darray)
343
338
  cfunc = self.get_cfunc(record_read_2d_array, (nbrecord,))
344
- arr = np.zeros((3,2), dtype=rec['j'].dtype)
339
+ arr = np.zeros((3, 2), dtype=rec["j"].dtype)
345
340
  cfunc[1, 1](rec, arr)
346
341
 
347
- np.testing.assert_equal(rec['j'], arr)
342
+ np.testing.assert_equal(rec["j"], arr)
348
343
 
349
344
 
350
- @skip_on_cudasim('Structured array attr access not supported in simulator')
345
+ @skip_on_cudasim("Structured array attr access not supported in simulator")
351
346
  class TestRecordDtypeWithStructArrays(TestRecordDtype):
352
- '''
347
+ """
353
348
  Same as TestRecordDtype, but using structured arrays instead of recarrays.
354
- '''
349
+ """
355
350
 
356
351
  def _createSampleArrays(self):
357
352
  self.sample1d = np.zeros(3, dtype=recordtype)
@@ -360,7 +355,6 @@ class TestRecordDtypeWithStructArrays(TestRecordDtype):
360
355
 
361
356
 
362
357
  class TestNestedArrays(CUDATestCase):
363
-
364
358
  # These tests mirror those from
365
359
  # numba.tests.test_record_dtype.TestNestedArrays added in PR
366
360
  # #7359: https://github.com/numba/numba/pull/7359
@@ -405,8 +399,9 @@ class TestNestedArrays(CUDATestCase):
405
399
  def test_record_read_2d_array(self):
406
400
  # Test reading from a 2D array within a structured type
407
401
  nbval = np.recarray(1, dtype=recordwith2darray)
408
- nbval[0].j = np.asarray([1.5, 2.5, 3.5, 4.5, 5.5, 6.5],
409
- np.float32).reshape(3, 2)
402
+ nbval[0].j = np.asarray(
403
+ [1.5, 2.5, 3.5, 4.5, 5.5, 6.5], np.float32
404
+ ).reshape(3, 2)
410
405
  cfunc = self.get_cfunc(record_read_2d_array00, np.float32)
411
406
  res = cfunc(nbval[0])
412
407
  np.testing.assert_equal(res, nbval[0].j[0, 0])
@@ -422,12 +417,15 @@ class TestNestedArrays(CUDATestCase):
422
417
  def test_setitem(self):
423
418
  def gen():
424
419
  nbarr1 = np.recarray(1, dtype=recordwith2darray)
425
- nbarr1[0] = np.array([(1, ((1, 2), (4, 5), (2, 3)))],
426
- dtype=recordwith2darray)[0]
420
+ nbarr1[0] = np.array(
421
+ [(1, ((1, 2), (4, 5), (2, 3)))], dtype=recordwith2darray
422
+ )[0]
427
423
  nbarr2 = np.recarray(1, dtype=recordwith2darray)
428
- nbarr2[0] = np.array([(10, ((10, 20), (40, 50), (20, 30)))],
429
- dtype=recordwith2darray)[0]
424
+ nbarr2[0] = np.array(
425
+ [(10, ((10, 20), (40, 50), (20, 30)))], dtype=recordwith2darray
426
+ )[0]
430
427
  return nbarr1[0], nbarr2[0]
428
+
431
429
  pyfunc = record_setitem_array
432
430
  pyargs = gen()
433
431
  pyfunc(*pyargs)
@@ -453,7 +451,7 @@ class TestNestedArrays(CUDATestCase):
453
451
 
454
452
  # Writing to records / recarrays
455
453
 
456
- @skip_on_cudasim('Structured array attr access not supported in simulator')
454
+ @skip_on_cudasim("Structured array attr access not supported in simulator")
457
455
  def test_set_record(self):
458
456
  # Test setting an entire record
459
457
  rec = np.ones(2, dtype=recordwith2darray).view(np.recarray)[0]
@@ -492,20 +490,18 @@ class TestNestedArrays(CUDATestCase):
492
490
  np.testing.assert_array_equal(expected, got)
493
491
 
494
492
  def test_issue_7693(self):
495
- src_dtype = np.dtype([
496
- ("user", np.float64),
497
- ("array", np.int16, (3,))],
498
- align=True)
493
+ src_dtype = np.dtype(
494
+ [("user", np.float64), ("array", np.int16, (3,))], align=True
495
+ )
499
496
 
500
- dest_dtype = np.dtype([
501
- ("user1", np.float64),
502
- ("array1", np.int16, (3,))],
503
- align=True)
497
+ dest_dtype = np.dtype(
498
+ [("user1", np.float64), ("array1", np.int16, (3,))], align=True
499
+ )
504
500
 
505
501
  @cuda.jit
506
502
  def copy(index, src, dest):
507
- dest['user1'] = src[index]['user']
508
- dest['array1'] = src[index]['array']
503
+ dest["user1"] = src[index]["user"]
504
+ dest["array1"] = src[index]["array"]
509
505
 
510
506
  source = np.zeros(2, dtype=src_dtype)
511
507
  got = np.zeros(2, dtype=dest_dtype)
@@ -528,10 +524,13 @@ class TestNestedArrays(CUDATestCase):
528
524
  # This test returning a record when passing an array and
529
525
  # return the first item when passing a record
530
526
  nbarr = np.recarray(2, dtype=recordwith2darray)
531
- nbarr[0] = np.array([(1, ((1,2),(4,5),(2,3)))],
532
- dtype=recordwith2darray)[0]
533
- for arg, retty in [(nbarr, recordwith2darray),
534
- (nbarr[0], (np.float32, (3, 2)))]:
527
+ nbarr[0] = np.array(
528
+ [(1, ((1, 2), (4, 5), (2, 3)))], dtype=recordwith2darray
529
+ )[0]
530
+ for arg, retty in [
531
+ (nbarr, recordwith2darray),
532
+ (nbarr[0], (np.float32, (3, 2))),
533
+ ]:
535
534
  pyfunc = recarray_getitem_field_return2_2d
536
535
  arr_expected = pyfunc(arg)
537
536
  cfunc = self.get_cfunc(pyfunc, retty)
@@ -545,10 +544,12 @@ class TestNestedArrays(CUDATestCase):
545
544
  # This tests returning a array of nestedarrays when passing an array and
546
545
  # returning a nestedarray when passing a record
547
546
  nbarr = np.recarray(2, dtype=recordwitharray)
548
- nbarr[0] = np.array([(1, (2,3))], dtype=recordwitharray)[0]
547
+ nbarr[0] = np.array([(1, (2, 3))], dtype=recordwitharray)[0]
549
548
  for arg, retty in [(nbarr, recordwitharray), (nbarr[0], np.float32)]:
550
- for pyfunc in [recarray_getitem_field_return,
551
- recarray_getitem_field_return2]:
549
+ for pyfunc in [
550
+ recarray_getitem_field_return,
551
+ recarray_getitem_field_return2,
552
+ ]:
552
553
  arr_expected = pyfunc(arg)
553
554
  cfunc = self.get_cfunc(pyfunc, retty)
554
555
  arr_res = cfunc(arg)
@@ -570,17 +571,17 @@ class TestNestedArrays(CUDATestCase):
570
571
  def test_return_array(self):
571
572
  # Test getitem record AND array within record and returning it
572
573
  nbval = np.recarray(2, dtype=recordwitharray)
573
- nbval[0] = np.array([(1, (2,3))], dtype=recordwitharray)[0]
574
+ nbval[0] = np.array([(1, (2, 3))], dtype=recordwitharray)[0]
574
575
  pyfunc = record_read_array0
575
576
  arr_expected = pyfunc(nbval)
576
577
  cfunc = self.get_cfunc(pyfunc, np.float32)
577
578
  arr_res = cfunc(nbval)
578
579
  np.testing.assert_equal(arr_expected, arr_res)
579
580
 
580
- @skip_on_cudasim('Will unexpectedly pass on cudasim')
581
+ @skip_on_cudasim("Will unexpectedly pass on cudasim")
581
582
  @unittest.expectedFailure
582
583
  def test_set_array(self):
583
- #Test setting an entire array within one record
584
+ # Test setting an entire array within one record
584
585
  arr = np.zeros(2, dtype=recordwith2darray).view(np.recarray)
585
586
  rec = arr[0]
586
587
  nbarr = np.zeros(2, dtype=recordwith2darray).view(np.recarray)
@@ -597,8 +598,8 @@ class TestNestedArrays(CUDATestCase):
597
598
  arr = np.zeros(2, dtype=recordwith2darray).view(np.recarray)
598
599
  nbarr = np.zeros(2, dtype=recordwith2darray).view(np.recarray)
599
600
  for pyfunc in (
600
- recarray_write_array_of_nestedarray_broadcast,
601
- recarray_write_array_of_nestedarray,
601
+ recarray_write_array_of_nestedarray_broadcast,
602
+ recarray_write_array_of_nestedarray,
602
603
  ):
603
604
  arr_expected = pyfunc(arr)
604
605
  cfunc = self.get_cfunc(pyfunc, nbarr.dtype)
@@ -606,5 +607,5 @@ class TestNestedArrays(CUDATestCase):
606
607
  np.testing.assert_equal(arr_res, arr_expected)
607
608
 
608
609
 
609
- if __name__ == '__main__':
610
+ if __name__ == "__main__":
610
611
  unittest.main()
@@ -6,11 +6,11 @@ import unittest
6
6
 
7
7
 
8
8
  class TestSelfRecursion(CUDATestCase):
9
-
10
9
  def setUp(self):
11
10
  # Avoid importing this module at the top level, as it triggers
12
11
  # compilation and can therefore fail
13
12
  from numba.cuda.tests.cudapy import recursion_usecases
13
+
14
14
  self.mod = recursion_usecases
15
15
  super().setUp()
16
16
 
@@ -36,19 +36,20 @@ class TestSelfRecursion(CUDATestCase):
36
36
  def test_global_implicit_sig(self):
37
37
  self.check_fib(self.mod.fib3)
38
38
 
39
- @skip_on_cudasim('Simulator does not compile')
39
+ @skip_on_cudasim("Simulator does not compile")
40
40
  def test_runaway(self):
41
41
  with self.assertRaises(TypingError) as raises:
42
42
  cfunc = self.mod.runaway_self
43
43
 
44
- @cuda.jit('void()')
44
+ @cuda.jit("void()")
45
45
  def kernel():
46
46
  cfunc(1)
47
47
 
48
- self.assertIn("cannot type infer runaway recursion",
49
- str(raises.exception))
48
+ self.assertIn(
49
+ "cannot type infer runaway recursion", str(raises.exception)
50
+ )
50
51
 
51
- @unittest.skip('Needs insert_unresolved_ref support in target')
52
+ @unittest.skip("Needs insert_unresolved_ref support in target")
52
53
  def test_type_change(self):
53
54
  pfunc = self.mod.type_change_self.py_func
54
55
  cfunc = self.mod.type_change_self
@@ -79,7 +80,7 @@ class TestSelfRecursion(CUDATestCase):
79
80
 
80
81
  self.assertEqual(str(raises.exception), "raise_self")
81
82
 
82
- @unittest.skip('Needs insert_unresolved_ref support in target')
83
+ @unittest.skip("Needs insert_unresolved_ref support in target")
83
84
  def test_optional_return(self):
84
85
  pfunc = self.mod.make_optional_return_case()
85
86
  cfunc = self.mod.make_optional_return_case(cuda.jit)
@@ -106,12 +107,13 @@ class TestSelfRecursion(CUDATestCase):
106
107
 
107
108
  self.assertEqual(expected, actual)
108
109
 
109
- @skip_on_cudasim('Recursion handled because simulator does not compile')
110
+ @skip_on_cudasim("Recursion handled because simulator does not compile")
110
111
  def test_growing_return_tuple(self):
111
112
  cfunc = self.mod.make_growing_tuple_case(cuda.jit)
112
113
 
113
114
  with self.assertRaises(TypingError) as raises:
114
- @cuda.jit('void()')
115
+
116
+ @cuda.jit("void()")
115
117
  def kernel():
116
118
  cfunc(100)
117
119
 
@@ -121,5 +123,5 @@ class TestSelfRecursion(CUDATestCase):
121
123
  )
122
124
 
123
125
 
124
- if __name__ == '__main__':
126
+ if __name__ == "__main__":
125
127
  unittest.main()
@@ -10,7 +10,7 @@ sum_reduce = cuda.Reduce(lambda a, b: a + b)
10
10
 
11
11
  class TestReduction(CUDATestCase):
12
12
  def _sum_reduce(self, n):
13
- A = (np.arange(n, dtype=np.float64) + 1)
13
+ A = np.arange(n, dtype=np.float64) + 1
14
14
  expect = A.sum()
15
15
  got = sum_reduce(A)
16
16
  self.assertEqual(expect, got)
@@ -19,24 +19,39 @@ class TestReduction(CUDATestCase):
19
19
  if ENABLE_CUDASIM:
20
20
  # Minimal test set for the simulator (which only wraps
21
21
  # functools.reduce)
22
- test_sizes = [ 1, 16 ]
22
+ test_sizes = [1, 16]
23
23
  else:
24
24
  # Tests around the points where blocksize changes, and around larger
25
25
  # powers of two, sums of powers of two, and some "random" sizes
26
- test_sizes = [ 1, 15, 16, 17, 127, 128, 129, 1023, 1024,
27
- 1025, 1536, 1048576, 1049600, 1049728, 34567 ]
26
+ test_sizes = [
27
+ 1,
28
+ 15,
29
+ 16,
30
+ 17,
31
+ 127,
32
+ 128,
33
+ 129,
34
+ 1023,
35
+ 1024,
36
+ 1025,
37
+ 1536,
38
+ 1048576,
39
+ 1049600,
40
+ 1049728,
41
+ 34567,
42
+ ]
28
43
  # Avoid recompilation by keeping sum_reduce here
29
44
  for n in test_sizes:
30
45
  self._sum_reduce(n)
31
46
 
32
47
  def test_empty_array_host(self):
33
- A = (np.arange(0, dtype=np.float64) + 1)
48
+ A = np.arange(0, dtype=np.float64) + 1
34
49
  expect = A.sum()
35
50
  got = sum_reduce(A)
36
51
  self.assertEqual(expect, got)
37
52
 
38
53
  def test_empty_array_device(self):
39
- A = (np.arange(0, dtype=np.float64) + 1)
54
+ A = np.arange(0, dtype=np.float64) + 1
40
55
  dA = cuda.to_device(A)
41
56
  expect = A.sum()
42
57
  got = sum_reduce(dA)
@@ -44,27 +59,27 @@ class TestReduction(CUDATestCase):
44
59
 
45
60
  def test_prod_reduce(self):
46
61
  prod_reduce = cuda.reduce(lambda a, b: a * b)
47
- A = (np.arange(64, dtype=np.float64) + 1)
62
+ A = np.arange(64, dtype=np.float64) + 1
48
63
  expect = A.prod()
49
64
  got = prod_reduce(A, init=1)
50
65
  np.testing.assert_allclose(expect, got)
51
66
 
52
67
  def test_max_reduce(self):
53
68
  max_reduce = cuda.Reduce(lambda a, b: max(a, b))
54
- A = (np.arange(3717, dtype=np.float64) + 1)
69
+ A = np.arange(3717, dtype=np.float64) + 1
55
70
  expect = A.max()
56
71
  got = max_reduce(A, init=0)
57
72
  self.assertEqual(expect, got)
58
73
 
59
74
  def test_non_identity_init(self):
60
75
  init = 3
61
- A = (np.arange(10, dtype=np.float64) + 1)
76
+ A = np.arange(10, dtype=np.float64) + 1
62
77
  expect = A.sum() + init
63
78
  got = sum_reduce(A, init=init)
64
79
  self.assertEqual(expect, got)
65
80
 
66
81
  def test_result_on_device(self):
67
- A = (np.arange(10, dtype=np.float64) + 1)
82
+ A = np.arange(10, dtype=np.float64) + 1
68
83
  got = cuda.to_device(np.zeros(1, dtype=np.float64))
69
84
  expect = A.sum()
70
85
  res = sum_reduce(A, res=got)
@@ -72,5 +87,5 @@ class TestReduction(CUDATestCase):
72
87
  self.assertEqual(expect, got[0])
73
88
 
74
89
 
75
- if __name__ == '__main__':
90
+ if __name__ == "__main__":
76
91
  unittest.main()
@@ -21,13 +21,10 @@ def set_array_to_three(arr):
21
21
 
22
22
 
23
23
  def set_record_to_three(rec):
24
- rec[0]['b'] = 3
24
+ rec[0]["b"] = 3
25
25
 
26
26
 
27
- recordtype = np.dtype(
28
- [('b', np.int32)],
29
- align=True
30
- )
27
+ recordtype = np.dtype([("b", np.int32)], align=True)
31
28
 
32
29
 
33
30
  class TestRetrieveAutoconvertedArrays(CUDATestCase):
@@ -61,23 +58,23 @@ class TestRetrieveAutoconvertedArrays(CUDATestCase):
61
58
  def test_record_in(self):
62
59
  host_rec = np.zeros(1, dtype=recordtype)
63
60
  self.set_record_to_three[1, 1](cuda.In(host_rec))
64
- self.assertEqual(0, host_rec[0]['b'])
61
+ self.assertEqual(0, host_rec[0]["b"])
65
62
 
66
63
  def test_record_inout(self):
67
64
  host_rec = np.zeros(1, dtype=recordtype)
68
65
  self.set_record_to_three[1, 1](cuda.InOut(host_rec))
69
- self.assertEqual(3, host_rec[0]['b'])
66
+ self.assertEqual(3, host_rec[0]["b"])
70
67
 
71
68
  def test_record_default(self):
72
69
  host_rec = np.zeros(1, dtype=recordtype)
73
70
  self.set_record_to_three[1, 1](host_rec)
74
- self.assertEqual(3, host_rec[0]['b'])
71
+ self.assertEqual(3, host_rec[0]["b"])
75
72
 
76
73
  def test_record_in_from_config(self):
77
74
  host_rec = np.zeros(1, dtype=recordtype)
78
75
  self.set_record_to_three_nocopy[1, 1](host_rec)
79
- self.assertEqual(0, host_rec[0]['b'])
76
+ self.assertEqual(0, host_rec[0]["b"])
80
77
 
81
78
 
82
- if __name__ == '__main__':
79
+ if __name__ == "__main__":
83
80
  unittest.main()
@@ -7,9 +7,8 @@ import unittest
7
7
  from numba.np import numpy_support
8
8
 
9
9
 
10
- @skip_on_cudasim('pickling not supported in CUDASIM')
10
+ @skip_on_cudasim("pickling not supported in CUDASIM")
11
11
  class TestPickle(CUDATestCase):
12
-
13
12
  def check_call(self, callee):
14
13
  arr = np.array([100])
15
14
  expected = callee[1, 1](arr)
@@ -41,14 +40,13 @@ class TestPickle(CUDATestCase):
41
40
  def inner(a):
42
41
  return a + 1
43
42
 
44
- @cuda.jit('void(intp[:])')
43
+ @cuda.jit("void(intp[:])")
45
44
  def foo(arr):
46
45
  arr[0] = inner(arr[0])
47
46
 
48
47
  self.check_call(foo)
49
48
 
50
49
  def test_pickling_jit(self):
51
-
52
50
  @cuda.jit(device=True)
53
51
  def inner(a):
54
52
  return a + 1
@@ -60,7 +58,7 @@ class TestPickle(CUDATestCase):
60
58
  self.check_call(foo)
61
59
 
62
60
  def test_pickling_vectorize(self):
63
- @vectorize(['intp(intp)', 'float64(float64)'], target='cuda')
61
+ @vectorize(["intp(intp)", "float64(float64)"], target="cuda")
64
62
  def cuda_vect(x):
65
63
  return x * 2
66
64
 
@@ -81,5 +79,5 @@ class TestPickle(CUDATestCase):
81
79
  np.testing.assert_equal(expected, got2)
82
80
 
83
81
 
84
- if __name__ == '__main__':
82
+ if __name__ == "__main__":
85
83
  unittest.main()
@@ -33,5 +33,5 @@ class TestCudaSlicing(CUDATestCase):
33
33
  arr[:] = cuda.to_device(a)
34
34
 
35
35
 
36
- if __name__ == '__main__':
36
+ if __name__ == "__main__":
37
37
  unittest.main()