numba-cuda 0.8.1__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 +460 -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.1.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.1.dist-info → numba_cuda-0.9.0.dist-info}/WHEEL +1 -1
  225. numba_cuda-0.8.1.dist-info/RECORD +0 -251
  226. {numba_cuda-0.8.1.dist-info → numba_cuda-0.9.0.dist-info}/licenses/LICENSE +0 -0
  227. {numba_cuda-0.8.1.dist-info → numba_cuda-0.9.0.dist-info}/top_level.txt +0 -0
@@ -8,8 +8,7 @@ from numba.np import numpy_support as nps
8
8
 
9
9
  from .extensions_usecases import test_struct_model_type, TestStruct
10
10
 
11
- recordwith2darray = np.dtype([('i', np.int32),
12
- ('j', np.float32, (3, 2))])
11
+ recordwith2darray = np.dtype([("i", np.int32), ("j", np.float32, (3, 2))])
13
12
 
14
13
 
15
14
  class TestSharedMemoryIssue(CUDATestCase):
@@ -42,7 +41,6 @@ class TestSharedMemoryIssue(CUDATestCase):
42
41
  self._check_shared_array_size((2, 3), 6)
43
42
 
44
43
  def test_issue_1051_shared_size_broken_3d(self):
45
-
46
44
  self._check_shared_array_size((2, 3, 4), 24)
47
45
 
48
46
  def _check_shared_array_size_fp16(self, shape, expected, ty):
@@ -71,8 +69,9 @@ class TestSharedMemoryIssue(CUDATestCase):
71
69
 
72
70
  @cuda.jit
73
71
  def costs_func(d_block_costs):
74
- s_features = cuda.shared.array((examples_per_block, num_weights),
75
- float64)
72
+ s_features = cuda.shared.array(
73
+ (examples_per_block, num_weights), float64
74
+ )
76
75
  s_initialcost = cuda.shared.array(7, float64) # Bug
77
76
 
78
77
  threadIdx = cuda.threadIdx.x
@@ -364,7 +363,7 @@ class TestSharedMemory(CUDATestCase):
364
363
  def sm_slice_copy(x, y, chunksize):
365
364
  dynsmem = cuda.shared.array(0, dtype=dt)
366
365
  sm1 = dynsmem[0:chunksize]
367
- sm2 = dynsmem[chunksize:chunksize * 2]
366
+ sm2 = dynsmem[chunksize : chunksize * 2]
368
367
 
369
368
  tx = cuda.threadIdx.x
370
369
  bx = cuda.blockIdx.x
@@ -396,14 +395,16 @@ class TestSharedMemory(CUDATestCase):
396
395
  rgx = ".*Cannot infer the type of variable 'arr'.*"
397
396
 
398
397
  def unsupported_type():
399
- arr = cuda.shared.array(10, dtype=np.dtype('O')) # noqa: F841
398
+ arr = cuda.shared.array(10, dtype=np.dtype("O")) # noqa: F841
399
+
400
400
  with self.assertRaisesRegex(TypingError, rgx):
401
401
  cuda.jit(void())(unsupported_type)
402
402
 
403
403
  rgx = ".*Invalid NumPy dtype specified: 'int33'.*"
404
404
 
405
405
  def invalid_string_type():
406
- arr = cuda.shared.array(10, dtype='int33') # noqa: F841
406
+ arr = cuda.shared.array(10, dtype="int33") # noqa: F841
407
+
407
408
  with self.assertRaisesRegex(TypingError, rgx):
408
409
  cuda.jit(void())(invalid_string_type)
409
410
 
@@ -440,5 +441,5 @@ class TestSharedMemory(CUDATestCase):
440
441
  self.assertEqual(y, (nthreads - i - 1) * 2)
441
442
 
442
443
 
443
- if __name__ == '__main__':
444
+ if __name__ == "__main__":
444
445
  unittest.main()
@@ -17,15 +17,17 @@ def udt_global_constants(A):
17
17
 
18
18
 
19
19
  def udt_global_build_tuple(A):
20
- sa = cuda.shared.array(shape=(GLOBAL_CONSTANT, GLOBAL_CONSTANT_2),
21
- dtype=float32)
20
+ sa = cuda.shared.array(
21
+ shape=(GLOBAL_CONSTANT, GLOBAL_CONSTANT_2), dtype=float32
22
+ )
22
23
  i, j = cuda.grid(2)
23
24
  A[i, j] = sa[i, j]
24
25
 
25
26
 
26
27
  def udt_global_build_list(A):
27
- sa = cuda.shared.array(shape=[GLOBAL_CONSTANT, GLOBAL_CONSTANT_2],
28
- dtype=float32)
28
+ sa = cuda.shared.array(
29
+ shape=[GLOBAL_CONSTANT, GLOBAL_CONSTANT_2], dtype=float32
30
+ )
29
31
  i, j = cuda.grid(2)
30
32
  A[i, j] = sa[i, j]
31
33
 
@@ -59,7 +61,7 @@ class TestSharedMemoryCreation(CUDATestCase):
59
61
  return np.array(100, dtype=np.float32, ndmin=1)
60
62
 
61
63
  def getarg2(self):
62
- return self.getarg().reshape(1,1)
64
+ return self.getarg().reshape(1, 1)
63
65
 
64
66
  def test_global_constants(self):
65
67
  udt = cuda.jit((float32[:],))(udt_global_constants)
@@ -69,18 +71,21 @@ class TestSharedMemoryCreation(CUDATestCase):
69
71
  udt = cuda.jit((float32[:, :],))(udt_global_build_tuple)
70
72
  udt[1, 1](self.getarg2())
71
73
 
72
- @skip_on_cudasim('Simulator does not prohibit lists for shared array shape')
74
+ @skip_on_cudasim("Simulator does not prohibit lists for shared array shape")
73
75
  def test_global_build_list(self):
74
76
  with self.assertRaises(TypingError) as raises:
75
77
  cuda.jit((float32[:, :],))(udt_global_build_list)
76
78
 
77
- self.assertIn("No implementation of function "
78
- "Function(<function shared.array",
79
- str(raises.exception))
80
- self.assertIn("found for signature:\n \n "
81
- ">>> array(shape=list(int64)<iv=[5, 6]>, "
82
- "dtype=class(float32)",
83
- str(raises.exception))
79
+ self.assertIn(
80
+ "No implementation of function Function(<function shared.array",
81
+ str(raises.exception),
82
+ )
83
+ self.assertIn(
84
+ "found for signature:\n \n "
85
+ ">>> array(shape=list(int64)<iv=[5, 6]>, "
86
+ "dtype=class(float32)",
87
+ str(raises.exception),
88
+ )
84
89
 
85
90
  def test_global_constant_tuple(self):
86
91
  udt = cuda.jit((float32[:, :],))(udt_global_constant_tuple)
@@ -92,12 +97,15 @@ class TestSharedMemoryCreation(CUDATestCase):
92
97
  with self.assertRaises(TypingError) as raises:
93
98
  cuda.jit((float32[:],))(udt_invalid_1)
94
99
 
95
- self.assertIn("No implementation of function "
96
- "Function(<function shared.array",
97
- str(raises.exception))
98
- self.assertIn("found for signature:\n \n "
99
- ">>> array(shape=float32, dtype=class(float32))",
100
- str(raises.exception))
100
+ self.assertIn(
101
+ "No implementation of function Function(<function shared.array",
102
+ str(raises.exception),
103
+ )
104
+ self.assertIn(
105
+ "found for signature:\n \n "
106
+ ">>> array(shape=float32, dtype=class(float32))",
107
+ str(raises.exception),
108
+ )
101
109
 
102
110
  @skip_on_cudasim("Can't check for constants in simulator")
103
111
  def test_invalid_2(self):
@@ -105,13 +113,16 @@ class TestSharedMemoryCreation(CUDATestCase):
105
113
  with self.assertRaises(TypingError) as raises:
106
114
  cuda.jit((float32[:, :],))(udt_invalid_2)
107
115
 
108
- self.assertIn("No implementation of function "
109
- "Function(<function shared.array",
110
- str(raises.exception))
111
- self.assertIn("found for signature:\n \n "
112
- ">>> array(shape=Tuple(Literal[int](1), "
113
- "array(float32, 1d, A)), dtype=class(float32))",
114
- str(raises.exception))
116
+ self.assertIn(
117
+ "No implementation of function Function(<function shared.array",
118
+ str(raises.exception),
119
+ )
120
+ self.assertIn(
121
+ "found for signature:\n \n "
122
+ ">>> array(shape=Tuple(Literal[int](1), "
123
+ "array(float32, 1d, A)), dtype=class(float32))",
124
+ str(raises.exception),
125
+ )
115
126
 
116
127
  @skip_on_cudasim("Can't check for constants in simulator")
117
128
  def test_invalid_3(self):
@@ -119,12 +130,15 @@ class TestSharedMemoryCreation(CUDATestCase):
119
130
  with self.assertRaises(TypingError) as raises:
120
131
  cuda.jit((int32[:],))(udt_invalid_1)
121
132
 
122
- self.assertIn("No implementation of function "
123
- "Function(<function shared.array",
124
- str(raises.exception))
125
- self.assertIn("found for signature:\n \n "
126
- ">>> array(shape=int32, dtype=class(float32))",
127
- str(raises.exception))
133
+ self.assertIn(
134
+ "No implementation of function Function(<function shared.array",
135
+ str(raises.exception),
136
+ )
137
+ self.assertIn(
138
+ "found for signature:\n \n "
139
+ ">>> array(shape=int32, dtype=class(float32))",
140
+ str(raises.exception),
141
+ )
128
142
 
129
143
  @skip_on_cudasim("Can't check for constants in simulator")
130
144
  def test_invalid_4(self):
@@ -132,18 +146,21 @@ class TestSharedMemoryCreation(CUDATestCase):
132
146
  with self.assertRaises(TypingError) as raises:
133
147
  cuda.jit((int32[:],))(udt_invalid_3)
134
148
 
135
- self.assertIn("No implementation of function "
136
- "Function(<function shared.array",
137
- str(raises.exception))
138
- self.assertIn("found for signature:\n \n "
139
- ">>> array(shape=Tuple(Literal[int](1), int32), "
140
- "dtype=class(float32))",
141
- str(raises.exception))
149
+ self.assertIn(
150
+ "No implementation of function Function(<function shared.array",
151
+ str(raises.exception),
152
+ )
153
+ self.assertIn(
154
+ "found for signature:\n \n "
155
+ ">>> array(shape=Tuple(Literal[int](1), int32), "
156
+ "dtype=class(float32))",
157
+ str(raises.exception),
158
+ )
142
159
 
143
160
  def check_dtype(self, f, dtype):
144
161
  # Find the typing of the dtype argument to cuda.shared.array
145
162
  annotation = next(iter(f.overloads.values()))._type_annotation
146
- l_dtype = annotation.typemap['s'].dtype
163
+ l_dtype = annotation.typemap["s"].dtype
147
164
  # Ensure that the typing is correct
148
165
  self.assertEqual(l_dtype, dtype)
149
166
 
@@ -174,7 +191,7 @@ class TestSharedMemoryCreation(CUDATestCase):
174
191
  # Check that strings can be used to specify the dtype of a shared array
175
192
  @cuda.jit(void(int32[::1]))
176
193
  def f(x):
177
- s = cuda.shared.array(10, dtype='int32')
194
+ s = cuda.shared.array(10, dtype="int32")
178
195
  s[0] = x[0]
179
196
  x[0] = s[0]
180
197
 
@@ -185,9 +202,10 @@ class TestSharedMemoryCreation(CUDATestCase):
185
202
  # Check that strings of invalid dtypes cause a typing error
186
203
  re = ".*Invalid NumPy dtype specified: 'int33'.*"
187
204
  with self.assertRaisesRegex(TypingError, re):
205
+
188
206
  @cuda.jit(void(int32[::1]))
189
207
  def f(x):
190
- s = cuda.shared.array(10, dtype='int33')
208
+ s = cuda.shared.array(10, dtype="int33")
191
209
  s[0] = x[0]
192
210
  x[0] = s[0]
193
211
 
@@ -198,8 +216,9 @@ class TestSharedMemoryCreation(CUDATestCase):
198
216
  s = cuda.shared.array(10, dtype=test_struct_model_type)
199
217
  s[0] = x[0]
200
218
  x[0] = s[0]
219
+
201
220
  self.check_dtype(f, test_struct_model_type)
202
221
 
203
222
 
204
- if __name__ == '__main__':
223
+ if __name__ == "__main__":
205
224
  unittest.main()
@@ -1,5 +1,9 @@
1
- from numba.cuda.testing import (skip_on_cudasim, skip_unless_cudasim, unittest,
2
- CUDATestCase)
1
+ from numba.cuda.testing import (
2
+ skip_on_cudasim,
3
+ skip_unless_cudasim,
4
+ unittest,
5
+ CUDATestCase,
6
+ )
3
7
  from numba import config, cuda
4
8
 
5
9
  # Basic tests that stream APIs execute on the hardware and in the simulator.
@@ -48,5 +52,5 @@ class TestStreamAPI(CUDATestCase):
48
52
  cuda.external_stream(ptr)
49
53
 
50
54
 
51
- if __name__ == '__main__':
55
+ if __name__ == "__main__":
52
56
  unittest.main()
@@ -133,14 +133,16 @@ class TestCudaSync(CUDATestCase):
133
133
  self._test_useless(useless_syncwarp)
134
134
 
135
135
  @skip_on_cudasim("syncwarp not implemented on cudasim")
136
- @unittest.skipUnless(_safe_cc_check((7, 0)),
137
- "Partial masks require CC 7.0 or greater")
136
+ @unittest.skipUnless(
137
+ _safe_cc_check((7, 0)), "Partial masks require CC 7.0 or greater"
138
+ )
138
139
  def test_useless_syncwarp_with_mask(self):
139
140
  self._test_useless(useless_syncwarp_with_mask)
140
141
 
141
142
  @skip_on_cudasim("syncwarp not implemented on cudasim")
142
- @unittest.skipUnless(_safe_cc_check((7, 0)),
143
- "Partial masks require CC 7.0 or greater")
143
+ @unittest.skipUnless(
144
+ _safe_cc_check((7, 0)), "Partial masks require CC 7.0 or greater"
145
+ )
144
146
  def test_coop_syncwarp(self):
145
147
  # coop_syncwarp computes the sum of all integers from 0 to 31 (496)
146
148
  # using a single warp
@@ -267,5 +269,5 @@ class TestCudaSync(CUDATestCase):
267
269
  self._test_syncthreads_or(np.int64)
268
270
 
269
271
 
270
- if __name__ == '__main__':
272
+ if __name__ == "__main__":
271
273
  unittest.main()
@@ -5,17 +5,17 @@ from numba.cuda.testing import unittest
5
5
  from numba.cuda.testing import skip_on_cudasim, CUDATestCase
6
6
 
7
7
 
8
- recordwith2darray = np.dtype([('i', np.int32),
9
- ('j', np.float32, (3, 2))])
8
+ recordwith2darray = np.dtype([("i", np.int32), ("j", np.float32, (3, 2))])
10
9
 
11
10
 
12
- @skip_on_cudasim('Device Array API unsupported in the simulator')
11
+ @skip_on_cudasim("Device Array API unsupported in the simulator")
13
12
  class TestTranspose(CUDATestCase):
14
-
15
13
  def test_transpose(self):
16
- variants = ((5, 6, np.float64),
17
- (128, 128, np.complex128),
18
- (1025, 512, np.float64))
14
+ variants = (
15
+ (5, 6, np.float64),
16
+ (128, 128, np.complex128),
17
+ (1025, 512, np.float64),
18
+ )
19
19
 
20
20
  for rows, cols, dtype in variants:
21
21
  with self.subTest(rows=rows, cols=cols, dtype=dtype):
@@ -27,8 +27,15 @@ class TestTranspose(CUDATestCase):
27
27
  dy.copy_to_host(y)
28
28
  np.testing.assert_array_equal(x.transpose(), y)
29
29
 
30
- small_variants = ((2, 3), (16, 16), (16, 17), (17, 16), (14, 15), (15, 14),
31
- (14, 14))
30
+ small_variants = (
31
+ (2, 3),
32
+ (16, 16),
33
+ (16, 17),
34
+ (17, 16),
35
+ (14, 15),
36
+ (15, 14),
37
+ (14, 14),
38
+ )
32
39
 
33
40
  def test_transpose_record(self):
34
41
  for rows, cols in self.small_variants:
@@ -36,7 +43,7 @@ class TestTranspose(CUDATestCase):
36
43
  arr = np.recarray((rows, cols), dtype=recordwith2darray)
37
44
  for x in range(rows):
38
45
  for y in range(cols):
39
- arr[x, y].i = x ** 2 + y
46
+ arr[x, y].i = x**2 + y
40
47
  j = np.arange(3 * 2, dtype=np.float32)
41
48
  arr[x, y].j = j.reshape(3, 2) * x + y
42
49
 
@@ -76,5 +83,5 @@ class TestTranspose(CUDATestCase):
76
83
  np.testing.assert_array_equal(a_view_t, h_a_view_t)
77
84
 
78
85
 
79
- if __name__ == '__main__':
86
+ if __name__ == "__main__":
80
87
  unittest.main()
@@ -9,11 +9,11 @@ from numba.tests.test_ufuncs import BasicUFuncTest
9
9
 
10
10
  def _make_ufunc_usecase(ufunc):
11
11
  ldict = {}
12
- arg_str = ','.join(['a{0}'.format(i) for i in range(ufunc.nargs)])
13
- func_str = f'def fn({arg_str}):\n np.{ufunc.__name__}({arg_str})'
12
+ arg_str = ",".join(["a{0}".format(i) for i in range(ufunc.nargs)])
13
+ func_str = f"def fn({arg_str}):\n np.{ufunc.__name__}({arg_str})"
14
14
  exec(func_str, globals(), ldict)
15
- fn = ldict['fn']
16
- fn.__name__ = '{0}_usecase'.format(ufunc.__name__)
15
+ fn = ldict["fn"]
16
+ fn.__name__ = "{0}_usecase".format(ufunc.__name__)
17
17
  return fn
18
18
 
19
19
 
@@ -32,58 +32,75 @@ class TestUFuncs(BasicUFuncTest, TestCase):
32
32
 
33
33
  # The basic ufunc test does not set up complex inputs, so we'll add
34
34
  # some here for testing with CUDA.
35
- self.inputs.extend([
36
- (np.complex64(-0.5 - 0.5j), types.complex64),
37
- (np.complex64(0.0), types.complex64),
38
- (np.complex64(0.5 + 0.5j), types.complex64),
39
-
40
- (np.complex128(-0.5 - 0.5j), types.complex128),
41
- (np.complex128(0.0), types.complex128),
42
- (np.complex128(0.5 + 0.5j), types.complex128),
43
-
44
- (np.array([-0.5 - 0.5j, 0.0, 0.5 + 0.5j], dtype='c8'),
45
- types.Array(types.complex64, 1, 'C')),
46
- (np.array([-0.5 - 0.5j, 0.0, 0.5 + 0.5j], dtype='c16'),
47
- types.Array(types.complex128, 1, 'C')),
48
- ])
35
+ self.inputs.extend(
36
+ [
37
+ (np.complex64(-0.5 - 0.5j), types.complex64),
38
+ (np.complex64(0.0), types.complex64),
39
+ (np.complex64(0.5 + 0.5j), types.complex64),
40
+ (np.complex128(-0.5 - 0.5j), types.complex128),
41
+ (np.complex128(0.0), types.complex128),
42
+ (np.complex128(0.5 + 0.5j), types.complex128),
43
+ (
44
+ np.array([-0.5 - 0.5j, 0.0, 0.5 + 0.5j], dtype="c8"),
45
+ types.Array(types.complex64, 1, "C"),
46
+ ),
47
+ (
48
+ np.array([-0.5 - 0.5j, 0.0, 0.5 + 0.5j], dtype="c16"),
49
+ types.Array(types.complex128, 1, "C"),
50
+ ),
51
+ ]
52
+ )
49
53
 
50
54
  # Test with multiple dimensions
51
- self.inputs.extend([
52
- # Basic 2D and 3D arrays
53
- (np.linspace(0, 1).reshape((5, -1)),
54
- types.Array(types.float64, 2, 'C')),
55
- (np.linspace(0, 1).reshape((2, 5, -1)),
56
- types.Array(types.float64, 3, 'C')),
57
- # Complex data (i.e. interleaved)
58
- (np.linspace(0, 1 + 1j).reshape(5, -1),
59
- types.Array(types.complex128, 2, 'C')),
60
- # F-ordered
61
- (np.asfortranarray(np.linspace(0, 1).reshape((5, -1))),
62
- types.Array(types.float64, 2, 'F')),
63
- ])
55
+ self.inputs.extend(
56
+ [
57
+ # Basic 2D and 3D arrays
58
+ (
59
+ np.linspace(0, 1).reshape((5, -1)),
60
+ types.Array(types.float64, 2, "C"),
61
+ ),
62
+ (
63
+ np.linspace(0, 1).reshape((2, 5, -1)),
64
+ types.Array(types.float64, 3, "C"),
65
+ ),
66
+ # Complex data (i.e. interleaved)
67
+ (
68
+ np.linspace(0, 1 + 1j).reshape(5, -1),
69
+ types.Array(types.complex128, 2, "C"),
70
+ ),
71
+ # F-ordered
72
+ (
73
+ np.asfortranarray(np.linspace(0, 1).reshape((5, -1))),
74
+ types.Array(types.float64, 2, "F"),
75
+ ),
76
+ ]
77
+ )
64
78
 
65
79
  # Add tests for other integer types
66
- self.inputs.extend([
67
- (np.uint8(0), types.uint8),
68
- (np.uint8(1), types.uint8),
69
- (np.int8(-1), types.int8),
70
- (np.int8(0), types.int8),
71
-
72
- (np.uint16(0), types.uint16),
73
- (np.uint16(1), types.uint16),
74
- (np.int16(-1), types.int16),
75
- (np.int16(0), types.int16),
76
-
77
- (np.ulonglong(0), types.ulonglong),
78
- (np.ulonglong(1), types.ulonglong),
79
- (np.longlong(-1), types.longlong),
80
- (np.longlong(0), types.longlong),
81
-
82
- (np.array([0,1], dtype=np.ulonglong),
83
- types.Array(types.ulonglong, 1, 'C')),
84
- (np.array([0,1], dtype=np.longlong),
85
- types.Array(types.longlong, 1, 'C')),
86
- ])
80
+ self.inputs.extend(
81
+ [
82
+ (np.uint8(0), types.uint8),
83
+ (np.uint8(1), types.uint8),
84
+ (np.int8(-1), types.int8),
85
+ (np.int8(0), types.int8),
86
+ (np.uint16(0), types.uint16),
87
+ (np.uint16(1), types.uint16),
88
+ (np.int16(-1), types.int16),
89
+ (np.int16(0), types.int16),
90
+ (np.ulonglong(0), types.ulonglong),
91
+ (np.ulonglong(1), types.ulonglong),
92
+ (np.longlong(-1), types.longlong),
93
+ (np.longlong(0), types.longlong),
94
+ (
95
+ np.array([0, 1], dtype=np.ulonglong),
96
+ types.Array(types.ulonglong, 1, "C"),
97
+ ),
98
+ (
99
+ np.array([0, 1], dtype=np.longlong),
100
+ types.Array(types.longlong, 1, "C"),
101
+ ),
102
+ ]
103
+ )
87
104
 
88
105
  self._low_occupancy_warnings = config.CUDA_LOW_OCCUPANCY_WARNINGS
89
106
  self._warn_on_implicit_copy = config.CUDA_WARN_ON_IMPLICIT_COPY
@@ -111,18 +128,18 @@ class TestUFuncs(BasicUFuncTest, TestCase):
111
128
  skip_inputs = [
112
129
  types.float32,
113
130
  types.float64,
114
- types.Array(types.float32, 1, 'C'),
115
- types.Array(types.float32, 2, 'C'),
116
- types.Array(types.float64, 1, 'C'),
117
- types.Array(types.float64, 2, 'C'),
118
- types.Array(types.float64, 3, 'C'),
119
- types.Array(types.float64, 2, 'F'),
131
+ types.Array(types.float32, 1, "C"),
132
+ types.Array(types.float32, 2, "C"),
133
+ types.Array(types.float64, 1, "C"),
134
+ types.Array(types.float64, 2, "C"),
135
+ types.Array(types.float64, 3, "C"),
136
+ types.Array(types.float64, 2, "F"),
120
137
  types.complex64,
121
138
  types.complex128,
122
- types.Array(types.complex64, 1, 'C'),
123
- types.Array(types.complex64, 2, 'C'),
124
- types.Array(types.complex128, 1, 'C'),
125
- types.Array(types.complex128, 2, 'C'),
139
+ types.Array(types.complex64, 1, "C"),
140
+ types.Array(types.complex64, 2, "C"),
141
+ types.Array(types.complex128, 1, "C"),
142
+ types.Array(types.complex128, 2, "C"),
126
143
  ]
127
144
  self.basic_ufunc_test(name, skip_inputs=skip_inputs)
128
145
 
@@ -130,43 +147,43 @@ class TestUFuncs(BasicUFuncTest, TestCase):
130
147
  # Trigonometric Functions
131
148
 
132
149
  def test_sin_ufunc(self):
133
- self.basic_ufunc_test(np.sin, kinds='cf')
150
+ self.basic_ufunc_test(np.sin, kinds="cf")
134
151
 
135
152
  def test_cos_ufunc(self):
136
- self.basic_ufunc_test(np.cos, kinds='cf')
153
+ self.basic_ufunc_test(np.cos, kinds="cf")
137
154
 
138
155
  def test_tan_ufunc(self):
139
- self.basic_ufunc_test(np.tan, kinds='cf')
156
+ self.basic_ufunc_test(np.tan, kinds="cf")
140
157
 
141
158
  def test_arcsin_ufunc(self):
142
- self.basic_ufunc_test(np.arcsin, kinds='cf')
159
+ self.basic_ufunc_test(np.arcsin, kinds="cf")
143
160
 
144
161
  def test_arccos_ufunc(self):
145
- self.basic_ufunc_test(np.arccos, kinds='cf')
162
+ self.basic_ufunc_test(np.arccos, kinds="cf")
146
163
 
147
164
  def test_arctan_ufunc(self):
148
- self.basic_ufunc_test(np.arctan, kinds='cf')
165
+ self.basic_ufunc_test(np.arctan, kinds="cf")
149
166
 
150
167
  def test_arctan2_ufunc(self):
151
- self.basic_ufunc_test(np.arctan2, kinds='f')
168
+ self.basic_ufunc_test(np.arctan2, kinds="f")
152
169
 
153
170
  def test_hypot_ufunc(self):
154
- self.basic_ufunc_test(np.hypot, kinds='f')
171
+ self.basic_ufunc_test(np.hypot, kinds="f")
155
172
 
156
173
  def test_sinh_ufunc(self):
157
- self.basic_ufunc_test(np.sinh, kinds='cf')
174
+ self.basic_ufunc_test(np.sinh, kinds="cf")
158
175
 
159
176
  def test_cosh_ufunc(self):
160
- self.basic_ufunc_test(np.cosh, kinds='cf')
177
+ self.basic_ufunc_test(np.cosh, kinds="cf")
161
178
 
162
179
  def test_tanh_ufunc(self):
163
- self.basic_ufunc_test(np.tanh, kinds='cf')
180
+ self.basic_ufunc_test(np.tanh, kinds="cf")
164
181
 
165
182
  def test_arcsinh_ufunc(self):
166
- self.basic_ufunc_test(np.arcsinh, kinds='cf')
183
+ self.basic_ufunc_test(np.arcsinh, kinds="cf")
167
184
 
168
185
  def test_arccosh_ufunc(self):
169
- self.basic_ufunc_test(np.arccosh, kinds='cf')
186
+ self.basic_ufunc_test(np.arccosh, kinds="cf")
170
187
 
171
188
  def test_arctanh_ufunc(self):
172
189
  # arctanh is only valid is only finite in the range ]-1, 1[
@@ -177,24 +194,30 @@ class TestUFuncs(BasicUFuncTest, TestCase):
177
194
  # used to compile NumPy may differ from the result generated by
178
195
  # llvm. Skipping the integer types in this test avoids failed
179
196
  # tests because of this.
180
- to_skip = [types.Array(types.uint32, 1, 'C'), types.uint32,
181
- types.Array(types.int32, 1, 'C'), types.int32,
182
- types.Array(types.uint64, 1, 'C'), types.uint64,
183
- types.Array(types.int64, 1, 'C'), types.int64]
197
+ to_skip = [
198
+ types.Array(types.uint32, 1, "C"),
199
+ types.uint32,
200
+ types.Array(types.int32, 1, "C"),
201
+ types.int32,
202
+ types.Array(types.uint64, 1, "C"),
203
+ types.uint64,
204
+ types.Array(types.int64, 1, "C"),
205
+ types.int64,
206
+ ]
184
207
 
185
- self.basic_ufunc_test(np.arctanh, skip_inputs=to_skip, kinds='cf')
208
+ self.basic_ufunc_test(np.arctanh, skip_inputs=to_skip, kinds="cf")
186
209
 
187
210
  def test_deg2rad_ufunc(self):
188
- self.basic_ufunc_test(np.deg2rad, kinds='f')
211
+ self.basic_ufunc_test(np.deg2rad, kinds="f")
189
212
 
190
213
  def test_rad2deg_ufunc(self):
191
- self.basic_ufunc_test(np.rad2deg, kinds='f')
214
+ self.basic_ufunc_test(np.rad2deg, kinds="f")
192
215
 
193
216
  def test_degrees_ufunc(self):
194
- self.basic_ufunc_test(np.degrees, kinds='f')
217
+ self.basic_ufunc_test(np.degrees, kinds="f")
195
218
 
196
219
  def test_radians_ufunc(self):
197
- self.basic_ufunc_test(np.radians, kinds='f')
220
+ self.basic_ufunc_test(np.radians, kinds="f")
198
221
 
199
222
  ############################################################################
200
223
  # Comparison functions
@@ -264,14 +287,14 @@ class TestUFuncs(BasicUFuncTest, TestCase):
264
287
  # Mathematical Functions
265
288
 
266
289
  def test_log_ufunc(self):
267
- self.basic_ufunc_test(np.log, kinds='cf')
290
+ self.basic_ufunc_test(np.log, kinds="cf")
268
291
 
269
292
  def test_log2_ufunc(self):
270
- self.basic_ufunc_test(np.log2, kinds='cf')
293
+ self.basic_ufunc_test(np.log2, kinds="cf")
271
294
 
272
295
  def test_log10_ufunc(self):
273
- self.basic_ufunc_test(np.log10, kinds='cf')
296
+ self.basic_ufunc_test(np.log10, kinds="cf")
274
297
 
275
298
 
276
- if __name__ == '__main__':
299
+ if __name__ == "__main__":
277
300
  unittest.main()