numba-cuda 0.21.1__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- _numba_cuda_redirector.pth +4 -0
- _numba_cuda_redirector.py +89 -0
- numba_cuda/VERSION +1 -0
- numba_cuda/__init__.py +6 -0
- numba_cuda/_version.py +11 -0
- numba_cuda/numba/cuda/__init__.py +70 -0
- numba_cuda/numba/cuda/_internal/cuda_bf16.py +16394 -0
- numba_cuda/numba/cuda/_internal/cuda_fp16.py +8112 -0
- numba_cuda/numba/cuda/api.py +577 -0
- numba_cuda/numba/cuda/api_util.py +76 -0
- numba_cuda/numba/cuda/args.py +72 -0
- numba_cuda/numba/cuda/bf16.py +397 -0
- numba_cuda/numba/cuda/cache_hints.py +287 -0
- numba_cuda/numba/cuda/cext/__init__.py +2 -0
- numba_cuda/numba/cuda/cext/_devicearray.cp313-win_amd64.pyd +0 -0
- numba_cuda/numba/cuda/cext/_devicearray.cpp +159 -0
- numba_cuda/numba/cuda/cext/_devicearray.h +29 -0
- numba_cuda/numba/cuda/cext/_dispatcher.cp313-win_amd64.pyd +0 -0
- numba_cuda/numba/cuda/cext/_dispatcher.cpp +1098 -0
- numba_cuda/numba/cuda/cext/_hashtable.cpp +532 -0
- numba_cuda/numba/cuda/cext/_hashtable.h +135 -0
- numba_cuda/numba/cuda/cext/_helperlib.c +71 -0
- numba_cuda/numba/cuda/cext/_helperlib.cp313-win_amd64.pyd +0 -0
- numba_cuda/numba/cuda/cext/_helpermod.c +82 -0
- numba_cuda/numba/cuda/cext/_pymodule.h +38 -0
- numba_cuda/numba/cuda/cext/_typeconv.cp313-win_amd64.pyd +0 -0
- numba_cuda/numba/cuda/cext/_typeconv.cpp +206 -0
- numba_cuda/numba/cuda/cext/_typeof.cpp +1159 -0
- numba_cuda/numba/cuda/cext/_typeof.h +19 -0
- numba_cuda/numba/cuda/cext/capsulethunk.h +111 -0
- numba_cuda/numba/cuda/cext/mviewbuf.c +385 -0
- numba_cuda/numba/cuda/cext/mviewbuf.cp313-win_amd64.pyd +0 -0
- numba_cuda/numba/cuda/cext/typeconv.cpp +212 -0
- numba_cuda/numba/cuda/cext/typeconv.hpp +101 -0
- numba_cuda/numba/cuda/cg.py +67 -0
- numba_cuda/numba/cuda/cgutils.py +1294 -0
- 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 +541 -0
- numba_cuda/numba/cuda/compiler.py +1396 -0
- numba_cuda/numba/cuda/core/analysis.py +758 -0
- numba_cuda/numba/cuda/core/annotations/__init__.py +0 -0
- numba_cuda/numba/cuda/core/annotations/pretty_annotate.py +288 -0
- numba_cuda/numba/cuda/core/annotations/type_annotations.py +305 -0
- numba_cuda/numba/cuda/core/base.py +1332 -0
- numba_cuda/numba/cuda/core/boxing.py +1411 -0
- numba_cuda/numba/cuda/core/bytecode.py +728 -0
- numba_cuda/numba/cuda/core/byteflow.py +2346 -0
- numba_cuda/numba/cuda/core/caching.py +744 -0
- numba_cuda/numba/cuda/core/callconv.py +392 -0
- numba_cuda/numba/cuda/core/codegen.py +171 -0
- numba_cuda/numba/cuda/core/compiler.py +199 -0
- numba_cuda/numba/cuda/core/compiler_lock.py +85 -0
- numba_cuda/numba/cuda/core/compiler_machinery.py +497 -0
- numba_cuda/numba/cuda/core/config.py +650 -0
- numba_cuda/numba/cuda/core/consts.py +124 -0
- numba_cuda/numba/cuda/core/controlflow.py +989 -0
- numba_cuda/numba/cuda/core/entrypoints.py +57 -0
- numba_cuda/numba/cuda/core/environment.py +66 -0
- numba_cuda/numba/cuda/core/errors.py +917 -0
- numba_cuda/numba/cuda/core/event.py +511 -0
- numba_cuda/numba/cuda/core/funcdesc.py +330 -0
- numba_cuda/numba/cuda/core/generators.py +387 -0
- numba_cuda/numba/cuda/core/imputils.py +509 -0
- numba_cuda/numba/cuda/core/inline_closurecall.py +1787 -0
- numba_cuda/numba/cuda/core/interpreter.py +3617 -0
- numba_cuda/numba/cuda/core/ir.py +1812 -0
- numba_cuda/numba/cuda/core/ir_utils.py +2638 -0
- numba_cuda/numba/cuda/core/optional.py +129 -0
- 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 +1859 -0
- numba_cuda/numba/cuda/core/registry.py +46 -0
- numba_cuda/numba/cuda/core/removerefctpass.py +123 -0
- numba_cuda/numba/cuda/core/rewrites/__init__.py +26 -0
- numba_cuda/numba/cuda/core/rewrites/ir_print.py +91 -0
- numba_cuda/numba/cuda/core/rewrites/registry.py +104 -0
- numba_cuda/numba/cuda/core/rewrites/static_binop.py +41 -0
- numba_cuda/numba/cuda/core/rewrites/static_getitem.py +189 -0
- numba_cuda/numba/cuda/core/rewrites/static_raise.py +100 -0
- numba_cuda/numba/cuda/core/sigutils.py +68 -0
- numba_cuda/numba/cuda/core/ssa.py +498 -0
- numba_cuda/numba/cuda/core/targetconfig.py +330 -0
- numba_cuda/numba/cuda/core/tracing.py +231 -0
- numba_cuda/numba/cuda/core/transforms.py +956 -0
- numba_cuda/numba/cuda/core/typed_passes.py +867 -0
- numba_cuda/numba/cuda/core/typeinfer.py +1950 -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 +67 -0
- numba_cuda/numba/cuda/core/unsafe/refcount.py +98 -0
- numba_cuda/numba/cuda/core/untyped_passes.py +1979 -0
- numba_cuda/numba/cuda/cpython/builtins.py +1153 -0
- numba_cuda/numba/cuda/cpython/charseq.py +1218 -0
- numba_cuda/numba/cuda/cpython/cmathimpl.py +560 -0
- numba_cuda/numba/cuda/cpython/enumimpl.py +103 -0
- numba_cuda/numba/cuda/cpython/iterators.py +167 -0
- numba_cuda/numba/cuda/cpython/listobj.py +1326 -0
- numba_cuda/numba/cuda/cpython/mathimpl.py +499 -0
- numba_cuda/numba/cuda/cpython/numbers.py +1475 -0
- numba_cuda/numba/cuda/cpython/rangeobj.py +289 -0
- numba_cuda/numba/cuda/cpython/slicing.py +322 -0
- numba_cuda/numba/cuda/cpython/tupleobj.py +456 -0
- numba_cuda/numba/cuda/cpython/unicode.py +2865 -0
- numba_cuda/numba/cuda/cpython/unicode_support.py +1597 -0
- numba_cuda/numba/cuda/cpython/unsafe/__init__.py +0 -0
- numba_cuda/numba/cuda/cpython/unsafe/numbers.py +64 -0
- numba_cuda/numba/cuda/cpython/unsafe/tuple.py +92 -0
- numba_cuda/numba/cuda/cuda_paths.py +691 -0
- numba_cuda/numba/cuda/cudadecl.py +556 -0
- numba_cuda/numba/cuda/cudadrv/__init__.py +14 -0
- numba_cuda/numba/cuda/cudadrv/devicearray.py +951 -0
- numba_cuda/numba/cuda/cudadrv/devices.py +249 -0
- numba_cuda/numba/cuda/cudadrv/driver.py +3222 -0
- numba_cuda/numba/cuda/cudadrv/drvapi.py +435 -0
- numba_cuda/numba/cuda/cudadrv/dummyarray.py +558 -0
- numba_cuda/numba/cuda/cudadrv/enums.py +613 -0
- numba_cuda/numba/cuda/cudadrv/error.py +48 -0
- numba_cuda/numba/cuda/cudadrv/libs.py +220 -0
- numba_cuda/numba/cuda/cudadrv/linkable_code.py +184 -0
- numba_cuda/numba/cuda/cudadrv/mappings.py +14 -0
- numba_cuda/numba/cuda/cudadrv/ndarray.py +26 -0
- numba_cuda/numba/cuda/cudadrv/nvrtc.py +193 -0
- numba_cuda/numba/cuda/cudadrv/nvvm.py +756 -0
- numba_cuda/numba/cuda/cudadrv/rtapi.py +13 -0
- numba_cuda/numba/cuda/cudadrv/runtime.py +34 -0
- numba_cuda/numba/cuda/cudaimpl.py +995 -0
- numba_cuda/numba/cuda/cudamath.py +149 -0
- numba_cuda/numba/cuda/datamodel/__init__.py +7 -0
- numba_cuda/numba/cuda/datamodel/cuda_manager.py +66 -0
- numba_cuda/numba/cuda/datamodel/cuda_models.py +1446 -0
- numba_cuda/numba/cuda/datamodel/cuda_packer.py +224 -0
- numba_cuda/numba/cuda/datamodel/cuda_registry.py +22 -0
- numba_cuda/numba/cuda/datamodel/cuda_testing.py +153 -0
- numba_cuda/numba/cuda/datamodel/manager.py +11 -0
- numba_cuda/numba/cuda/datamodel/models.py +9 -0
- numba_cuda/numba/cuda/datamodel/packer.py +9 -0
- numba_cuda/numba/cuda/datamodel/registry.py +11 -0
- numba_cuda/numba/cuda/datamodel/testing.py +11 -0
- numba_cuda/numba/cuda/debuginfo.py +903 -0
- numba_cuda/numba/cuda/decorators.py +294 -0
- numba_cuda/numba/cuda/descriptor.py +35 -0
- numba_cuda/numba/cuda/device_init.py +158 -0
- numba_cuda/numba/cuda/deviceufunc.py +1021 -0
- numba_cuda/numba/cuda/dispatcher.py +2463 -0
- numba_cuda/numba/cuda/errors.py +72 -0
- numba_cuda/numba/cuda/extending.py +697 -0
- numba_cuda/numba/cuda/flags.py +178 -0
- numba_cuda/numba/cuda/fp16.py +357 -0
- numba_cuda/numba/cuda/include/12/cuda_bf16.h +5118 -0
- numba_cuda/numba/cuda/include/12/cuda_bf16.hpp +3865 -0
- numba_cuda/numba/cuda/include/12/cuda_fp16.h +5363 -0
- numba_cuda/numba/cuda/include/12/cuda_fp16.hpp +3483 -0
- 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 +24 -0
- numba_cuda/numba/cuda/intrinsic_wrapper.py +41 -0
- numba_cuda/numba/cuda/intrinsics.py +382 -0
- numba_cuda/numba/cuda/itanium_mangler.py +214 -0
- numba_cuda/numba/cuda/kernels/__init__.py +2 -0
- numba_cuda/numba/cuda/kernels/reduction.py +265 -0
- numba_cuda/numba/cuda/kernels/transpose.py +65 -0
- numba_cuda/numba/cuda/libdevice.py +3386 -0
- numba_cuda/numba/cuda/libdevicedecl.py +20 -0
- numba_cuda/numba/cuda/libdevicefuncs.py +1060 -0
- numba_cuda/numba/cuda/libdeviceimpl.py +88 -0
- numba_cuda/numba/cuda/locks.py +19 -0
- numba_cuda/numba/cuda/lowering.py +1951 -0
- numba_cuda/numba/cuda/mathimpl.py +374 -0
- numba_cuda/numba/cuda/memory_management/__init__.py +4 -0
- numba_cuda/numba/cuda/memory_management/memsys.cu +99 -0
- numba_cuda/numba/cuda/memory_management/memsys.cuh +22 -0
- numba_cuda/numba/cuda/memory_management/nrt.cu +212 -0
- numba_cuda/numba/cuda/memory_management/nrt.cuh +48 -0
- numba_cuda/numba/cuda/memory_management/nrt.py +390 -0
- numba_cuda/numba/cuda/memory_management/nrt_context.py +438 -0
- numba_cuda/numba/cuda/misc/appdirs.py +594 -0
- numba_cuda/numba/cuda/misc/cffiimpl.py +24 -0
- numba_cuda/numba/cuda/misc/coverage_support.py +43 -0
- numba_cuda/numba/cuda/misc/dump_style.py +41 -0
- numba_cuda/numba/cuda/misc/findlib.py +75 -0
- numba_cuda/numba/cuda/misc/firstlinefinder.py +96 -0
- numba_cuda/numba/cuda/misc/gdb_hook.py +240 -0
- numba_cuda/numba/cuda/misc/literal.py +28 -0
- numba_cuda/numba/cuda/misc/llvm_pass_timings.py +412 -0
- numba_cuda/numba/cuda/misc/special.py +94 -0
- numba_cuda/numba/cuda/models.py +56 -0
- numba_cuda/numba/cuda/np/arraymath.py +5130 -0
- numba_cuda/numba/cuda/np/arrayobj.py +7635 -0
- numba_cuda/numba/cuda/np/extensions.py +11 -0
- numba_cuda/numba/cuda/np/linalg.py +3087 -0
- numba_cuda/numba/cuda/np/math/__init__.py +0 -0
- numba_cuda/numba/cuda/np/math/cmathimpl.py +558 -0
- numba_cuda/numba/cuda/np/math/mathimpl.py +487 -0
- numba_cuda/numba/cuda/np/math/numbers.py +1461 -0
- numba_cuda/numba/cuda/np/npdatetime.py +969 -0
- numba_cuda/numba/cuda/np/npdatetime_helpers.py +217 -0
- numba_cuda/numba/cuda/np/npyfuncs.py +1808 -0
- numba_cuda/numba/cuda/np/npyimpl.py +1027 -0
- numba_cuda/numba/cuda/np/numpy_support.py +798 -0
- numba_cuda/numba/cuda/np/polynomial/__init__.py +4 -0
- numba_cuda/numba/cuda/np/polynomial/polynomial_core.py +242 -0
- numba_cuda/numba/cuda/np/polynomial/polynomial_functions.py +380 -0
- numba_cuda/numba/cuda/np/ufunc/__init__.py +4 -0
- numba_cuda/numba/cuda/np/ufunc/decorators.py +203 -0
- numba_cuda/numba/cuda/np/ufunc/sigparse.py +68 -0
- numba_cuda/numba/cuda/np/ufunc/ufuncbuilder.py +65 -0
- numba_cuda/numba/cuda/np/ufunc_db.py +1282 -0
- numba_cuda/numba/cuda/np/unsafe/__init__.py +0 -0
- numba_cuda/numba/cuda/np/unsafe/ndarray.py +84 -0
- numba_cuda/numba/cuda/nvvmutils.py +254 -0
- numba_cuda/numba/cuda/printimpl.py +126 -0
- numba_cuda/numba/cuda/random.py +308 -0
- numba_cuda/numba/cuda/reshape_funcs.cu +156 -0
- numba_cuda/numba/cuda/serialize.py +267 -0
- numba_cuda/numba/cuda/simulator/__init__.py +63 -0
- numba_cuda/numba/cuda/simulator/_internal/__init__.py +4 -0
- numba_cuda/numba/cuda/simulator/_internal/cuda_bf16.py +2 -0
- numba_cuda/numba/cuda/simulator/api.py +179 -0
- numba_cuda/numba/cuda/simulator/bf16.py +4 -0
- numba_cuda/numba/cuda/simulator/compiler.py +38 -0
- numba_cuda/numba/cuda/simulator/cudadrv/__init__.py +11 -0
- numba_cuda/numba/cuda/simulator/cudadrv/devicearray.py +462 -0
- numba_cuda/numba/cuda/simulator/cudadrv/devices.py +122 -0
- numba_cuda/numba/cuda/simulator/cudadrv/driver.py +66 -0
- numba_cuda/numba/cuda/simulator/cudadrv/drvapi.py +7 -0
- numba_cuda/numba/cuda/simulator/cudadrv/dummyarray.py +7 -0
- numba_cuda/numba/cuda/simulator/cudadrv/error.py +10 -0
- numba_cuda/numba/cuda/simulator/cudadrv/libs.py +10 -0
- numba_cuda/numba/cuda/simulator/cudadrv/linkable_code.py +61 -0
- numba_cuda/numba/cuda/simulator/cudadrv/nvrtc.py +11 -0
- numba_cuda/numba/cuda/simulator/cudadrv/nvvm.py +32 -0
- numba_cuda/numba/cuda/simulator/cudadrv/runtime.py +22 -0
- numba_cuda/numba/cuda/simulator/dispatcher.py +11 -0
- numba_cuda/numba/cuda/simulator/kernel.py +320 -0
- numba_cuda/numba/cuda/simulator/kernelapi.py +509 -0
- numba_cuda/numba/cuda/simulator/memory_management/__init__.py +4 -0
- numba_cuda/numba/cuda/simulator/memory_management/nrt.py +21 -0
- numba_cuda/numba/cuda/simulator/reduction.py +19 -0
- numba_cuda/numba/cuda/simulator/tests/support.py +4 -0
- numba_cuda/numba/cuda/simulator/vector_types.py +65 -0
- numba_cuda/numba/cuda/simulator_init.py +18 -0
- numba_cuda/numba/cuda/stubs.py +635 -0
- numba_cuda/numba/cuda/target.py +505 -0
- numba_cuda/numba/cuda/testing.py +347 -0
- numba_cuda/numba/cuda/tests/__init__.py +62 -0
- numba_cuda/numba/cuda/tests/benchmarks/__init__.py +0 -0
- numba_cuda/numba/cuda/tests/benchmarks/test_kernel_launch.py +119 -0
- numba_cuda/numba/cuda/tests/cloudpickle_main_class.py +9 -0
- numba_cuda/numba/cuda/tests/core/serialize_usecases.py +113 -0
- numba_cuda/numba/cuda/tests/core/test_itanium_mangler.py +83 -0
- numba_cuda/numba/cuda/tests/core/test_serialize.py +371 -0
- numba_cuda/numba/cuda/tests/cudadrv/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_array_attr.py +147 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_context_stack.py +161 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_array_slicing.py +397 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_auto_context.py +24 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_devicerecord.py +180 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_driver.py +313 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_memory.py +187 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_cuda_ndarray.py +621 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_deallocations.py +247 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_detect.py +100 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_emm_plugins.py +198 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_events.py +53 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_host_alloc.py +72 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_init.py +138 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_inline_ptx.py +43 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_is_fp16.py +15 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_linkable_code.py +58 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_linker.py +348 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_managed_alloc.py +128 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +301 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_nvjitlink.py +174 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_nvrtc.py +28 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_nvvm_driver.py +185 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_pinned.py +39 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_profiler.py +23 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_reset_device.py +38 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_runtime.py +48 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_select_device.py +44 -0
- numba_cuda/numba/cuda/tests/cudadrv/test_streams.py +127 -0
- numba_cuda/numba/cuda/tests/cudapy/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/cudapy/cache_usecases.py +231 -0
- numba_cuda/numba/cuda/tests/cudapy/cache_with_cpu_usecases.py +50 -0
- numba_cuda/numba/cuda/tests/cudapy/cg_cache_usecases.py +36 -0
- numba_cuda/numba/cuda/tests/cudapy/complex_usecases.py +116 -0
- numba_cuda/numba/cuda/tests/cudapy/enum_usecases.py +59 -0
- numba_cuda/numba/cuda/tests/cudapy/extensions_usecases.py +62 -0
- numba_cuda/numba/cuda/tests/cudapy/jitlink.ptx +28 -0
- numba_cuda/numba/cuda/tests/cudapy/overload_usecases.py +33 -0
- numba_cuda/numba/cuda/tests/cudapy/recursion_usecases.py +104 -0
- numba_cuda/numba/cuda/tests/cudapy/test_alignment.py +47 -0
- numba_cuda/numba/cuda/tests/cudapy/test_analysis.py +1122 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array.py +344 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_alignment.py +268 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_args.py +203 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_methods.py +63 -0
- numba_cuda/numba/cuda/tests/cudapy/test_array_reductions.py +360 -0
- numba_cuda/numba/cuda/tests/cudapy/test_atomics.py +1815 -0
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16.py +599 -0
- numba_cuda/numba/cuda/tests/cudapy/test_bfloat16_bindings.py +377 -0
- numba_cuda/numba/cuda/tests/cudapy/test_blackscholes.py +160 -0
- numba_cuda/numba/cuda/tests/cudapy/test_boolean.py +27 -0
- numba_cuda/numba/cuda/tests/cudapy/test_byteflow.py +98 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cache_hints.py +210 -0
- numba_cuda/numba/cuda/tests/cudapy/test_caching.py +683 -0
- numba_cuda/numba/cuda/tests/cudapy/test_casting.py +265 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cffi.py +42 -0
- numba_cuda/numba/cuda/tests/cudapy/test_compiler.py +718 -0
- numba_cuda/numba/cuda/tests/cudapy/test_complex.py +370 -0
- numba_cuda/numba/cuda/tests/cudapy/test_complex_kernel.py +23 -0
- numba_cuda/numba/cuda/tests/cudapy/test_const_string.py +142 -0
- numba_cuda/numba/cuda/tests/cudapy/test_constmem.py +178 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cooperative_groups.py +193 -0
- numba_cuda/numba/cuda/tests/cudapy/test_copy_propagate.py +131 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cuda_array_interface.py +438 -0
- numba_cuda/numba/cuda/tests/cudapy/test_cuda_jit_no_types.py +94 -0
- numba_cuda/numba/cuda/tests/cudapy/test_datetime.py +101 -0
- numba_cuda/numba/cuda/tests/cudapy/test_debug.py +105 -0
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo.py +889 -0
- numba_cuda/numba/cuda/tests/cudapy/test_debuginfo_types.py +476 -0
- numba_cuda/numba/cuda/tests/cudapy/test_device_func.py +500 -0
- numba_cuda/numba/cuda/tests/cudapy/test_dispatcher.py +820 -0
- numba_cuda/numba/cuda/tests/cudapy/test_enums.py +152 -0
- numba_cuda/numba/cuda/tests/cudapy/test_errors.py +111 -0
- numba_cuda/numba/cuda/tests/cudapy/test_exception.py +170 -0
- numba_cuda/numba/cuda/tests/cudapy/test_extending.py +1088 -0
- numba_cuda/numba/cuda/tests/cudapy/test_extending_types.py +71 -0
- numba_cuda/numba/cuda/tests/cudapy/test_fastmath.py +265 -0
- numba_cuda/numba/cuda/tests/cudapy/test_flow_control.py +1433 -0
- numba_cuda/numba/cuda/tests/cudapy/test_forall.py +57 -0
- numba_cuda/numba/cuda/tests/cudapy/test_freevar.py +34 -0
- numba_cuda/numba/cuda/tests/cudapy/test_frexp_ldexp.py +69 -0
- numba_cuda/numba/cuda/tests/cudapy/test_globals.py +62 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc.py +474 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scalar.py +167 -0
- numba_cuda/numba/cuda/tests/cudapy/test_gufunc_scheduling.py +92 -0
- numba_cuda/numba/cuda/tests/cudapy/test_idiv.py +39 -0
- numba_cuda/numba/cuda/tests/cudapy/test_inline.py +170 -0
- numba_cuda/numba/cuda/tests/cudapy/test_inspect.py +255 -0
- numba_cuda/numba/cuda/tests/cudapy/test_intrinsics.py +1219 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ipc.py +263 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ir.py +598 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ir_utils.py +276 -0
- numba_cuda/numba/cuda/tests/cudapy/test_iterators.py +101 -0
- numba_cuda/numba/cuda/tests/cudapy/test_lang.py +68 -0
- numba_cuda/numba/cuda/tests/cudapy/test_laplace.py +123 -0
- numba_cuda/numba/cuda/tests/cudapy/test_libdevice.py +194 -0
- numba_cuda/numba/cuda/tests/cudapy/test_lineinfo.py +220 -0
- numba_cuda/numba/cuda/tests/cudapy/test_localmem.py +173 -0
- numba_cuda/numba/cuda/tests/cudapy/test_make_function_to_jit_function.py +364 -0
- numba_cuda/numba/cuda/tests/cudapy/test_mandel.py +47 -0
- numba_cuda/numba/cuda/tests/cudapy/test_math.py +842 -0
- numba_cuda/numba/cuda/tests/cudapy/test_matmul.py +76 -0
- numba_cuda/numba/cuda/tests/cudapy/test_minmax.py +78 -0
- numba_cuda/numba/cuda/tests/cudapy/test_montecarlo.py +25 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multigpu.py +145 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multiprocessing.py +39 -0
- numba_cuda/numba/cuda/tests/cudapy/test_multithreads.py +82 -0
- numba_cuda/numba/cuda/tests/cudapy/test_nondet.py +53 -0
- numba_cuda/numba/cuda/tests/cudapy/test_operator.py +504 -0
- numba_cuda/numba/cuda/tests/cudapy/test_optimization.py +93 -0
- numba_cuda/numba/cuda/tests/cudapy/test_overload.py +402 -0
- numba_cuda/numba/cuda/tests/cudapy/test_powi.py +128 -0
- numba_cuda/numba/cuda/tests/cudapy/test_print.py +193 -0
- numba_cuda/numba/cuda/tests/cudapy/test_py2_div_issue.py +37 -0
- numba_cuda/numba/cuda/tests/cudapy/test_random.py +117 -0
- numba_cuda/numba/cuda/tests/cudapy/test_record_dtype.py +614 -0
- numba_cuda/numba/cuda/tests/cudapy/test_recursion.py +130 -0
- numba_cuda/numba/cuda/tests/cudapy/test_reduction.py +94 -0
- numba_cuda/numba/cuda/tests/cudapy/test_retrieve_autoconverted_arrays.py +83 -0
- numba_cuda/numba/cuda/tests/cudapy/test_serialize.py +86 -0
- numba_cuda/numba/cuda/tests/cudapy/test_slicing.py +40 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sm.py +457 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sm_creation.py +233 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ssa.py +454 -0
- numba_cuda/numba/cuda/tests/cudapy/test_stream_api.py +56 -0
- numba_cuda/numba/cuda/tests/cudapy/test_sync.py +277 -0
- numba_cuda/numba/cuda/tests/cudapy/test_tracing.py +200 -0
- numba_cuda/numba/cuda/tests/cudapy/test_transpose.py +90 -0
- numba_cuda/numba/cuda/tests/cudapy/test_typeconv.py +333 -0
- numba_cuda/numba/cuda/tests/cudapy/test_typeinfer.py +538 -0
- numba_cuda/numba/cuda/tests/cudapy/test_ufuncs.py +585 -0
- numba_cuda/numba/cuda/tests/cudapy/test_userexc.py +42 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vector_type.py +485 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize.py +312 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_complex.py +23 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_decor.py +183 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_device.py +40 -0
- numba_cuda/numba/cuda/tests/cudapy/test_vectorize_scalar_arg.py +40 -0
- numba_cuda/numba/cuda/tests/cudapy/test_warning.py +206 -0
- numba_cuda/numba/cuda/tests/cudapy/test_warp_ops.py +331 -0
- numba_cuda/numba/cuda/tests/cudasim/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/cudasim/support.py +9 -0
- numba_cuda/numba/cuda/tests/cudasim/test_cudasim_issues.py +111 -0
- numba_cuda/numba/cuda/tests/data/__init__.py +2 -0
- numba_cuda/numba/cuda/tests/data/cta_barrier.cu +28 -0
- numba_cuda/numba/cuda/tests/data/cuda_include.cu +10 -0
- numba_cuda/numba/cuda/tests/data/error.cu +12 -0
- numba_cuda/numba/cuda/tests/data/include/add.cuh +8 -0
- numba_cuda/numba/cuda/tests/data/jitlink.cu +28 -0
- numba_cuda/numba/cuda/tests/data/jitlink.ptx +49 -0
- numba_cuda/numba/cuda/tests/data/warn.cu +12 -0
- numba_cuda/numba/cuda/tests/doc_examples/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/__init__.py +2 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/functions.cu +54 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/include/mul.cuh +8 -0
- numba_cuda/numba/cuda/tests/doc_examples/ffi/saxpy.cu +14 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_cg.py +86 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_cpointer.py +68 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_cpu_gpu_compat.py +81 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_ffi.py +141 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_laplace.py +160 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_matmul.py +180 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_montecarlo.py +119 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_random.py +66 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_reduction.py +80 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_sessionize.py +206 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_ufunc.py +53 -0
- numba_cuda/numba/cuda/tests/doc_examples/test_vecadd.py +76 -0
- numba_cuda/numba/cuda/tests/nocuda/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/nocuda/test_dummyarray.py +391 -0
- numba_cuda/numba/cuda/tests/nocuda/test_function_resolution.py +48 -0
- numba_cuda/numba/cuda/tests/nocuda/test_import.py +63 -0
- numba_cuda/numba/cuda/tests/nocuda/test_library_lookup.py +252 -0
- numba_cuda/numba/cuda/tests/nocuda/test_nvvm.py +59 -0
- numba_cuda/numba/cuda/tests/nrt/__init__.py +9 -0
- numba_cuda/numba/cuda/tests/nrt/test_nrt.py +387 -0
- numba_cuda/numba/cuda/tests/nrt/test_nrt_refct.py +124 -0
- numba_cuda/numba/cuda/tests/support.py +900 -0
- numba_cuda/numba/cuda/typeconv/__init__.py +4 -0
- numba_cuda/numba/cuda/typeconv/castgraph.py +137 -0
- numba_cuda/numba/cuda/typeconv/rules.py +63 -0
- numba_cuda/numba/cuda/typeconv/typeconv.py +121 -0
- numba_cuda/numba/cuda/types/__init__.py +233 -0
- numba_cuda/numba/cuda/types/__init__.pyi +167 -0
- numba_cuda/numba/cuda/types/abstract.py +9 -0
- numba_cuda/numba/cuda/types/common.py +9 -0
- numba_cuda/numba/cuda/types/containers.py +9 -0
- numba_cuda/numba/cuda/types/cuda_abstract.py +533 -0
- numba_cuda/numba/cuda/types/cuda_common.py +110 -0
- numba_cuda/numba/cuda/types/cuda_containers.py +971 -0
- numba_cuda/numba/cuda/types/cuda_function_type.py +230 -0
- numba_cuda/numba/cuda/types/cuda_functions.py +798 -0
- numba_cuda/numba/cuda/types/cuda_iterators.py +120 -0
- numba_cuda/numba/cuda/types/cuda_misc.py +569 -0
- numba_cuda/numba/cuda/types/cuda_npytypes.py +690 -0
- numba_cuda/numba/cuda/types/cuda_scalars.py +280 -0
- numba_cuda/numba/cuda/types/ext_types.py +101 -0
- numba_cuda/numba/cuda/types/function_type.py +11 -0
- numba_cuda/numba/cuda/types/functions.py +9 -0
- numba_cuda/numba/cuda/types/iterators.py +9 -0
- numba_cuda/numba/cuda/types/misc.py +9 -0
- numba_cuda/numba/cuda/types/npytypes.py +9 -0
- numba_cuda/numba/cuda/types/scalars.py +9 -0
- numba_cuda/numba/cuda/typing/__init__.py +19 -0
- numba_cuda/numba/cuda/typing/arraydecl.py +939 -0
- numba_cuda/numba/cuda/typing/asnumbatype.py +130 -0
- numba_cuda/numba/cuda/typing/bufproto.py +70 -0
- numba_cuda/numba/cuda/typing/builtins.py +1209 -0
- numba_cuda/numba/cuda/typing/cffi_utils.py +219 -0
- numba_cuda/numba/cuda/typing/cmathdecl.py +47 -0
- numba_cuda/numba/cuda/typing/collections.py +138 -0
- numba_cuda/numba/cuda/typing/context.py +782 -0
- numba_cuda/numba/cuda/typing/ctypes_utils.py +125 -0
- numba_cuda/numba/cuda/typing/dictdecl.py +63 -0
- numba_cuda/numba/cuda/typing/enumdecl.py +74 -0
- numba_cuda/numba/cuda/typing/listdecl.py +147 -0
- numba_cuda/numba/cuda/typing/mathdecl.py +158 -0
- numba_cuda/numba/cuda/typing/npdatetime.py +322 -0
- numba_cuda/numba/cuda/typing/npydecl.py +749 -0
- numba_cuda/numba/cuda/typing/setdecl.py +115 -0
- numba_cuda/numba/cuda/typing/templates.py +1446 -0
- numba_cuda/numba/cuda/typing/typeof.py +301 -0
- numba_cuda/numba/cuda/ufuncs.py +746 -0
- numba_cuda/numba/cuda/utils.py +724 -0
- numba_cuda/numba/cuda/vector_types.py +214 -0
- numba_cuda/numba/cuda/vectorizers.py +260 -0
- numba_cuda-0.21.1.dist-info/METADATA +109 -0
- numba_cuda-0.21.1.dist-info/RECORD +488 -0
- numba_cuda-0.21.1.dist-info/WHEEL +5 -0
- numba_cuda-0.21.1.dist-info/licenses/LICENSE +26 -0
- numba_cuda-0.21.1.dist-info/licenses/LICENSE.numba +24 -0
- numba_cuda-0.21.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: BSD-2-Clause
|
|
3
|
+
|
|
4
|
+
"""Contains information on how to translate different ufuncs for the CUDA
|
|
5
|
+
target. It is a database of different ufuncs and how each of its loops maps to
|
|
6
|
+
a function that implements the inner kernel of that ufunc (the inner kernel
|
|
7
|
+
being the per-element function).
|
|
8
|
+
|
|
9
|
+
Use get_ufunc_info() to get the information related to a ufunc.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import math
|
|
13
|
+
import numpy as np
|
|
14
|
+
from functools import lru_cache
|
|
15
|
+
from numba.cuda import typing
|
|
16
|
+
from numba.cuda.mathimpl import (
|
|
17
|
+
get_unary_impl_for_fn_and_ty,
|
|
18
|
+
get_binary_impl_for_fn_and_ty,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_ufunc_info(ufunc_key):
|
|
23
|
+
return ufunc_db()[ufunc_key]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@lru_cache
|
|
27
|
+
def ufunc_db():
|
|
28
|
+
# Imports here are at function scope to avoid circular imports
|
|
29
|
+
from numba.cuda.cpython import cmathimpl, mathimpl, numbers
|
|
30
|
+
from numba.cuda.np import npyfuncs
|
|
31
|
+
from numba.cuda.np.numpy_support import numpy_version
|
|
32
|
+
|
|
33
|
+
def np_unary_impl(fn, context, builder, sig, args):
|
|
34
|
+
npyfuncs._check_arity_and_homogeneity(sig, args, 1)
|
|
35
|
+
impl = get_unary_impl_for_fn_and_ty(fn, sig.args[0])
|
|
36
|
+
return impl(context, builder, sig, args)
|
|
37
|
+
|
|
38
|
+
def np_binary_impl(fn, context, builder, sig, args):
|
|
39
|
+
npyfuncs._check_arity_and_homogeneity(sig, args, 2)
|
|
40
|
+
impl = get_binary_impl_for_fn_and_ty(fn, sig.args[0])
|
|
41
|
+
return impl(context, builder, sig, args)
|
|
42
|
+
|
|
43
|
+
def np_real_log_impl(context, builder, sig, args):
|
|
44
|
+
return np_unary_impl(math.log, context, builder, sig, args)
|
|
45
|
+
|
|
46
|
+
def np_real_log2_impl(context, builder, sig, args):
|
|
47
|
+
return np_unary_impl(math.log2, context, builder, sig, args)
|
|
48
|
+
|
|
49
|
+
def np_real_log10_impl(context, builder, sig, args):
|
|
50
|
+
return np_unary_impl(math.log10, context, builder, sig, args)
|
|
51
|
+
|
|
52
|
+
def np_real_sin_impl(context, builder, sig, args):
|
|
53
|
+
return np_unary_impl(math.sin, context, builder, sig, args)
|
|
54
|
+
|
|
55
|
+
def np_real_cos_impl(context, builder, sig, args):
|
|
56
|
+
return np_unary_impl(math.cos, context, builder, sig, args)
|
|
57
|
+
|
|
58
|
+
def np_real_tan_impl(context, builder, sig, args):
|
|
59
|
+
return np_unary_impl(math.tan, context, builder, sig, args)
|
|
60
|
+
|
|
61
|
+
def np_real_asin_impl(context, builder, sig, args):
|
|
62
|
+
return np_unary_impl(math.asin, context, builder, sig, args)
|
|
63
|
+
|
|
64
|
+
def np_real_acos_impl(context, builder, sig, args):
|
|
65
|
+
return np_unary_impl(math.acos, context, builder, sig, args)
|
|
66
|
+
|
|
67
|
+
def np_real_atan_impl(context, builder, sig, args):
|
|
68
|
+
return np_unary_impl(math.atan, context, builder, sig, args)
|
|
69
|
+
|
|
70
|
+
def np_real_atan2_impl(context, builder, sig, args):
|
|
71
|
+
return np_binary_impl(math.atan2, context, builder, sig, args)
|
|
72
|
+
|
|
73
|
+
def np_real_hypot_impl(context, builder, sig, args):
|
|
74
|
+
return np_binary_impl(math.hypot, context, builder, sig, args)
|
|
75
|
+
|
|
76
|
+
def np_real_sinh_impl(context, builder, sig, args):
|
|
77
|
+
return np_unary_impl(math.sinh, context, builder, sig, args)
|
|
78
|
+
|
|
79
|
+
def np_complex_sinh_impl(context, builder, sig, args):
|
|
80
|
+
# npymath does not provide a complex sinh. The code in funcs.inc.src
|
|
81
|
+
# is translated here...
|
|
82
|
+
npyfuncs._check_arity_and_homogeneity(sig, args, 1)
|
|
83
|
+
|
|
84
|
+
ty = sig.args[0]
|
|
85
|
+
fty = ty.underlying_float
|
|
86
|
+
fsig1 = typing.signature(*[fty] * 2)
|
|
87
|
+
x = context.make_complex(builder, ty, args[0])
|
|
88
|
+
out = context.make_complex(builder, ty)
|
|
89
|
+
xr = x.real
|
|
90
|
+
xi = x.imag
|
|
91
|
+
|
|
92
|
+
sxi = np_real_sin_impl(context, builder, fsig1, [xi])
|
|
93
|
+
shxr = np_real_sinh_impl(context, builder, fsig1, [xr])
|
|
94
|
+
cxi = np_real_cos_impl(context, builder, fsig1, [xi])
|
|
95
|
+
chxr = np_real_cosh_impl(context, builder, fsig1, [xr])
|
|
96
|
+
|
|
97
|
+
out.real = builder.fmul(cxi, shxr)
|
|
98
|
+
out.imag = builder.fmul(sxi, chxr)
|
|
99
|
+
|
|
100
|
+
return out._getvalue()
|
|
101
|
+
|
|
102
|
+
def np_real_cosh_impl(context, builder, sig, args):
|
|
103
|
+
return np_unary_impl(math.cosh, context, builder, sig, args)
|
|
104
|
+
|
|
105
|
+
def np_complex_cosh_impl(context, builder, sig, args):
|
|
106
|
+
# npymath does not provide a complex cosh. The code in funcs.inc.src
|
|
107
|
+
# is translated here...
|
|
108
|
+
npyfuncs._check_arity_and_homogeneity(sig, args, 1)
|
|
109
|
+
|
|
110
|
+
ty = sig.args[0]
|
|
111
|
+
fty = ty.underlying_float
|
|
112
|
+
fsig1 = typing.signature(*[fty] * 2)
|
|
113
|
+
x = context.make_complex(builder, ty, args[0])
|
|
114
|
+
out = context.make_complex(builder, ty)
|
|
115
|
+
xr = x.real
|
|
116
|
+
xi = x.imag
|
|
117
|
+
|
|
118
|
+
cxi = np_real_cos_impl(context, builder, fsig1, [xi])
|
|
119
|
+
chxr = np_real_cosh_impl(context, builder, fsig1, [xr])
|
|
120
|
+
sxi = np_real_sin_impl(context, builder, fsig1, [xi])
|
|
121
|
+
shxr = np_real_sinh_impl(context, builder, fsig1, [xr])
|
|
122
|
+
|
|
123
|
+
out.real = builder.fmul(cxi, chxr)
|
|
124
|
+
out.imag = builder.fmul(sxi, shxr)
|
|
125
|
+
|
|
126
|
+
return out._getvalue()
|
|
127
|
+
|
|
128
|
+
def np_real_tanh_impl(context, builder, sig, args):
|
|
129
|
+
return np_unary_impl(math.tanh, context, builder, sig, args)
|
|
130
|
+
|
|
131
|
+
def np_complex_tanh_impl(context, builder, sig, args):
|
|
132
|
+
# npymath does not provide complex tan functions. The code
|
|
133
|
+
# in funcs.inc.src for tanh is translated here...
|
|
134
|
+
npyfuncs._check_arity_and_homogeneity(sig, args, 1)
|
|
135
|
+
|
|
136
|
+
ty = sig.args[0]
|
|
137
|
+
fty = ty.underlying_float
|
|
138
|
+
fsig1 = typing.signature(*[fty] * 2)
|
|
139
|
+
ONE = context.get_constant(fty, 1.0)
|
|
140
|
+
x = context.make_complex(builder, ty, args[0])
|
|
141
|
+
out = context.make_complex(builder, ty)
|
|
142
|
+
|
|
143
|
+
xr = x.real
|
|
144
|
+
xi = x.imag
|
|
145
|
+
si = np_real_sin_impl(context, builder, fsig1, [xi])
|
|
146
|
+
ci = np_real_cos_impl(context, builder, fsig1, [xi])
|
|
147
|
+
shr = np_real_sinh_impl(context, builder, fsig1, [xr])
|
|
148
|
+
chr_ = np_real_cosh_impl(context, builder, fsig1, [xr])
|
|
149
|
+
rs = builder.fmul(ci, shr)
|
|
150
|
+
is_ = builder.fmul(si, chr_)
|
|
151
|
+
rc = builder.fmul(ci, chr_)
|
|
152
|
+
# Note: opposite sign for `ic` from code in funcs.inc.src
|
|
153
|
+
ic = builder.fmul(si, shr)
|
|
154
|
+
sqr_rc = builder.fmul(rc, rc)
|
|
155
|
+
sqr_ic = builder.fmul(ic, ic)
|
|
156
|
+
d = builder.fadd(sqr_rc, sqr_ic)
|
|
157
|
+
inv_d = builder.fdiv(ONE, d)
|
|
158
|
+
rs_rc = builder.fmul(rs, rc)
|
|
159
|
+
is_ic = builder.fmul(is_, ic)
|
|
160
|
+
is_rc = builder.fmul(is_, rc)
|
|
161
|
+
rs_ic = builder.fmul(rs, ic)
|
|
162
|
+
numr = builder.fadd(rs_rc, is_ic)
|
|
163
|
+
numi = builder.fsub(is_rc, rs_ic)
|
|
164
|
+
out.real = builder.fmul(numr, inv_d)
|
|
165
|
+
out.imag = builder.fmul(numi, inv_d)
|
|
166
|
+
|
|
167
|
+
return out._getvalue()
|
|
168
|
+
|
|
169
|
+
def np_real_asinh_impl(context, builder, sig, args):
|
|
170
|
+
return np_unary_impl(math.asinh, context, builder, sig, args)
|
|
171
|
+
|
|
172
|
+
def np_real_acosh_impl(context, builder, sig, args):
|
|
173
|
+
return np_unary_impl(math.acosh, context, builder, sig, args)
|
|
174
|
+
|
|
175
|
+
def np_real_atanh_impl(context, builder, sig, args):
|
|
176
|
+
return np_unary_impl(math.atanh, context, builder, sig, args)
|
|
177
|
+
|
|
178
|
+
db = {}
|
|
179
|
+
|
|
180
|
+
db[np.sin] = {
|
|
181
|
+
"f->f": np_real_sin_impl,
|
|
182
|
+
"d->d": np_real_sin_impl,
|
|
183
|
+
"F->F": npyfuncs.np_complex_sin_impl,
|
|
184
|
+
"D->D": npyfuncs.np_complex_sin_impl,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
db[np.cos] = {
|
|
188
|
+
"f->f": np_real_cos_impl,
|
|
189
|
+
"d->d": np_real_cos_impl,
|
|
190
|
+
"F->F": npyfuncs.np_complex_cos_impl,
|
|
191
|
+
"D->D": npyfuncs.np_complex_cos_impl,
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
db[np.tan] = {
|
|
195
|
+
"f->f": np_real_tan_impl,
|
|
196
|
+
"d->d": np_real_tan_impl,
|
|
197
|
+
"F->F": cmathimpl.tan_impl,
|
|
198
|
+
"D->D": cmathimpl.tan_impl,
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
db[np.arcsin] = {
|
|
202
|
+
"f->f": np_real_asin_impl,
|
|
203
|
+
"d->d": np_real_asin_impl,
|
|
204
|
+
"F->F": cmathimpl.asin_impl,
|
|
205
|
+
"D->D": cmathimpl.asin_impl,
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
db[np.arccos] = {
|
|
209
|
+
"f->f": np_real_acos_impl,
|
|
210
|
+
"d->d": np_real_acos_impl,
|
|
211
|
+
"F->F": cmathimpl.acos_impl,
|
|
212
|
+
"D->D": cmathimpl.acos_impl,
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
db[np.arctan] = {
|
|
216
|
+
"f->f": np_real_atan_impl,
|
|
217
|
+
"d->d": np_real_atan_impl,
|
|
218
|
+
"F->F": cmathimpl.atan_impl,
|
|
219
|
+
"D->D": cmathimpl.atan_impl,
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
db[np.arctan2] = {
|
|
223
|
+
"ff->f": np_real_atan2_impl,
|
|
224
|
+
"dd->d": np_real_atan2_impl,
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
db[np.hypot] = {
|
|
228
|
+
"ff->f": np_real_hypot_impl,
|
|
229
|
+
"dd->d": np_real_hypot_impl,
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
db[np.sinh] = {
|
|
233
|
+
"f->f": np_real_sinh_impl,
|
|
234
|
+
"d->d": np_real_sinh_impl,
|
|
235
|
+
"F->F": np_complex_sinh_impl,
|
|
236
|
+
"D->D": np_complex_sinh_impl,
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
db[np.cosh] = {
|
|
240
|
+
"f->f": np_real_cosh_impl,
|
|
241
|
+
"d->d": np_real_cosh_impl,
|
|
242
|
+
"F->F": np_complex_cosh_impl,
|
|
243
|
+
"D->D": np_complex_cosh_impl,
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
db[np.tanh] = {
|
|
247
|
+
"f->f": np_real_tanh_impl,
|
|
248
|
+
"d->d": np_real_tanh_impl,
|
|
249
|
+
"F->F": np_complex_tanh_impl,
|
|
250
|
+
"D->D": np_complex_tanh_impl,
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
db[np.arcsinh] = {
|
|
254
|
+
"f->f": np_real_asinh_impl,
|
|
255
|
+
"d->d": np_real_asinh_impl,
|
|
256
|
+
"F->F": cmathimpl.asinh_impl,
|
|
257
|
+
"D->D": cmathimpl.asinh_impl,
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
db[np.arccosh] = {
|
|
261
|
+
"f->f": np_real_acosh_impl,
|
|
262
|
+
"d->d": np_real_acosh_impl,
|
|
263
|
+
"F->F": npyfuncs.np_complex_acosh_impl,
|
|
264
|
+
"D->D": npyfuncs.np_complex_acosh_impl,
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
db[np.arctanh] = {
|
|
268
|
+
"f->f": np_real_atanh_impl,
|
|
269
|
+
"d->d": np_real_atanh_impl,
|
|
270
|
+
"F->F": cmathimpl.atanh_impl,
|
|
271
|
+
"D->D": cmathimpl.atanh_impl,
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
db[np.deg2rad] = {
|
|
275
|
+
"f->f": mathimpl.radians_float_impl,
|
|
276
|
+
"d->d": mathimpl.radians_float_impl,
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
db[np.radians] = db[np.deg2rad]
|
|
280
|
+
|
|
281
|
+
db[np.rad2deg] = {
|
|
282
|
+
"f->f": mathimpl.degrees_float_impl,
|
|
283
|
+
"d->d": mathimpl.degrees_float_impl,
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
db[np.degrees] = db[np.rad2deg]
|
|
287
|
+
|
|
288
|
+
db[np.greater] = {
|
|
289
|
+
"??->?": numbers.int_ugt_impl,
|
|
290
|
+
"bb->?": numbers.int_sgt_impl,
|
|
291
|
+
"BB->?": numbers.int_ugt_impl,
|
|
292
|
+
"hh->?": numbers.int_sgt_impl,
|
|
293
|
+
"HH->?": numbers.int_ugt_impl,
|
|
294
|
+
"ii->?": numbers.int_sgt_impl,
|
|
295
|
+
"II->?": numbers.int_ugt_impl,
|
|
296
|
+
"ll->?": numbers.int_sgt_impl,
|
|
297
|
+
"LL->?": numbers.int_ugt_impl,
|
|
298
|
+
"qq->?": numbers.int_sgt_impl,
|
|
299
|
+
"QQ->?": numbers.int_ugt_impl,
|
|
300
|
+
"ff->?": numbers.real_gt_impl,
|
|
301
|
+
"dd->?": numbers.real_gt_impl,
|
|
302
|
+
"FF->?": npyfuncs.np_complex_gt_impl,
|
|
303
|
+
"DD->?": npyfuncs.np_complex_gt_impl,
|
|
304
|
+
}
|
|
305
|
+
if numpy_version >= (1, 25):
|
|
306
|
+
db[np.greater].update(
|
|
307
|
+
{
|
|
308
|
+
"qQ->?": numbers.int_signed_unsigned_cmp(">"),
|
|
309
|
+
"Qq->?": numbers.int_unsigned_signed_cmp(">"),
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
db[np.greater_equal] = {
|
|
314
|
+
"??->?": numbers.int_uge_impl,
|
|
315
|
+
"bb->?": numbers.int_sge_impl,
|
|
316
|
+
"BB->?": numbers.int_uge_impl,
|
|
317
|
+
"hh->?": numbers.int_sge_impl,
|
|
318
|
+
"HH->?": numbers.int_uge_impl,
|
|
319
|
+
"ii->?": numbers.int_sge_impl,
|
|
320
|
+
"II->?": numbers.int_uge_impl,
|
|
321
|
+
"ll->?": numbers.int_sge_impl,
|
|
322
|
+
"LL->?": numbers.int_uge_impl,
|
|
323
|
+
"qq->?": numbers.int_sge_impl,
|
|
324
|
+
"QQ->?": numbers.int_uge_impl,
|
|
325
|
+
"ff->?": numbers.real_ge_impl,
|
|
326
|
+
"dd->?": numbers.real_ge_impl,
|
|
327
|
+
"FF->?": npyfuncs.np_complex_ge_impl,
|
|
328
|
+
"DD->?": npyfuncs.np_complex_ge_impl,
|
|
329
|
+
}
|
|
330
|
+
if numpy_version >= (1, 25):
|
|
331
|
+
db[np.greater_equal].update(
|
|
332
|
+
{
|
|
333
|
+
"qQ->?": numbers.int_signed_unsigned_cmp(">="),
|
|
334
|
+
"Qq->?": numbers.int_unsigned_signed_cmp(">="),
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
db[np.less] = {
|
|
339
|
+
"??->?": numbers.int_ult_impl,
|
|
340
|
+
"bb->?": numbers.int_slt_impl,
|
|
341
|
+
"BB->?": numbers.int_ult_impl,
|
|
342
|
+
"hh->?": numbers.int_slt_impl,
|
|
343
|
+
"HH->?": numbers.int_ult_impl,
|
|
344
|
+
"ii->?": numbers.int_slt_impl,
|
|
345
|
+
"II->?": numbers.int_ult_impl,
|
|
346
|
+
"ll->?": numbers.int_slt_impl,
|
|
347
|
+
"LL->?": numbers.int_ult_impl,
|
|
348
|
+
"qq->?": numbers.int_slt_impl,
|
|
349
|
+
"QQ->?": numbers.int_ult_impl,
|
|
350
|
+
"ff->?": numbers.real_lt_impl,
|
|
351
|
+
"dd->?": numbers.real_lt_impl,
|
|
352
|
+
"FF->?": npyfuncs.np_complex_lt_impl,
|
|
353
|
+
"DD->?": npyfuncs.np_complex_lt_impl,
|
|
354
|
+
}
|
|
355
|
+
if numpy_version >= (1, 25):
|
|
356
|
+
db[np.less].update(
|
|
357
|
+
{
|
|
358
|
+
"qQ->?": numbers.int_signed_unsigned_cmp("<"),
|
|
359
|
+
"Qq->?": numbers.int_unsigned_signed_cmp("<"),
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
db[np.less_equal] = {
|
|
364
|
+
"??->?": numbers.int_ule_impl,
|
|
365
|
+
"bb->?": numbers.int_sle_impl,
|
|
366
|
+
"BB->?": numbers.int_ule_impl,
|
|
367
|
+
"hh->?": numbers.int_sle_impl,
|
|
368
|
+
"HH->?": numbers.int_ule_impl,
|
|
369
|
+
"ii->?": numbers.int_sle_impl,
|
|
370
|
+
"II->?": numbers.int_ule_impl,
|
|
371
|
+
"ll->?": numbers.int_sle_impl,
|
|
372
|
+
"LL->?": numbers.int_ule_impl,
|
|
373
|
+
"qq->?": numbers.int_sle_impl,
|
|
374
|
+
"QQ->?": numbers.int_ule_impl,
|
|
375
|
+
"ff->?": numbers.real_le_impl,
|
|
376
|
+
"dd->?": numbers.real_le_impl,
|
|
377
|
+
"FF->?": npyfuncs.np_complex_le_impl,
|
|
378
|
+
"DD->?": npyfuncs.np_complex_le_impl,
|
|
379
|
+
}
|
|
380
|
+
if numpy_version >= (1, 25):
|
|
381
|
+
db[np.less_equal].update(
|
|
382
|
+
{
|
|
383
|
+
"qQ->?": numbers.int_signed_unsigned_cmp("<="),
|
|
384
|
+
"Qq->?": numbers.int_unsigned_signed_cmp("<="),
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
db[np.not_equal] = {
|
|
389
|
+
"??->?": numbers.int_ne_impl,
|
|
390
|
+
"bb->?": numbers.int_ne_impl,
|
|
391
|
+
"BB->?": numbers.int_ne_impl,
|
|
392
|
+
"hh->?": numbers.int_ne_impl,
|
|
393
|
+
"HH->?": numbers.int_ne_impl,
|
|
394
|
+
"ii->?": numbers.int_ne_impl,
|
|
395
|
+
"II->?": numbers.int_ne_impl,
|
|
396
|
+
"ll->?": numbers.int_ne_impl,
|
|
397
|
+
"LL->?": numbers.int_ne_impl,
|
|
398
|
+
"qq->?": numbers.int_ne_impl,
|
|
399
|
+
"QQ->?": numbers.int_ne_impl,
|
|
400
|
+
"ff->?": numbers.real_ne_impl,
|
|
401
|
+
"dd->?": numbers.real_ne_impl,
|
|
402
|
+
"FF->?": npyfuncs.np_complex_ne_impl,
|
|
403
|
+
"DD->?": npyfuncs.np_complex_ne_impl,
|
|
404
|
+
}
|
|
405
|
+
if numpy_version >= (1, 25):
|
|
406
|
+
db[np.not_equal].update(
|
|
407
|
+
{
|
|
408
|
+
"qQ->?": numbers.int_signed_unsigned_cmp("!="),
|
|
409
|
+
"Qq->?": numbers.int_unsigned_signed_cmp("!="),
|
|
410
|
+
}
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
db[np.equal] = {
|
|
414
|
+
"??->?": numbers.int_eq_impl,
|
|
415
|
+
"bb->?": numbers.int_eq_impl,
|
|
416
|
+
"BB->?": numbers.int_eq_impl,
|
|
417
|
+
"hh->?": numbers.int_eq_impl,
|
|
418
|
+
"HH->?": numbers.int_eq_impl,
|
|
419
|
+
"ii->?": numbers.int_eq_impl,
|
|
420
|
+
"II->?": numbers.int_eq_impl,
|
|
421
|
+
"ll->?": numbers.int_eq_impl,
|
|
422
|
+
"LL->?": numbers.int_eq_impl,
|
|
423
|
+
"qq->?": numbers.int_eq_impl,
|
|
424
|
+
"QQ->?": numbers.int_eq_impl,
|
|
425
|
+
"ff->?": numbers.real_eq_impl,
|
|
426
|
+
"dd->?": numbers.real_eq_impl,
|
|
427
|
+
"FF->?": npyfuncs.np_complex_eq_impl,
|
|
428
|
+
"DD->?": npyfuncs.np_complex_eq_impl,
|
|
429
|
+
}
|
|
430
|
+
if numpy_version >= (1, 25):
|
|
431
|
+
db[np.equal].update(
|
|
432
|
+
{
|
|
433
|
+
"qQ->?": numbers.int_signed_unsigned_cmp("=="),
|
|
434
|
+
"Qq->?": numbers.int_unsigned_signed_cmp("=="),
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
db[np.logical_and] = {
|
|
439
|
+
"??->?": npyfuncs.np_logical_and_impl,
|
|
440
|
+
"bb->?": npyfuncs.np_logical_and_impl,
|
|
441
|
+
"BB->?": npyfuncs.np_logical_and_impl,
|
|
442
|
+
"hh->?": npyfuncs.np_logical_and_impl,
|
|
443
|
+
"HH->?": npyfuncs.np_logical_and_impl,
|
|
444
|
+
"ii->?": npyfuncs.np_logical_and_impl,
|
|
445
|
+
"II->?": npyfuncs.np_logical_and_impl,
|
|
446
|
+
"ll->?": npyfuncs.np_logical_and_impl,
|
|
447
|
+
"LL->?": npyfuncs.np_logical_and_impl,
|
|
448
|
+
"qq->?": npyfuncs.np_logical_and_impl,
|
|
449
|
+
"QQ->?": npyfuncs.np_logical_and_impl,
|
|
450
|
+
"ff->?": npyfuncs.np_logical_and_impl,
|
|
451
|
+
"dd->?": npyfuncs.np_logical_and_impl,
|
|
452
|
+
"FF->?": npyfuncs.np_complex_logical_and_impl,
|
|
453
|
+
"DD->?": npyfuncs.np_complex_logical_and_impl,
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
db[np.logical_or] = {
|
|
457
|
+
"??->?": npyfuncs.np_logical_or_impl,
|
|
458
|
+
"bb->?": npyfuncs.np_logical_or_impl,
|
|
459
|
+
"BB->?": npyfuncs.np_logical_or_impl,
|
|
460
|
+
"hh->?": npyfuncs.np_logical_or_impl,
|
|
461
|
+
"HH->?": npyfuncs.np_logical_or_impl,
|
|
462
|
+
"ii->?": npyfuncs.np_logical_or_impl,
|
|
463
|
+
"II->?": npyfuncs.np_logical_or_impl,
|
|
464
|
+
"ll->?": npyfuncs.np_logical_or_impl,
|
|
465
|
+
"LL->?": npyfuncs.np_logical_or_impl,
|
|
466
|
+
"qq->?": npyfuncs.np_logical_or_impl,
|
|
467
|
+
"QQ->?": npyfuncs.np_logical_or_impl,
|
|
468
|
+
"ff->?": npyfuncs.np_logical_or_impl,
|
|
469
|
+
"dd->?": npyfuncs.np_logical_or_impl,
|
|
470
|
+
"FF->?": npyfuncs.np_complex_logical_or_impl,
|
|
471
|
+
"DD->?": npyfuncs.np_complex_logical_or_impl,
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
db[np.logical_xor] = {
|
|
475
|
+
"??->?": npyfuncs.np_logical_xor_impl,
|
|
476
|
+
"bb->?": npyfuncs.np_logical_xor_impl,
|
|
477
|
+
"BB->?": npyfuncs.np_logical_xor_impl,
|
|
478
|
+
"hh->?": npyfuncs.np_logical_xor_impl,
|
|
479
|
+
"HH->?": npyfuncs.np_logical_xor_impl,
|
|
480
|
+
"ii->?": npyfuncs.np_logical_xor_impl,
|
|
481
|
+
"II->?": npyfuncs.np_logical_xor_impl,
|
|
482
|
+
"ll->?": npyfuncs.np_logical_xor_impl,
|
|
483
|
+
"LL->?": npyfuncs.np_logical_xor_impl,
|
|
484
|
+
"qq->?": npyfuncs.np_logical_xor_impl,
|
|
485
|
+
"QQ->?": npyfuncs.np_logical_xor_impl,
|
|
486
|
+
"ff->?": npyfuncs.np_logical_xor_impl,
|
|
487
|
+
"dd->?": npyfuncs.np_logical_xor_impl,
|
|
488
|
+
"FF->?": npyfuncs.np_complex_logical_xor_impl,
|
|
489
|
+
"DD->?": npyfuncs.np_complex_logical_xor_impl,
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
db[np.logical_not] = {
|
|
493
|
+
"?->?": npyfuncs.np_logical_not_impl,
|
|
494
|
+
"b->?": npyfuncs.np_logical_not_impl,
|
|
495
|
+
"B->?": npyfuncs.np_logical_not_impl,
|
|
496
|
+
"h->?": npyfuncs.np_logical_not_impl,
|
|
497
|
+
"H->?": npyfuncs.np_logical_not_impl,
|
|
498
|
+
"i->?": npyfuncs.np_logical_not_impl,
|
|
499
|
+
"I->?": npyfuncs.np_logical_not_impl,
|
|
500
|
+
"l->?": npyfuncs.np_logical_not_impl,
|
|
501
|
+
"L->?": npyfuncs.np_logical_not_impl,
|
|
502
|
+
"q->?": npyfuncs.np_logical_not_impl,
|
|
503
|
+
"Q->?": npyfuncs.np_logical_not_impl,
|
|
504
|
+
"f->?": npyfuncs.np_logical_not_impl,
|
|
505
|
+
"d->?": npyfuncs.np_logical_not_impl,
|
|
506
|
+
"F->?": npyfuncs.np_complex_logical_not_impl,
|
|
507
|
+
"D->?": npyfuncs.np_complex_logical_not_impl,
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
db[np.maximum] = {
|
|
511
|
+
"??->?": npyfuncs.np_logical_or_impl,
|
|
512
|
+
"bb->b": npyfuncs.np_int_smax_impl,
|
|
513
|
+
"BB->B": npyfuncs.np_int_umax_impl,
|
|
514
|
+
"hh->h": npyfuncs.np_int_smax_impl,
|
|
515
|
+
"HH->H": npyfuncs.np_int_umax_impl,
|
|
516
|
+
"ii->i": npyfuncs.np_int_smax_impl,
|
|
517
|
+
"II->I": npyfuncs.np_int_umax_impl,
|
|
518
|
+
"ll->l": npyfuncs.np_int_smax_impl,
|
|
519
|
+
"LL->L": npyfuncs.np_int_umax_impl,
|
|
520
|
+
"qq->q": npyfuncs.np_int_smax_impl,
|
|
521
|
+
"QQ->Q": npyfuncs.np_int_umax_impl,
|
|
522
|
+
"ff->f": npyfuncs.np_real_maximum_impl,
|
|
523
|
+
"dd->d": npyfuncs.np_real_maximum_impl,
|
|
524
|
+
"FF->F": npyfuncs.np_complex_maximum_impl,
|
|
525
|
+
"DD->D": npyfuncs.np_complex_maximum_impl,
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
db[np.minimum] = {
|
|
529
|
+
"??->?": npyfuncs.np_logical_and_impl,
|
|
530
|
+
"bb->b": npyfuncs.np_int_smin_impl,
|
|
531
|
+
"BB->B": npyfuncs.np_int_umin_impl,
|
|
532
|
+
"hh->h": npyfuncs.np_int_smin_impl,
|
|
533
|
+
"HH->H": npyfuncs.np_int_umin_impl,
|
|
534
|
+
"ii->i": npyfuncs.np_int_smin_impl,
|
|
535
|
+
"II->I": npyfuncs.np_int_umin_impl,
|
|
536
|
+
"ll->l": npyfuncs.np_int_smin_impl,
|
|
537
|
+
"LL->L": npyfuncs.np_int_umin_impl,
|
|
538
|
+
"qq->q": npyfuncs.np_int_smin_impl,
|
|
539
|
+
"QQ->Q": npyfuncs.np_int_umin_impl,
|
|
540
|
+
"ff->f": npyfuncs.np_real_minimum_impl,
|
|
541
|
+
"dd->d": npyfuncs.np_real_minimum_impl,
|
|
542
|
+
"FF->F": npyfuncs.np_complex_minimum_impl,
|
|
543
|
+
"DD->D": npyfuncs.np_complex_minimum_impl,
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
db[np.fmax] = {
|
|
547
|
+
"??->?": npyfuncs.np_logical_or_impl,
|
|
548
|
+
"bb->b": npyfuncs.np_int_smax_impl,
|
|
549
|
+
"BB->B": npyfuncs.np_int_umax_impl,
|
|
550
|
+
"hh->h": npyfuncs.np_int_smax_impl,
|
|
551
|
+
"HH->H": npyfuncs.np_int_umax_impl,
|
|
552
|
+
"ii->i": npyfuncs.np_int_smax_impl,
|
|
553
|
+
"II->I": npyfuncs.np_int_umax_impl,
|
|
554
|
+
"ll->l": npyfuncs.np_int_smax_impl,
|
|
555
|
+
"LL->L": npyfuncs.np_int_umax_impl,
|
|
556
|
+
"qq->q": npyfuncs.np_int_smax_impl,
|
|
557
|
+
"QQ->Q": npyfuncs.np_int_umax_impl,
|
|
558
|
+
"ff->f": npyfuncs.np_real_fmax_impl,
|
|
559
|
+
"dd->d": npyfuncs.np_real_fmax_impl,
|
|
560
|
+
"FF->F": npyfuncs.np_complex_fmax_impl,
|
|
561
|
+
"DD->D": npyfuncs.np_complex_fmax_impl,
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
db[np.fmin] = {
|
|
565
|
+
"??->?": npyfuncs.np_logical_and_impl,
|
|
566
|
+
"bb->b": npyfuncs.np_int_smin_impl,
|
|
567
|
+
"BB->B": npyfuncs.np_int_umin_impl,
|
|
568
|
+
"hh->h": npyfuncs.np_int_smin_impl,
|
|
569
|
+
"HH->H": npyfuncs.np_int_umin_impl,
|
|
570
|
+
"ii->i": npyfuncs.np_int_smin_impl,
|
|
571
|
+
"II->I": npyfuncs.np_int_umin_impl,
|
|
572
|
+
"ll->l": npyfuncs.np_int_smin_impl,
|
|
573
|
+
"LL->L": npyfuncs.np_int_umin_impl,
|
|
574
|
+
"qq->q": npyfuncs.np_int_smin_impl,
|
|
575
|
+
"QQ->Q": npyfuncs.np_int_umin_impl,
|
|
576
|
+
"ff->f": npyfuncs.np_real_fmin_impl,
|
|
577
|
+
"dd->d": npyfuncs.np_real_fmin_impl,
|
|
578
|
+
"FF->F": npyfuncs.np_complex_fmin_impl,
|
|
579
|
+
"DD->D": npyfuncs.np_complex_fmin_impl,
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
db[np.bitwise_and] = {
|
|
583
|
+
"??->?": numbers.int_and_impl,
|
|
584
|
+
"bb->b": numbers.int_and_impl,
|
|
585
|
+
"BB->B": numbers.int_and_impl,
|
|
586
|
+
"hh->h": numbers.int_and_impl,
|
|
587
|
+
"HH->H": numbers.int_and_impl,
|
|
588
|
+
"ii->i": numbers.int_and_impl,
|
|
589
|
+
"II->I": numbers.int_and_impl,
|
|
590
|
+
"ll->l": numbers.int_and_impl,
|
|
591
|
+
"LL->L": numbers.int_and_impl,
|
|
592
|
+
"qq->q": numbers.int_and_impl,
|
|
593
|
+
"QQ->Q": numbers.int_and_impl,
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
db[np.bitwise_or] = {
|
|
597
|
+
"??->?": numbers.int_or_impl,
|
|
598
|
+
"bb->b": numbers.int_or_impl,
|
|
599
|
+
"BB->B": numbers.int_or_impl,
|
|
600
|
+
"hh->h": numbers.int_or_impl,
|
|
601
|
+
"HH->H": numbers.int_or_impl,
|
|
602
|
+
"ii->i": numbers.int_or_impl,
|
|
603
|
+
"II->I": numbers.int_or_impl,
|
|
604
|
+
"ll->l": numbers.int_or_impl,
|
|
605
|
+
"LL->L": numbers.int_or_impl,
|
|
606
|
+
"qq->q": numbers.int_or_impl,
|
|
607
|
+
"QQ->Q": numbers.int_or_impl,
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
db[np.bitwise_xor] = {
|
|
611
|
+
"??->?": numbers.int_xor_impl,
|
|
612
|
+
"bb->b": numbers.int_xor_impl,
|
|
613
|
+
"BB->B": numbers.int_xor_impl,
|
|
614
|
+
"hh->h": numbers.int_xor_impl,
|
|
615
|
+
"HH->H": numbers.int_xor_impl,
|
|
616
|
+
"ii->i": numbers.int_xor_impl,
|
|
617
|
+
"II->I": numbers.int_xor_impl,
|
|
618
|
+
"ll->l": numbers.int_xor_impl,
|
|
619
|
+
"LL->L": numbers.int_xor_impl,
|
|
620
|
+
"qq->q": numbers.int_xor_impl,
|
|
621
|
+
"QQ->Q": numbers.int_xor_impl,
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
db[np.invert] = {
|
|
625
|
+
"?->?": numbers.int_invert_impl,
|
|
626
|
+
"b->b": numbers.int_invert_impl,
|
|
627
|
+
"B->B": numbers.int_invert_impl,
|
|
628
|
+
"h->h": numbers.int_invert_impl,
|
|
629
|
+
"H->H": numbers.int_invert_impl,
|
|
630
|
+
"i->i": numbers.int_invert_impl,
|
|
631
|
+
"I->I": numbers.int_invert_impl,
|
|
632
|
+
"l->l": numbers.int_invert_impl,
|
|
633
|
+
"L->L": numbers.int_invert_impl,
|
|
634
|
+
"q->q": numbers.int_invert_impl,
|
|
635
|
+
"Q->Q": numbers.int_invert_impl,
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
db[np.left_shift] = {
|
|
639
|
+
"bb->b": numbers.int_shl_impl,
|
|
640
|
+
"BB->B": numbers.int_shl_impl,
|
|
641
|
+
"hh->h": numbers.int_shl_impl,
|
|
642
|
+
"HH->H": numbers.int_shl_impl,
|
|
643
|
+
"ii->i": numbers.int_shl_impl,
|
|
644
|
+
"II->I": numbers.int_shl_impl,
|
|
645
|
+
"ll->l": numbers.int_shl_impl,
|
|
646
|
+
"LL->L": numbers.int_shl_impl,
|
|
647
|
+
"qq->q": numbers.int_shl_impl,
|
|
648
|
+
"QQ->Q": numbers.int_shl_impl,
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
db[np.right_shift] = {
|
|
652
|
+
"bb->b": numbers.int_shr_impl,
|
|
653
|
+
"BB->B": numbers.int_shr_impl,
|
|
654
|
+
"hh->h": numbers.int_shr_impl,
|
|
655
|
+
"HH->H": numbers.int_shr_impl,
|
|
656
|
+
"ii->i": numbers.int_shr_impl,
|
|
657
|
+
"II->I": numbers.int_shr_impl,
|
|
658
|
+
"ll->l": numbers.int_shr_impl,
|
|
659
|
+
"LL->L": numbers.int_shr_impl,
|
|
660
|
+
"qq->q": numbers.int_shr_impl,
|
|
661
|
+
"QQ->Q": numbers.int_shr_impl,
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
db[np.log] = {
|
|
665
|
+
"f->f": np_real_log_impl,
|
|
666
|
+
"d->d": np_real_log_impl,
|
|
667
|
+
"F->F": npyfuncs.np_complex_log_impl,
|
|
668
|
+
"D->D": npyfuncs.np_complex_log_impl,
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
db[np.log2] = {
|
|
672
|
+
"f->f": np_real_log2_impl,
|
|
673
|
+
"d->d": np_real_log2_impl,
|
|
674
|
+
"F->F": npyfuncs.np_complex_log2_impl,
|
|
675
|
+
"D->D": npyfuncs.np_complex_log2_impl,
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
db[np.log10] = {
|
|
679
|
+
"f->f": np_real_log10_impl,
|
|
680
|
+
"d->d": np_real_log10_impl,
|
|
681
|
+
"F->F": npyfuncs.np_complex_log10_impl,
|
|
682
|
+
"D->D": npyfuncs.np_complex_log10_impl,
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
db[np.isnan] = {
|
|
686
|
+
"f->?": npyfuncs.np_real_isnan_impl,
|
|
687
|
+
"d->?": npyfuncs.np_real_isnan_impl,
|
|
688
|
+
"F->?": npyfuncs.np_complex_isnan_impl,
|
|
689
|
+
"D->?": npyfuncs.np_complex_isnan_impl,
|
|
690
|
+
# int8
|
|
691
|
+
"b->?": npyfuncs.np_int_isnan_impl,
|
|
692
|
+
"B->?": npyfuncs.np_int_isnan_impl,
|
|
693
|
+
# int16
|
|
694
|
+
"h->?": npyfuncs.np_int_isnan_impl,
|
|
695
|
+
"H->?": npyfuncs.np_int_isnan_impl,
|
|
696
|
+
# int32
|
|
697
|
+
"i->?": npyfuncs.np_int_isnan_impl,
|
|
698
|
+
"I->?": npyfuncs.np_int_isnan_impl,
|
|
699
|
+
# int64
|
|
700
|
+
"l->?": npyfuncs.np_int_isnan_impl,
|
|
701
|
+
"L->?": npyfuncs.np_int_isnan_impl,
|
|
702
|
+
# intp
|
|
703
|
+
"q->?": npyfuncs.np_int_isnan_impl,
|
|
704
|
+
"Q->?": npyfuncs.np_int_isnan_impl,
|
|
705
|
+
# boolean
|
|
706
|
+
"?->?": npyfuncs.np_int_isnan_impl,
|
|
707
|
+
# datetime & timedelta
|
|
708
|
+
"m->?": npyfuncs.np_datetime_isnat_impl,
|
|
709
|
+
"M->?": npyfuncs.np_datetime_isnat_impl,
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
db[np.conjugate] = {
|
|
713
|
+
"b->b": numbers.real_conjugate_impl,
|
|
714
|
+
"B->B": numbers.real_conjugate_impl,
|
|
715
|
+
"h->h": numbers.real_conjugate_impl,
|
|
716
|
+
"H->H": numbers.real_conjugate_impl,
|
|
717
|
+
"i->i": numbers.real_conjugate_impl,
|
|
718
|
+
"I->I": numbers.real_conjugate_impl,
|
|
719
|
+
"l->l": numbers.real_conjugate_impl,
|
|
720
|
+
"L->L": numbers.real_conjugate_impl,
|
|
721
|
+
"q->q": numbers.real_conjugate_impl,
|
|
722
|
+
"Q->Q": numbers.real_conjugate_impl,
|
|
723
|
+
"f->f": numbers.real_conjugate_impl,
|
|
724
|
+
"d->d": numbers.real_conjugate_impl,
|
|
725
|
+
"F->F": numbers.complex_conjugate_impl,
|
|
726
|
+
"D->D": numbers.complex_conjugate_impl,
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
db[np.divide] = {
|
|
730
|
+
"bb->b": npyfuncs.np_int_truediv_impl,
|
|
731
|
+
"BB->B": npyfuncs.np_int_truediv_impl,
|
|
732
|
+
"hh->h": npyfuncs.np_int_truediv_impl,
|
|
733
|
+
"HH->H": npyfuncs.np_int_truediv_impl,
|
|
734
|
+
"ii->i": npyfuncs.np_int_truediv_impl,
|
|
735
|
+
"II->I": npyfuncs.np_int_truediv_impl,
|
|
736
|
+
"ll->l": npyfuncs.np_int_truediv_impl,
|
|
737
|
+
"LL->L": npyfuncs.np_int_truediv_impl,
|
|
738
|
+
"qq->q": npyfuncs.np_int_truediv_impl,
|
|
739
|
+
"QQ->Q": npyfuncs.np_int_truediv_impl,
|
|
740
|
+
"ff->f": npyfuncs.np_real_div_impl,
|
|
741
|
+
"dd->d": npyfuncs.np_real_div_impl,
|
|
742
|
+
"FF->F": npyfuncs.np_complex_div_impl,
|
|
743
|
+
"DD->D": npyfuncs.np_complex_div_impl,
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
return db
|