numba-cuda 0.19.1__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/VERSION +1 -1
- numba_cuda/numba/cuda/__init__.py +1 -1
- numba_cuda/numba/cuda/_internal/cuda_bf16.py +12706 -1470
- numba_cuda/numba/cuda/_internal/cuda_fp16.py +2653 -8769
- numba_cuda/numba/cuda/api.py +6 -1
- numba_cuda/numba/cuda/bf16.py +285 -2
- numba_cuda/numba/cuda/cgutils.py +2 -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 +1 -1
- numba_cuda/numba/cuda/compiler.py +373 -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 +2 -2
- numba_cuda/numba/cuda/core/compiler.py +6 -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 +48 -26
- numba_cuda/numba/cuda/core/ir_utils.py +15 -26
- 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/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 +738 -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 +422 -246
- numba_cuda/numba/cuda/cudadecl.py +1 -1
- numba_cuda/numba/cuda/cudadrv/__init__.py +1 -1
- numba_cuda/numba/cuda/cudadrv/devicearray.py +2 -1
- numba_cuda/numba/cuda/cudadrv/driver.py +11 -140
- numba_cuda/numba/cuda/cudadrv/dummyarray.py +111 -24
- numba_cuda/numba/cuda/cudadrv/libs.py +5 -5
- numba_cuda/numba/cuda/cudadrv/mappings.py +1 -1
- numba_cuda/numba/cuda/cudadrv/nvrtc.py +19 -8
- numba_cuda/numba/cuda/cudadrv/nvvm.py +1 -4
- numba_cuda/numba/cuda/cudadrv/runtime.py +1 -1
- numba_cuda/numba/cuda/cudaimpl.py +5 -1
- numba_cuda/numba/cuda/debuginfo.py +85 -2
- numba_cuda/numba/cuda/decorators.py +3 -3
- numba_cuda/numba/cuda/descriptor.py +3 -4
- numba_cuda/numba/cuda/deviceufunc.py +66 -2
- numba_cuda/numba/cuda/dispatcher.py +18 -39
- numba_cuda/numba/cuda/flags.py +141 -1
- numba_cuda/numba/cuda/fp16.py +0 -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/lowering.py +7 -144
- numba_cuda/numba/cuda/mathimpl.py +2 -1
- numba_cuda/numba/cuda/memory_management/nrt.py +43 -17
- numba_cuda/numba/cuda/misc/findlib.py +75 -0
- numba_cuda/numba/cuda/models.py +9 -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 +1 -1
- numba_cuda/numba/cuda/printimpl.py +12 -1
- numba_cuda/numba/cuda/random.py +1 -1
- numba_cuda/numba/cuda/serialize.py +1 -1
- numba_cuda/numba/cuda/simulator/__init__.py +1 -1
- numba_cuda/numba/cuda/simulator/api.py +1 -1
- numba_cuda/numba/cuda/simulator/compiler.py +4 -0
- numba_cuda/numba/cuda/simulator/cudadrv/devicearray.py +1 -1
- numba_cuda/numba/cuda/simulator/kernelapi.py +1 -1
- numba_cuda/numba/cuda/simulator/memory_management/nrt.py +14 -2
- numba_cuda/numba/cuda/target.py +35 -17
- numba_cuda/numba/cuda/testing.py +4 -19
- numba_cuda/numba/cuda/tests/__init__.py +1 -1
- numba_cuda/numba/cuda/tests/cloudpickle_main_class.py +9 -0
- numba_cuda/numba/cuda/tests/core/test_serialize.py +4 -4
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_devicerecord.py +1 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_libraries.py +1 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_deallocations.py +1 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_detect.py +6 -3
- numba_cuda/numba/cuda/tests/cudadrv/test_emm_plugins.py +1 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_linker.py +18 -2
- numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +2 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py +1 -1
- numba_cuda/numba/cuda/tests/cudadrv/test_ptds.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/extensions_usecases.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_array.py +2 -1
- numba_cuda/numba/cuda/tests/cudapy/test_atomics.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16.py +539 -2
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16_bindings.py +81 -1
- numba_cuda/numba/cuda/tests/cudapy/test_caching.py +1 -3
- numba_cuda/numba/cuda/tests/cudapy/test_complex.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_constmem.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_cooperative_groups.py +2 -3
- numba_cuda/numba/cuda/tests/cudapy/test_copy_propagate.py +130 -0
- numba_cuda/numba/cuda/tests/cudapy/test_datetime.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_debug.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo.py +293 -4
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo_types.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_dispatcher.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_errors.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_exception.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_extending.py +2 -1
- numba_cuda/numba/cuda/tests/cudapy/test_inline.py +18 -8
- numba_cuda/numba/cuda/tests/cudapy/test_ir_utils.py +10 -37
- numba_cuda/numba/cuda/tests/cudapy/test_laplace.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_math.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_matmul.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_operator.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_print.py +20 -0
- numba_cuda/numba/cuda/tests/cudapy/test_record_dtype.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_reduction.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_serialize.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_sm.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_ssa.py +453 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sync.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_typeinfer.py +538 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ufuncs.py +263 -2
- numba_cuda/numba/cuda/tests/cudapy/test_userexc.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_vector_type.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_decor.py +112 -6
- numba_cuda/numba/cuda/tests/cudapy/test_warning.py +1 -1
- numba_cuda/numba/cuda/tests/cudapy/test_warp_ops.py +1 -1
- numba_cuda/numba/cuda/tests/doc_examples/test_cg.py +0 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_ffi.py +3 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_laplace.py +0 -2
- numba_cuda/numba/cuda/tests/doc_examples/test_sessionize.py +0 -2
- numba_cuda/numba/cuda/tests/nocuda/test_import.py +3 -1
- numba_cuda/numba/cuda/tests/nocuda/test_library_lookup.py +24 -12
- numba_cuda/numba/cuda/tests/nrt/test_nrt.py +2 -1
- numba_cuda/numba/cuda/tests/support.py +55 -15
- numba_cuda/numba/cuda/tests/test_tracing.py +200 -0
- numba_cuda/numba/cuda/types.py +56 -0
- numba_cuda/numba/cuda/typing/__init__.py +9 -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 +7 -6
- numba_cuda/numba/cuda/ufuncs.py +3 -3
- numba_cuda/numba/cuda/utils.py +6 -112
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/METADATA +2 -1
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/RECORD +170 -115
- numba_cuda/numba/cuda/tests/cudadrv/test_mvc.py +0 -60
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/WHEEL +0 -0
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/licenses/LICENSE +0 -0
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/licenses/LICENSE.numba +0 -0
- {numba_cuda-0.19.1.dist-info → numba_cuda-0.20.0.dist-info}/top_level.txt +0 -0
numba_cuda/numba/cuda/utils.py
CHANGED
|
@@ -28,13 +28,16 @@ from inspect import signature as pysignature # noqa: F401
|
|
|
28
28
|
from inspect import Signature as pySignature # noqa: F401
|
|
29
29
|
from inspect import Parameter as pyParameter # noqa: F401
|
|
30
30
|
|
|
31
|
-
from numba.core.config import (
|
|
31
|
+
from numba.cuda.core.config import (
|
|
32
32
|
MACHINE_BITS, # noqa: F401
|
|
33
33
|
DEVELOPER_MODE,
|
|
34
34
|
) # noqa: F401
|
|
35
|
-
from numba.core import types, config
|
|
36
35
|
|
|
37
|
-
from
|
|
36
|
+
from numba.cuda.core import config
|
|
37
|
+
|
|
38
|
+
from collections.abc import Mapping, MutableSet, MutableMapping
|
|
39
|
+
|
|
40
|
+
PYVERSION = config.PYVERSION
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
def erase_traceback(exc_value):
|
|
@@ -572,115 +575,6 @@ def get_nargs_range(pyfunc):
|
|
|
572
575
|
return min_nargs, max_nargs
|
|
573
576
|
|
|
574
577
|
|
|
575
|
-
def unify_function_types(numba_types):
|
|
576
|
-
"""Return a normalized tuple of Numba function types so that
|
|
577
|
-
|
|
578
|
-
Tuple(numba_types)
|
|
579
|
-
|
|
580
|
-
becomes
|
|
581
|
-
|
|
582
|
-
UniTuple(dtype=<unified function type>, count=len(numba_types))
|
|
583
|
-
|
|
584
|
-
If the above transformation would be incorrect, return the
|
|
585
|
-
original input as given. For instance, if the input tuple contains
|
|
586
|
-
types that are not function or dispatcher type, the transformation
|
|
587
|
-
is considered incorrect.
|
|
588
|
-
"""
|
|
589
|
-
dtype = unified_function_type(numba_types)
|
|
590
|
-
if dtype is None:
|
|
591
|
-
return numba_types
|
|
592
|
-
return (dtype,) * len(numba_types)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
def unified_function_type(numba_types, require_precise=True):
|
|
596
|
-
"""Returns a unified Numba function type if possible.
|
|
597
|
-
|
|
598
|
-
Parameters
|
|
599
|
-
----------
|
|
600
|
-
numba_types : Sequence of numba Type instances.
|
|
601
|
-
require_precise : bool
|
|
602
|
-
If True, the returned Numba function type must be precise.
|
|
603
|
-
|
|
604
|
-
Returns
|
|
605
|
-
-------
|
|
606
|
-
typ : {numba.core.types.Type, None}
|
|
607
|
-
A unified Numba function type. Or ``None`` when the Numba types
|
|
608
|
-
cannot be unified, e.g. when the ``numba_types`` contains at
|
|
609
|
-
least two different Numba function type instances.
|
|
610
|
-
|
|
611
|
-
If ``numba_types`` contains a Numba dispatcher type, the unified
|
|
612
|
-
Numba function type will be an imprecise ``UndefinedFunctionType``
|
|
613
|
-
instance, or None when ``require_precise=True`` is specified.
|
|
614
|
-
|
|
615
|
-
Specifying ``require_precise=False`` enables unifying imprecise
|
|
616
|
-
Numba dispatcher instances when used in tuples or if-then branches
|
|
617
|
-
when the precise Numba function cannot be determined on the first
|
|
618
|
-
occurrence that is not a call expression.
|
|
619
|
-
"""
|
|
620
|
-
from numba.core.errors import NumbaExperimentalFeatureWarning
|
|
621
|
-
|
|
622
|
-
if not (
|
|
623
|
-
isinstance(numba_types, Sequence)
|
|
624
|
-
and len(numba_types) > 0
|
|
625
|
-
and isinstance(numba_types[0], (types.Dispatcher, types.FunctionType))
|
|
626
|
-
):
|
|
627
|
-
return
|
|
628
|
-
|
|
629
|
-
warnings.warn(
|
|
630
|
-
"First-class function type feature is experimental",
|
|
631
|
-
category=NumbaExperimentalFeatureWarning,
|
|
632
|
-
)
|
|
633
|
-
|
|
634
|
-
mnargs, mxargs = None, None
|
|
635
|
-
dispatchers = set()
|
|
636
|
-
function = None
|
|
637
|
-
undefined_function = None
|
|
638
|
-
|
|
639
|
-
for t in numba_types:
|
|
640
|
-
if isinstance(t, types.Dispatcher):
|
|
641
|
-
mnargs1, mxargs1 = get_nargs_range(t.dispatcher.py_func)
|
|
642
|
-
if mnargs is None:
|
|
643
|
-
mnargs, mxargs = mnargs1, mxargs1
|
|
644
|
-
elif not (mnargs, mxargs) == (mnargs1, mxargs1):
|
|
645
|
-
return
|
|
646
|
-
dispatchers.add(t.dispatcher)
|
|
647
|
-
t = t.dispatcher.get_function_type()
|
|
648
|
-
if t is None:
|
|
649
|
-
continue
|
|
650
|
-
if isinstance(t, types.FunctionType):
|
|
651
|
-
if mnargs is None:
|
|
652
|
-
mnargs = mxargs = t.nargs
|
|
653
|
-
elif not (mnargs == mxargs == t.nargs):
|
|
654
|
-
return
|
|
655
|
-
if isinstance(t, types.UndefinedFunctionType):
|
|
656
|
-
if undefined_function is None:
|
|
657
|
-
undefined_function = t
|
|
658
|
-
else:
|
|
659
|
-
# Refuse to unify using function type
|
|
660
|
-
return
|
|
661
|
-
dispatchers.update(t.dispatchers)
|
|
662
|
-
else:
|
|
663
|
-
if function is None:
|
|
664
|
-
function = t
|
|
665
|
-
else:
|
|
666
|
-
assert function == t
|
|
667
|
-
else:
|
|
668
|
-
return
|
|
669
|
-
if require_precise and (function is None or undefined_function is not None):
|
|
670
|
-
return
|
|
671
|
-
if function is not None:
|
|
672
|
-
if undefined_function is not None:
|
|
673
|
-
assert function.nargs == undefined_function.nargs
|
|
674
|
-
function = undefined_function
|
|
675
|
-
elif undefined_function is not None:
|
|
676
|
-
undefined_function.dispatchers.update(dispatchers)
|
|
677
|
-
function = undefined_function
|
|
678
|
-
else:
|
|
679
|
-
function = types.UndefinedFunctionType(mnargs, dispatchers)
|
|
680
|
-
|
|
681
|
-
return function
|
|
682
|
-
|
|
683
|
-
|
|
684
578
|
class _RedirectSubpackage(ModuleType):
|
|
685
579
|
"""Redirect a subpackage to a subpackage.
|
|
686
580
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numba-cuda
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: CUDA target for Numba
|
|
5
5
|
Author: Anaconda Inc., NVIDIA Corporation
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -39,6 +39,7 @@ Requires-Dist: cffi; extra == "test"
|
|
|
39
39
|
Requires-Dist: pytest; extra == "test"
|
|
40
40
|
Requires-Dist: pytest-xdist; extra == "test"
|
|
41
41
|
Requires-Dist: filecheck; extra == "test"
|
|
42
|
+
Requires-Dist: ml_dtypes; extra == "test"
|
|
42
43
|
Provides-Extra: test-cu12
|
|
43
44
|
Requires-Dist: numba-cuda[cu12]; extra == "test-cu12"
|
|
44
45
|
Requires-Dist: numba-cuda[test]; extra == "test-cu12"
|