numba-cuda 0.19.0__py3-none-any.whl → 0.20.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.
Potentially problematic release.
This version of numba-cuda might be problematic. Click here for more details.
- _numba_cuda_redirector.pth +3 -0
- _numba_cuda_redirector.py +3 -0
- numba_cuda/VERSION +1 -1
- numba_cuda/__init__.py +2 -1
- numba_cuda/_version.py +2 -13
- numba_cuda/numba/cuda/__init__.py +4 -1
- numba_cuda/numba/cuda/_internal/cuda_bf16.py +12708 -1469
- numba_cuda/numba/cuda/_internal/cuda_fp16.py +2656 -8769
- numba_cuda/numba/cuda/api.py +9 -1
- numba_cuda/numba/cuda/api_util.py +3 -0
- numba_cuda/numba/cuda/args.py +3 -0
- numba_cuda/numba/cuda/bf16.py +288 -2
- numba_cuda/numba/cuda/cg.py +3 -0
- numba_cuda/numba/cuda/cgutils.py +5 -2
- numba_cuda/numba/cuda/cloudpickle/__init__.py +21 -0
- numba_cuda/numba/cuda/cloudpickle/cloudpickle.py +1598 -0
- numba_cuda/numba/cuda/cloudpickle/cloudpickle_fast.py +17 -0
- numba_cuda/numba/cuda/codegen.py +4 -1
- numba_cuda/numba/cuda/compiler.py +376 -30
- numba_cuda/numba/cuda/core/analysis.py +319 -0
- numba_cuda/numba/cuda/core/annotations/__init__.py +0 -0
- numba_cuda/numba/cuda/core/annotations/type_annotations.py +304 -0
- numba_cuda/numba/cuda/core/base.py +1289 -0
- numba_cuda/numba/cuda/core/bytecode.py +727 -0
- numba_cuda/numba/cuda/core/caching.py +5 -2
- numba_cuda/numba/cuda/core/callconv.py +3 -0
- numba_cuda/numba/cuda/core/codegen.py +3 -0
- numba_cuda/numba/cuda/core/compiler.py +9 -14
- numba_cuda/numba/cuda/core/compiler_machinery.py +497 -0
- numba_cuda/numba/cuda/core/config.py +747 -0
- numba_cuda/numba/cuda/core/consts.py +124 -0
- numba_cuda/numba/cuda/core/cpu.py +370 -0
- numba_cuda/numba/cuda/core/environment.py +68 -0
- numba_cuda/numba/cuda/core/event.py +511 -0
- numba_cuda/numba/cuda/core/funcdesc.py +330 -0
- numba_cuda/numba/cuda/core/inline_closurecall.py +1889 -0
- numba_cuda/numba/cuda/core/interpreter.py +52 -27
- numba_cuda/numba/cuda/core/ir_utils.py +17 -29
- numba_cuda/numba/cuda/core/options.py +262 -0
- numba_cuda/numba/cuda/core/postproc.py +249 -0
- numba_cuda/numba/cuda/core/pythonapi.py +1868 -0
- numba_cuda/numba/cuda/core/rewrites/__init__.py +26 -0
- numba_cuda/numba/cuda/core/rewrites/ir_print.py +90 -0
- numba_cuda/numba/cuda/core/rewrites/registry.py +104 -0
- numba_cuda/numba/cuda/core/rewrites/static_binop.py +40 -0
- numba_cuda/numba/cuda/core/rewrites/static_getitem.py +187 -0
- numba_cuda/numba/cuda/core/rewrites/static_raise.py +98 -0
- numba_cuda/numba/cuda/core/sigutils.py +3 -0
- numba_cuda/numba/cuda/core/ssa.py +496 -0
- numba_cuda/numba/cuda/core/targetconfig.py +329 -0
- numba_cuda/numba/cuda/core/tracing.py +231 -0
- numba_cuda/numba/cuda/core/transforms.py +952 -0
- numba_cuda/numba/cuda/core/typed_passes.py +741 -7
- numba_cuda/numba/cuda/core/typeinfer.py +1948 -0
- numba_cuda/numba/cuda/core/unsafe/__init__.py +0 -0
- numba_cuda/numba/cuda/core/unsafe/bytes.py +67 -0
- numba_cuda/numba/cuda/core/unsafe/eh.py +66 -0
- numba_cuda/numba/cuda/core/unsafe/refcount.py +98 -0
- numba_cuda/numba/cuda/core/untyped_passes.py +1983 -0
- numba_cuda/numba/cuda/cpython/cmathimpl.py +560 -0
- numba_cuda/numba/cuda/cpython/mathimpl.py +499 -0
- numba_cuda/numba/cuda/cpython/numbers.py +1474 -0
- numba_cuda/numba/cuda/cuda_paths.py +425 -246
- numba_cuda/numba/cuda/cudadecl.py +4 -1
- numba_cuda/numba/cuda/cudadrv/__init__.py +4 -1
- numba_cuda/numba/cuda/cudadrv/devicearray.py +5 -1
- numba_cuda/numba/cuda/cudadrv/devices.py +3 -0
- numba_cuda/numba/cuda/cudadrv/driver.py +14 -140
- numba_cuda/numba/cuda/cudadrv/drvapi.py +3 -0
- numba_cuda/numba/cuda/cudadrv/dummyarray.py +114 -24
- numba_cuda/numba/cuda/cudadrv/enums.py +3 -0
- numba_cuda/numba/cuda/cudadrv/error.py +4 -0
- numba_cuda/numba/cuda/cudadrv/libs.py +8 -5
- numba_cuda/numba/cuda/cudadrv/linkable_code.py +3 -0
- numba_cuda/numba/cuda/cudadrv/mappings.py +4 -1
- numba_cuda/numba/cuda/cudadrv/ndarray.py +3 -0
- numba_cuda/numba/cuda/cudadrv/nvrtc.py +22 -8
- numba_cuda/numba/cuda/cudadrv/nvvm.py +4 -4
- numba_cuda/numba/cuda/cudadrv/rtapi.py +3 -0
- numba_cuda/numba/cuda/cudadrv/runtime.py +4 -1
- numba_cuda/numba/cuda/cudaimpl.py +8 -1
- numba_cuda/numba/cuda/cudamath.py +3 -0
- numba_cuda/numba/cuda/debuginfo.py +88 -2
- numba_cuda/numba/cuda/decorators.py +6 -3
- numba_cuda/numba/cuda/descriptor.py +6 -4
- numba_cuda/numba/cuda/device_init.py +3 -0
- numba_cuda/numba/cuda/deviceufunc.py +69 -2
- numba_cuda/numba/cuda/dispatcher.py +21 -39
- numba_cuda/numba/cuda/errors.py +10 -0
- numba_cuda/numba/cuda/extending.py +3 -0
- numba_cuda/numba/cuda/flags.py +143 -1
- numba_cuda/numba/cuda/fp16.py +3 -2
- numba_cuda/numba/cuda/include/13/cuda_bf16.h +5118 -0
- numba_cuda/numba/cuda/include/13/cuda_bf16.hpp +3865 -0
- numba_cuda/numba/cuda/include/13/cuda_fp16.h +5363 -0
- numba_cuda/numba/cuda/include/13/cuda_fp16.hpp +3483 -0
- numba_cuda/numba/cuda/initialize.py +4 -0
- numba_cuda/numba/cuda/intrinsic_wrapper.py +3 -0
- numba_cuda/numba/cuda/intrinsics.py +3 -0
- numba_cuda/numba/cuda/itanium_mangler.py +3 -0
- numba_cuda/numba/cuda/kernels/__init__.py +2 -0
- numba_cuda/numba/cuda/kernels/reduction.py +3 -0
- numba_cuda/numba/cuda/kernels/transpose.py +3 -0
- numba_cuda/numba/cuda/libdevice.py +4 -0
- numba_cuda/numba/cuda/libdevicedecl.py +3 -0
- numba_cuda/numba/cuda/libdevicefuncs.py +3 -0
- numba_cuda/numba/cuda/libdeviceimpl.py +3 -0
- numba_cuda/numba/cuda/locks.py +3 -0
- numba_cuda/numba/cuda/lowering.py +59 -159
- numba_cuda/numba/cuda/mathimpl.py +5 -1
- numba_cuda/numba/cuda/memory_management/__init__.py +3 -0
- numba_cuda/numba/cuda/memory_management/memsys.cu +5 -0
- numba_cuda/numba/cuda/memory_management/memsys.cuh +5 -0
- numba_cuda/numba/cuda/memory_management/nrt.cu +5 -0
- numba_cuda/numba/cuda/memory_management/nrt.cuh +5 -0
- numba_cuda/numba/cuda/memory_management/nrt.py +48 -18
- numba_cuda/numba/cuda/misc/findlib.py +75 -0
- numba_cuda/numba/cuda/models.py +12 -1
- numba_cuda/numba/cuda/np/npdatetime_helpers.py +217 -0
- numba_cuda/numba/cuda/np/npyfuncs.py +1807 -0
- numba_cuda/numba/cuda/np/numpy_support.py +553 -0
- numba_cuda/numba/cuda/np/ufunc/ufuncbuilder.py +59 -0
- numba_cuda/numba/cuda/nvvmutils.py +4 -1
- numba_cuda/numba/cuda/printimpl.py +15 -1
- numba_cuda/numba/cuda/random.py +4 -1
- numba_cuda/numba/cuda/reshape_funcs.cu +5 -0
- numba_cuda/numba/cuda/serialize.py +4 -1
- numba_cuda/numba/cuda/simulator/__init__.py +4 -1
- numba_cuda/numba/cuda/simulator/_internal/__init__.py +3 -0
- numba_cuda/numba/cuda/simulator/_internal/cuda_bf16.py +2 -0
- numba_cuda/numba/cuda/simulator/api.py +4 -1
- numba_cuda/numba/cuda/simulator/bf16.py +3 -0
- numba_cuda/numba/cuda/simulator/compiler.py +7 -0
- numba_cuda/numba/cuda/simulator/cudadrv/__init__.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/devicearray.py +4 -1
- numba_cuda/numba/cuda/simulator/cudadrv/devices.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/driver.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/drvapi.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/dummyarray.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/error.py +4 -0
- numba_cuda/numba/cuda/simulator/cudadrv/libs.py +4 -0
- numba_cuda/numba/cuda/simulator/cudadrv/linkable_code.py +4 -0
- numba_cuda/numba/cuda/simulator/cudadrv/nvrtc.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/nvvm.py +3 -0
- numba_cuda/numba/cuda/simulator/cudadrv/runtime.py +3 -0
- numba_cuda/numba/cuda/simulator/dispatcher.py +4 -0
- numba_cuda/numba/cuda/simulator/kernel.py +3 -0
- numba_cuda/numba/cuda/simulator/kernelapi.py +4 -1
- numba_cuda/numba/cuda/simulator/memory_management/__init__.py +3 -0
- numba_cuda/numba/cuda/simulator/memory_management/nrt.py +17 -2
- numba_cuda/numba/cuda/simulator/reduction.py +3 -0
- numba_cuda/numba/cuda/simulator/vector_types.py +3 -0
- numba_cuda/numba/cuda/simulator_init.py +3 -0
- numba_cuda/numba/cuda/stubs.py +3 -0
- numba_cuda/numba/cuda/target.py +38 -17
- numba_cuda/numba/cuda/testing.py +7 -19
- numba_cuda/numba/cuda/tests/__init__.py +4 -1
- numba_cuda/numba/cuda/tests/cloudpickle_main_class.py +9 -0
- numba_cuda/numba/cuda/tests/complex_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/core/serialize_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/core/test_itanium_mangler.py +3 -0
- numba_cuda/numba/cuda/tests/core/test_serialize.py +7 -4
- numba_cuda/numba/cuda/tests/cudadrv/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_array_attr.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_context_stack.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_array_slicing.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_auto_context.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_devicerecord.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_driver.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_libraries.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_memory.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_ndarray.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_deallocations.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_detect.py +9 -3
- numba_cuda/numba/cuda/tests/cudadrv/test_emm_plugins.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_events.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_host_alloc.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_init.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_inline_ptx.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_is_fp16.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_linker.py +21 -2
- numba_cuda/numba/cuda/tests/cudadrv/test_managed_alloc.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +5 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_nvrtc.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_nvvm_driver.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_pinned.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_profiler.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_ptds.py +4 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_reset_device.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_runtime.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_select_device.py +3 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_streams.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/cache_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/cache_with_cpu_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/cg_cache_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/extensions_usecases.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/recursion_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_alignment.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array.py +5 -1
- numba_cuda/numba/cuda/tests/cudapy/test_array_alignment.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_args.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_methods.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_atomics.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16.py +542 -2
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16_bindings.py +84 -1
- numba_cuda/numba/cuda/tests/cudapy/test_blackscholes.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_boolean.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_caching.py +4 -3
- numba_cuda/numba/cuda/tests/cudapy/test_casting.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cffi.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_compiler.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_complex.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_complex_kernel.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_const_string.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_constmem.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_cooperative_groups.py +5 -3
- numba_cuda/numba/cuda/tests/cudapy/test_copy_propagate.py +130 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cuda_array_interface.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cuda_jit_no_types.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_datetime.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_debug.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo.py +314 -3
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo_types.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_device_func.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_dispatcher.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_enums.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_errors.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_exception.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_extending.py +5 -1
- numba_cuda/numba/cuda/tests/cudapy/test_fastmath.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_forall.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_freevar.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_frexp_ldexp.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_globals.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scalar.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scheduling.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_idiv.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_inline.py +21 -8
- numba_cuda/numba/cuda/tests/cudapy/test_inspect.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_intrinsics.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ipc.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ir_utils.py +13 -37
- numba_cuda/numba/cuda/tests/cudapy/test_iterators.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_lang.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_laplace.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_libdevice.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_lineinfo.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_localmem.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_mandel.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_math.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_matmul.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_minmax.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_montecarlo.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multigpu.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multiprocessing.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multithreads.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_nondet.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_operator.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_optimization.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_overload.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_powi.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_print.py +23 -0
- numba_cuda/numba/cuda/tests/cudapy/test_py2_div_issue.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_random.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_record_dtype.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_recursion.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_reduction.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_retrieve_autoconverted_arrays.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_serialize.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_slicing.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sm.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_sm_creation.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ssa.py +453 -0
- numba_cuda/numba/cuda/tests/cudapy/test_stream_api.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sync.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_transpose.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_typeinfer.py +538 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ufuncs.py +266 -2
- numba_cuda/numba/cuda/tests/cudapy/test_userexc.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_vector_type.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_complex.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_decor.py +115 -6
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_device.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_scalar_arg.py +3 -0
- numba_cuda/numba/cuda/tests/cudapy/test_warning.py +4 -1
- numba_cuda/numba/cuda/tests/cudapy/test_warp_ops.py +4 -1
- numba_cuda/numba/cuda/tests/cudasim/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/cudasim/support.py +3 -0
- numba_cuda/numba/cuda/tests/cudasim/test_cudasim_issues.py +3 -0
- numba_cuda/numba/cuda/tests/data/__init__.py +2 -0
- numba_cuda/numba/cuda/tests/data/cta_barrier.cu +5 -0
- numba_cuda/numba/cuda/tests/data/cuda_include.cu +5 -0
- numba_cuda/numba/cuda/tests/data/error.cu +5 -0
- numba_cuda/numba/cuda/tests/data/include/add.cuh +5 -0
- numba_cuda/numba/cuda/tests/data/jitlink.cu +5 -0
- numba_cuda/numba/cuda/tests/data/warn.cu +5 -0
- numba_cuda/numba/cuda/tests/doc_examples/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/__init__.py +2 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/functions.cu +5 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/include/mul.cuh +5 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/saxpy.cu +5 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_cg.py +3 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_cpointer.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_cpu_gpu_compat.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_ffi.py +6 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_laplace.py +3 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_matmul.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_montecarlo.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_random.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_reduction.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_sessionize.py +3 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_ufunc.py +3 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_vecadd.py +3 -0
- numba_cuda/numba/cuda/tests/enum_usecases.py +3 -0
- numba_cuda/numba/cuda/tests/nocuda/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/nocuda/test_dummyarray.py +3 -0
- numba_cuda/numba/cuda/tests/nocuda/test_function_resolution.py +3 -0
- numba_cuda/numba/cuda/tests/nocuda/test_import.py +6 -1
- numba_cuda/numba/cuda/tests/nocuda/test_library_lookup.py +27 -12
- numba_cuda/numba/cuda/tests/nocuda/test_nvvm.py +3 -0
- numba_cuda/numba/cuda/tests/nrt/__init__.py +3 -0
- numba_cuda/numba/cuda/tests/nrt/test_nrt.py +5 -1
- numba_cuda/numba/cuda/tests/nrt/test_nrt_refct.py +3 -0
- numba_cuda/numba/cuda/tests/support.py +58 -15
- numba_cuda/numba/cuda/tests/test_binary_generation/Makefile +3 -0
- numba_cuda/numba/cuda/tests/test_binary_generation/generate_raw_ltoir.py +2 -1
- numba_cuda/numba/cuda/tests/test_binary_generation/nrt_extern.cu +5 -0
- numba_cuda/numba/cuda/tests/test_binary_generation/test_device_functions.cu +5 -0
- numba_cuda/numba/cuda/tests/test_binary_generation/undefined_extern.cu +5 -0
- numba_cuda/numba/cuda/tests/test_tracing.py +200 -0
- numba_cuda/numba/cuda/types.py +59 -0
- numba_cuda/numba/cuda/typing/__init__.py +12 -1
- numba_cuda/numba/cuda/typing/cffi_utils.py +55 -0
- numba_cuda/numba/cuda/typing/context.py +751 -0
- numba_cuda/numba/cuda/typing/enumdecl.py +74 -0
- numba_cuda/numba/cuda/typing/npydecl.py +658 -0
- numba_cuda/numba/cuda/typing/templates.py +10 -14
- numba_cuda/numba/cuda/ufuncs.py +6 -3
- numba_cuda/numba/cuda/utils.py +9 -112
- numba_cuda/numba/cuda/vector_types.py +3 -0
- numba_cuda/numba/cuda/vectorizers.py +3 -0
- {numba_cuda-0.19.0.dist-info → numba_cuda-0.20.0.dist-info}/METADATA +6 -2
- numba_cuda-0.20.0.dist-info/RECORD +357 -0
- {numba_cuda-0.19.0.dist-info → numba_cuda-0.20.0.dist-info}/licenses/LICENSE +1 -0
- numba_cuda-0.20.0.dist-info/licenses/LICENSE.numba +24 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_mvc.py +0 -57
- numba_cuda-0.19.0.dist-info/RECORD +0 -301
- {numba_cuda-0.19.0.dist-info → numba_cuda-0.20.0.dist-info}/WHEEL +0 -0
- {numba_cuda-0.19.0.dist-info → numba_cuda-0.20.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: BSD-2-Clause
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Function descriptors.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from collections import defaultdict
|
|
9
|
+
import importlib
|
|
10
|
+
|
|
11
|
+
from numba.core import types
|
|
12
|
+
from numba.cuda import itanium_mangler
|
|
13
|
+
from numba.cuda.utils import _dynamic_modname, _dynamic_module
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def default_mangler(name, argtypes, *, abi_tags=(), uid=None):
|
|
17
|
+
return itanium_mangler.mangle(name, argtypes, abi_tags=abi_tags, uid=uid)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def qualifying_prefix(modname, qualname):
|
|
21
|
+
"""
|
|
22
|
+
Returns a new string that is used for the first half of the mangled name.
|
|
23
|
+
"""
|
|
24
|
+
# XXX choose a different convention for object mode
|
|
25
|
+
return "{}.{}".format(modname, qualname) if modname else qualname
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class FunctionDescriptor(object):
|
|
29
|
+
"""
|
|
30
|
+
Base class for function descriptors: an object used to carry
|
|
31
|
+
useful metadata about a natively callable function.
|
|
32
|
+
|
|
33
|
+
Note that while `FunctionIdentity` denotes a Python function
|
|
34
|
+
which is being concretely compiled by Numba, `FunctionDescriptor`
|
|
35
|
+
may be more "abstract".
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
__slots__ = (
|
|
39
|
+
"native",
|
|
40
|
+
"modname",
|
|
41
|
+
"qualname",
|
|
42
|
+
"doc",
|
|
43
|
+
"typemap",
|
|
44
|
+
"calltypes",
|
|
45
|
+
"args",
|
|
46
|
+
"kws",
|
|
47
|
+
"restype",
|
|
48
|
+
"argtypes",
|
|
49
|
+
"mangled_name",
|
|
50
|
+
"unique_name",
|
|
51
|
+
"env_name",
|
|
52
|
+
"global_dict",
|
|
53
|
+
"inline",
|
|
54
|
+
"noalias",
|
|
55
|
+
"abi_tags",
|
|
56
|
+
"uid",
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def __init__(
|
|
60
|
+
self,
|
|
61
|
+
native,
|
|
62
|
+
modname,
|
|
63
|
+
qualname,
|
|
64
|
+
unique_name,
|
|
65
|
+
doc,
|
|
66
|
+
typemap,
|
|
67
|
+
restype,
|
|
68
|
+
calltypes,
|
|
69
|
+
args,
|
|
70
|
+
kws,
|
|
71
|
+
mangler=None,
|
|
72
|
+
argtypes=None,
|
|
73
|
+
inline=False,
|
|
74
|
+
noalias=False,
|
|
75
|
+
env_name=None,
|
|
76
|
+
global_dict=None,
|
|
77
|
+
abi_tags=(),
|
|
78
|
+
uid=None,
|
|
79
|
+
):
|
|
80
|
+
self.native = native
|
|
81
|
+
self.modname = modname
|
|
82
|
+
self.global_dict = global_dict
|
|
83
|
+
self.qualname = qualname
|
|
84
|
+
self.unique_name = unique_name
|
|
85
|
+
self.doc = doc
|
|
86
|
+
# XXX typemap and calltypes should be on the compile result,
|
|
87
|
+
# not the FunctionDescriptor
|
|
88
|
+
self.typemap = typemap
|
|
89
|
+
self.calltypes = calltypes
|
|
90
|
+
self.args = args
|
|
91
|
+
self.kws = kws
|
|
92
|
+
self.restype = restype
|
|
93
|
+
# Argument types
|
|
94
|
+
if argtypes is not None:
|
|
95
|
+
assert isinstance(argtypes, tuple), argtypes
|
|
96
|
+
self.argtypes = argtypes
|
|
97
|
+
else:
|
|
98
|
+
# Get argument types from the type inference result
|
|
99
|
+
# (note the "arg.FOO" convention as used in typeinfer
|
|
100
|
+
self.argtypes = tuple(self.typemap["arg." + a] for a in args)
|
|
101
|
+
mangler = default_mangler if mangler is None else mangler
|
|
102
|
+
# The mangled name *must* be unique, else the wrong function can
|
|
103
|
+
# be chosen at link time.
|
|
104
|
+
qualprefix = qualifying_prefix(self.modname, self.qualname)
|
|
105
|
+
self.uid = uid
|
|
106
|
+
self.mangled_name = mangler(
|
|
107
|
+
qualprefix,
|
|
108
|
+
self.argtypes,
|
|
109
|
+
abi_tags=abi_tags,
|
|
110
|
+
uid=uid,
|
|
111
|
+
)
|
|
112
|
+
if env_name is None:
|
|
113
|
+
env_name = mangler(
|
|
114
|
+
".NumbaEnv.{}".format(qualprefix),
|
|
115
|
+
self.argtypes,
|
|
116
|
+
abi_tags=abi_tags,
|
|
117
|
+
uid=uid,
|
|
118
|
+
)
|
|
119
|
+
self.env_name = env_name
|
|
120
|
+
self.inline = inline
|
|
121
|
+
self.noalias = noalias
|
|
122
|
+
self.abi_tags = abi_tags
|
|
123
|
+
|
|
124
|
+
def lookup_globals(self):
|
|
125
|
+
"""
|
|
126
|
+
Return the global dictionary of the function.
|
|
127
|
+
It may not match the Module's globals if the function is created
|
|
128
|
+
dynamically (i.e. exec)
|
|
129
|
+
"""
|
|
130
|
+
return self.global_dict or self.lookup_module().__dict__
|
|
131
|
+
|
|
132
|
+
def lookup_module(self):
|
|
133
|
+
"""
|
|
134
|
+
Return the module in which this function is supposed to exist.
|
|
135
|
+
This may be a dummy module if the function was dynamically
|
|
136
|
+
generated or the module can't be found.
|
|
137
|
+
"""
|
|
138
|
+
if self.modname == _dynamic_modname:
|
|
139
|
+
return _dynamic_module
|
|
140
|
+
else:
|
|
141
|
+
try:
|
|
142
|
+
# ensure module exist
|
|
143
|
+
return importlib.import_module(self.modname)
|
|
144
|
+
except ImportError:
|
|
145
|
+
return _dynamic_module
|
|
146
|
+
|
|
147
|
+
def lookup_function(self):
|
|
148
|
+
"""
|
|
149
|
+
Return the original function object described by this object.
|
|
150
|
+
"""
|
|
151
|
+
return getattr(self.lookup_module(), self.qualname)
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def llvm_func_name(self):
|
|
155
|
+
"""
|
|
156
|
+
The LLVM-registered name for the raw function.
|
|
157
|
+
"""
|
|
158
|
+
return self.mangled_name
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def llvm_cpython_wrapper_name(self):
|
|
162
|
+
"""
|
|
163
|
+
The LLVM-registered name for a CPython-compatible wrapper of the
|
|
164
|
+
raw function (i.e. a PyCFunctionWithKeywords).
|
|
165
|
+
"""
|
|
166
|
+
return itanium_mangler.prepend_namespace(
|
|
167
|
+
self.mangled_name, ns="cpython"
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def llvm_cfunc_wrapper_name(self):
|
|
172
|
+
"""
|
|
173
|
+
The LLVM-registered name for a C-compatible wrapper of the
|
|
174
|
+
raw function.
|
|
175
|
+
"""
|
|
176
|
+
return "cfunc." + self.mangled_name
|
|
177
|
+
|
|
178
|
+
def __repr__(self):
|
|
179
|
+
return "<function descriptor %r>" % (self.unique_name)
|
|
180
|
+
|
|
181
|
+
@classmethod
|
|
182
|
+
def _get_function_info(cls, func_ir):
|
|
183
|
+
"""
|
|
184
|
+
Returns
|
|
185
|
+
-------
|
|
186
|
+
qualname, unique_name, modname, doc, args, kws, globals
|
|
187
|
+
|
|
188
|
+
``unique_name`` must be a unique name.
|
|
189
|
+
"""
|
|
190
|
+
func = func_ir.func_id.func
|
|
191
|
+
qualname = func_ir.func_id.func_qualname
|
|
192
|
+
# XXX to func_id
|
|
193
|
+
modname = func.__module__
|
|
194
|
+
doc = func.__doc__ or ""
|
|
195
|
+
args = tuple(func_ir.arg_names)
|
|
196
|
+
kws = () # TODO
|
|
197
|
+
global_dict = None
|
|
198
|
+
|
|
199
|
+
if modname is None:
|
|
200
|
+
# Dynamically generated function.
|
|
201
|
+
modname = _dynamic_modname
|
|
202
|
+
# Retain a reference to the dictionary of the function.
|
|
203
|
+
# This disables caching, serialization and pickling.
|
|
204
|
+
global_dict = func_ir.func_id.func.__globals__
|
|
205
|
+
|
|
206
|
+
unique_name = func_ir.func_id.unique_name
|
|
207
|
+
|
|
208
|
+
return qualname, unique_name, modname, doc, args, kws, global_dict
|
|
209
|
+
|
|
210
|
+
@classmethod
|
|
211
|
+
def _from_python_function(
|
|
212
|
+
cls,
|
|
213
|
+
func_ir,
|
|
214
|
+
typemap,
|
|
215
|
+
restype,
|
|
216
|
+
calltypes,
|
|
217
|
+
native,
|
|
218
|
+
mangler=None,
|
|
219
|
+
inline=False,
|
|
220
|
+
noalias=False,
|
|
221
|
+
abi_tags=(),
|
|
222
|
+
):
|
|
223
|
+
(
|
|
224
|
+
qualname,
|
|
225
|
+
unique_name,
|
|
226
|
+
modname,
|
|
227
|
+
doc,
|
|
228
|
+
args,
|
|
229
|
+
kws,
|
|
230
|
+
global_dict,
|
|
231
|
+
) = cls._get_function_info(func_ir)
|
|
232
|
+
|
|
233
|
+
self = cls(
|
|
234
|
+
native,
|
|
235
|
+
modname,
|
|
236
|
+
qualname,
|
|
237
|
+
unique_name,
|
|
238
|
+
doc,
|
|
239
|
+
typemap,
|
|
240
|
+
restype,
|
|
241
|
+
calltypes,
|
|
242
|
+
args,
|
|
243
|
+
kws,
|
|
244
|
+
mangler=mangler,
|
|
245
|
+
inline=inline,
|
|
246
|
+
noalias=noalias,
|
|
247
|
+
global_dict=global_dict,
|
|
248
|
+
abi_tags=abi_tags,
|
|
249
|
+
uid=func_ir.func_id.unique_id,
|
|
250
|
+
)
|
|
251
|
+
return self
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class PythonFunctionDescriptor(FunctionDescriptor):
|
|
255
|
+
"""
|
|
256
|
+
A FunctionDescriptor subclass for Numba-compiled functions.
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
__slots__ = ()
|
|
260
|
+
|
|
261
|
+
@classmethod
|
|
262
|
+
def from_specialized_function(
|
|
263
|
+
cls,
|
|
264
|
+
func_ir,
|
|
265
|
+
typemap,
|
|
266
|
+
restype,
|
|
267
|
+
calltypes,
|
|
268
|
+
mangler,
|
|
269
|
+
inline,
|
|
270
|
+
noalias,
|
|
271
|
+
abi_tags,
|
|
272
|
+
):
|
|
273
|
+
"""
|
|
274
|
+
Build a FunctionDescriptor for a given specialization of a Python
|
|
275
|
+
function (in nopython mode).
|
|
276
|
+
"""
|
|
277
|
+
return cls._from_python_function(
|
|
278
|
+
func_ir,
|
|
279
|
+
typemap,
|
|
280
|
+
restype,
|
|
281
|
+
calltypes,
|
|
282
|
+
native=True,
|
|
283
|
+
mangler=mangler,
|
|
284
|
+
inline=inline,
|
|
285
|
+
noalias=noalias,
|
|
286
|
+
abi_tags=abi_tags,
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
@classmethod
|
|
290
|
+
def from_object_mode_function(cls, func_ir):
|
|
291
|
+
"""
|
|
292
|
+
Build a FunctionDescriptor for an object mode variant of a Python
|
|
293
|
+
function.
|
|
294
|
+
"""
|
|
295
|
+
typemap = defaultdict(lambda: types.pyobject)
|
|
296
|
+
calltypes = typemap.copy()
|
|
297
|
+
restype = types.pyobject
|
|
298
|
+
return cls._from_python_function(
|
|
299
|
+
func_ir, typemap, restype, calltypes, native=False
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
class ExternalFunctionDescriptor(FunctionDescriptor):
|
|
304
|
+
"""
|
|
305
|
+
A FunctionDescriptor subclass for opaque external functions
|
|
306
|
+
(e.g. raw C functions).
|
|
307
|
+
"""
|
|
308
|
+
|
|
309
|
+
__slots__ = ()
|
|
310
|
+
|
|
311
|
+
def __init__(self, name, restype, argtypes):
|
|
312
|
+
args = ["arg%d" % i for i in range(len(argtypes))]
|
|
313
|
+
|
|
314
|
+
def mangler(a, x, abi_tags, uid=None):
|
|
315
|
+
return a
|
|
316
|
+
|
|
317
|
+
super(ExternalFunctionDescriptor, self).__init__(
|
|
318
|
+
native=True,
|
|
319
|
+
modname=None,
|
|
320
|
+
qualname=name,
|
|
321
|
+
unique_name=name,
|
|
322
|
+
doc="",
|
|
323
|
+
typemap=None,
|
|
324
|
+
restype=restype,
|
|
325
|
+
calltypes=None,
|
|
326
|
+
args=args,
|
|
327
|
+
kws=None,
|
|
328
|
+
mangler=mangler,
|
|
329
|
+
argtypes=argtypes,
|
|
330
|
+
)
|