├── .clang-format ├── .flake8 ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── CODEOWNERS ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── Windows-IntelLLVM_3.22.cmake │ ├── Windows-IntelLLVM_3.26.cmake │ ├── array-api-skips.txt │ ├── build-sphinx.yml │ ├── check-mkl-interfaces.yaml │ ├── conda-package.yml │ ├── cron-run-tests.yaml │ ├── generate_coverage.yaml │ ├── openssf-scorecard.yml │ └── pre-commit.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── THANKS.txt ├── benchmarks ├── asv.conf.json ├── benchmarks │ ├── __init__.py │ ├── bench_elementwise.py │ ├── bench_linalg.py │ ├── bench_random.py │ └── common.py └── pytest_benchmark │ ├── README.md │ └── test_random.py ├── conda-recipe ├── bld.bat ├── build.sh ├── conda_build_config.yaml ├── meta.yaml ├── run_test.bat └── run_test.sh ├── doc ├── 0.builddoc.sh ├── Makefile ├── _templates │ └── autosummary │ │ ├── attribute.rst │ │ ├── base.rst │ │ ├── class.rst │ │ ├── member.rst │ │ ├── method.rst │ │ ├── minimal_module.rst │ │ └── module.rst ├── comparison_generator.py ├── conf.py ├── docstring_template.py ├── dpctl.rst ├── dpnp_backend_api.rst ├── ext_links.txt ├── index.rst ├── known_words.txt ├── make.bat ├── overview.rst ├── quick_start_guide.rst └── reference │ ├── array-creation.rst │ ├── array-manipulation.rst │ ├── array_api.rst │ ├── bitwise.rst │ ├── comparison.rst │ ├── dtype.rst │ ├── dtypes_table.rst │ ├── fft.rst │ ├── functional.rst │ ├── index.rst │ ├── indexing.rst │ ├── linalg.rst │ ├── logic.rst │ ├── math.rst │ ├── ndarray.rst │ ├── other.rst │ ├── polynomials.rst │ ├── random.rst │ ├── routines.rst │ ├── set.rst │ ├── sort.rst │ ├── special.rst │ ├── statistics.rst │ ├── ufunc.rst │ └── window.rst ├── dpnp ├── CMakeLists.txt ├── __init__.py ├── _version.py ├── backend │ ├── CMakeLists.txt │ ├── cmake │ │ └── Modules │ │ │ ├── IntelSYCLConfig.cmake │ │ │ ├── MKLConfig.cmake │ │ │ ├── README.md │ │ │ ├── TBBConfig.cmake │ │ │ └── oneDPLConfig.cmake │ ├── doc │ │ └── Doxyfile │ ├── examples │ │ ├── example10.cpp │ │ └── example5.cpp │ ├── extensions │ │ ├── blas │ │ │ ├── CMakeLists.txt │ │ │ ├── blas_py.cpp │ │ │ ├── dot.hpp │ │ │ ├── dot_common.hpp │ │ │ ├── dotc.hpp │ │ │ ├── dotu.hpp │ │ │ ├── gemm.cpp │ │ │ ├── gemm.hpp │ │ │ ├── gemm_batch.cpp │ │ │ ├── gemv.cpp │ │ │ ├── gemv.hpp │ │ │ └── types_matrix.hpp │ │ ├── common │ │ │ └── ext │ │ │ │ ├── common.hpp │ │ │ │ ├── details │ │ │ │ ├── common_internal.hpp │ │ │ │ └── validation_utils_internal.hpp │ │ │ │ ├── dispatch_table.hpp │ │ │ │ └── validation_utils.hpp │ │ ├── elementwise_functions │ │ │ ├── elementwise_functions.hpp │ │ │ ├── elementwise_functions_type_utils.cpp │ │ │ ├── elementwise_functions_type_utils.hpp │ │ │ ├── simplify_iteration_space.cpp │ │ │ └── simplify_iteration_space.hpp │ │ ├── fft │ │ │ ├── CMakeLists.txt │ │ │ ├── common.hpp │ │ │ ├── fft_py.cpp │ │ │ ├── fft_utils.hpp │ │ │ ├── in_place.hpp │ │ │ ├── in_place.tpp │ │ │ ├── out_of_place.hpp │ │ │ └── out_of_place.tpp │ │ ├── indexing │ │ │ ├── CMakeLists.txt │ │ │ ├── choose.cpp │ │ │ ├── choose.hpp │ │ │ ├── choose_kernel.hpp │ │ │ └── indexing_py.cpp │ │ ├── lapack │ │ │ ├── CMakeLists.txt │ │ │ ├── common_helpers.hpp │ │ │ ├── evd_batch_common.hpp │ │ │ ├── evd_common.hpp │ │ │ ├── evd_common_utils.hpp │ │ │ ├── geqrf.cpp │ │ │ ├── geqrf.hpp │ │ │ ├── geqrf_batch.cpp │ │ │ ├── gesv.cpp │ │ │ ├── gesv.hpp │ │ │ ├── gesv_batch.cpp │ │ │ ├── gesv_common_utils.hpp │ │ │ ├── gesvd.cpp │ │ │ ├── gesvd.hpp │ │ │ ├── gesvd_batch.cpp │ │ │ ├── gesvd_common_utils.hpp │ │ │ ├── getrf.cpp │ │ │ ├── getrf.hpp │ │ │ ├── getrf_batch.cpp │ │ │ ├── getri.hpp │ │ │ ├── getri_batch.cpp │ │ │ ├── getrs.cpp │ │ │ ├── getrs.hpp │ │ │ ├── heevd.cpp │ │ │ ├── heevd.hpp │ │ │ ├── heevd_batch.cpp │ │ │ ├── heevd_batch.hpp │ │ │ ├── lapack_py.cpp │ │ │ ├── linalg_exceptions.hpp │ │ │ ├── orgqr.cpp │ │ │ ├── orgqr.hpp │ │ │ ├── orgqr_batch.cpp │ │ │ ├── potrf.cpp │ │ │ ├── potrf.hpp │ │ │ ├── potrf_batch.cpp │ │ │ ├── syevd.cpp │ │ │ ├── syevd.hpp │ │ │ ├── syevd_batch.cpp │ │ │ ├── syevd_batch.hpp │ │ │ ├── types_matrix.hpp │ │ │ ├── ungqr.cpp │ │ │ ├── ungqr.hpp │ │ │ └── ungqr_batch.cpp │ │ ├── statistics │ │ │ ├── CMakeLists.txt │ │ │ ├── bincount.cpp │ │ │ ├── bincount.hpp │ │ │ ├── histogram.cpp │ │ │ ├── histogram.hpp │ │ │ ├── histogram_common.cpp │ │ │ ├── histogram_common.hpp │ │ │ ├── histogramdd.cpp │ │ │ ├── histogramdd.hpp │ │ │ ├── sliding_dot_product1d.cpp │ │ │ ├── sliding_dot_product1d.hpp │ │ │ ├── sliding_window1d.cpp │ │ │ ├── sliding_window1d.hpp │ │ │ └── statistics_py.cpp │ │ ├── ufunc │ │ │ ├── CMakeLists.txt │ │ │ ├── elementwise_functions │ │ │ │ ├── bitwise_count.cpp │ │ │ │ ├── bitwise_count.hpp │ │ │ │ ├── common.cpp │ │ │ │ ├── common.hpp │ │ │ │ ├── degrees.cpp │ │ │ │ ├── degrees.hpp │ │ │ │ ├── fabs.cpp │ │ │ │ ├── fabs.hpp │ │ │ │ ├── fix.cpp │ │ │ │ ├── fix.hpp │ │ │ │ ├── float_power.cpp │ │ │ │ ├── float_power.hpp │ │ │ │ ├── fmax.cpp │ │ │ │ ├── fmax.hpp │ │ │ │ ├── fmin.cpp │ │ │ │ ├── fmin.hpp │ │ │ │ ├── fmod.cpp │ │ │ │ ├── fmod.hpp │ │ │ │ ├── gcd.cpp │ │ │ │ ├── gcd.hpp │ │ │ │ ├── heaviside.cpp │ │ │ │ ├── heaviside.hpp │ │ │ │ ├── i0.cpp │ │ │ │ ├── i0.hpp │ │ │ │ ├── interpolate.cpp │ │ │ │ ├── interpolate.hpp │ │ │ │ ├── lcm.cpp │ │ │ │ ├── lcm.hpp │ │ │ │ ├── ldexp.cpp │ │ │ │ ├── ldexp.hpp │ │ │ │ ├── logaddexp2.cpp │ │ │ │ ├── logaddexp2.hpp │ │ │ │ ├── nan_to_num.cpp │ │ │ │ ├── nan_to_num.hpp │ │ │ │ ├── populate.hpp │ │ │ │ ├── radians.cpp │ │ │ │ ├── radians.hpp │ │ │ │ ├── sinc.cpp │ │ │ │ ├── sinc.hpp │ │ │ │ ├── spacing.cpp │ │ │ │ └── spacing.hpp │ │ │ └── ufunc_py.cpp │ │ ├── vm │ │ │ ├── CMakeLists.txt │ │ │ ├── abs.cpp │ │ │ ├── abs.hpp │ │ │ ├── acos.cpp │ │ │ ├── acos.hpp │ │ │ ├── acosh.cpp │ │ │ ├── acosh.hpp │ │ │ ├── add.cpp │ │ │ ├── add.hpp │ │ │ ├── arg.cpp │ │ │ ├── arg.hpp │ │ │ ├── asin.cpp │ │ │ ├── asin.hpp │ │ │ ├── asinh.cpp │ │ │ ├── asinh.hpp │ │ │ ├── atan.cpp │ │ │ ├── atan.hpp │ │ │ ├── atan2.cpp │ │ │ ├── atan2.hpp │ │ │ ├── atanh.cpp │ │ │ ├── atanh.hpp │ │ │ ├── cbrt.cpp │ │ │ ├── cbrt.hpp │ │ │ ├── ceil.cpp │ │ │ ├── ceil.hpp │ │ │ ├── common.hpp │ │ │ ├── conj.cpp │ │ │ ├── conj.hpp │ │ │ ├── copysign.cpp │ │ │ ├── copysign.hpp │ │ │ ├── cos.cpp │ │ │ ├── cos.hpp │ │ │ ├── cosh.cpp │ │ │ ├── cosh.hpp │ │ │ ├── div.cpp │ │ │ ├── div.hpp │ │ │ ├── exp.cpp │ │ │ ├── exp.hpp │ │ │ ├── exp2.cpp │ │ │ ├── exp2.hpp │ │ │ ├── expm1.cpp │ │ │ ├── expm1.hpp │ │ │ ├── floor.cpp │ │ │ ├── floor.hpp │ │ │ ├── fmax.cpp │ │ │ ├── fmax.hpp │ │ │ ├── fmin.cpp │ │ │ ├── fmin.hpp │ │ │ ├── fmod.cpp │ │ │ ├── fmod.hpp │ │ │ ├── hypot.cpp │ │ │ ├── hypot.hpp │ │ │ ├── i0.cpp │ │ │ ├── i0.hpp │ │ │ ├── inv.cpp │ │ │ ├── inv.hpp │ │ │ ├── ln.cpp │ │ │ ├── ln.hpp │ │ │ ├── log10.cpp │ │ │ ├── log10.hpp │ │ │ ├── log1p.cpp │ │ │ ├── log1p.hpp │ │ │ ├── log2.cpp │ │ │ ├── log2.hpp │ │ │ ├── mul.cpp │ │ │ ├── mul.hpp │ │ │ ├── nextafter.cpp │ │ │ ├── nextafter.hpp │ │ │ ├── pow.cpp │ │ │ ├── pow.hpp │ │ │ ├── rint.cpp │ │ │ ├── rint.hpp │ │ │ ├── sin.cpp │ │ │ ├── sin.hpp │ │ │ ├── sinh.cpp │ │ │ ├── sinh.hpp │ │ │ ├── sqr.cpp │ │ │ ├── sqr.hpp │ │ │ ├── sqrt.cpp │ │ │ ├── sqrt.hpp │ │ │ ├── sub.cpp │ │ │ ├── sub.hpp │ │ │ ├── tan.cpp │ │ │ ├── tan.hpp │ │ │ ├── tanh.cpp │ │ │ ├── tanh.hpp │ │ │ ├── trunc.cpp │ │ │ ├── trunc.hpp │ │ │ └── vm_py.cpp │ │ └── window │ │ │ ├── CMakeLists.txt │ │ │ ├── bartlett.hpp │ │ │ ├── blackman.hpp │ │ │ ├── common.hpp │ │ │ ├── hamming.hpp │ │ │ ├── hanning.hpp │ │ │ ├── kaiser.cpp │ │ │ ├── kaiser.hpp │ │ │ └── window_py.cpp │ ├── include │ │ ├── dpnp_gen_1arg_1type_tbl.hpp │ │ ├── dpnp_iface.hpp │ │ ├── dpnp_iface_fptr.hpp │ │ └── dpnp_iface_random.hpp │ ├── kernels │ │ ├── dpnp_krnl_arraycreation.cpp │ │ ├── dpnp_krnl_common.cpp │ │ ├── dpnp_krnl_elemwise.cpp │ │ ├── dpnp_krnl_mathematical.cpp │ │ ├── dpnp_krnl_random.cpp │ │ ├── dpnp_krnl_sorting.cpp │ │ └── elementwise_functions │ │ │ ├── bitwise_count.hpp │ │ │ ├── degrees.hpp │ │ │ ├── fabs.hpp │ │ │ ├── fix.hpp │ │ │ ├── fmax.hpp │ │ │ ├── fmin.hpp │ │ │ ├── fmod.hpp │ │ │ ├── gcd.hpp │ │ │ ├── heaviside.hpp │ │ │ ├── i0.hpp │ │ │ ├── interpolate.hpp │ │ │ ├── lcm.hpp │ │ │ ├── ldexp.hpp │ │ │ ├── logaddexp2.hpp │ │ │ ├── nan_to_num.hpp │ │ │ ├── radians.hpp │ │ │ ├── sinc.hpp │ │ │ └── spacing.hpp │ ├── src │ │ ├── dpnp_fptr.hpp │ │ ├── dpnp_iface_fptr.cpp │ │ ├── dpnp_iterator.hpp │ │ ├── dpnp_pstl.hpp │ │ ├── dpnp_random_state.cpp │ │ ├── dpnp_random_state.hpp │ │ ├── dpnp_utils.hpp │ │ ├── dpnpc_memory_adapter.hpp │ │ ├── memory_sycl.cpp │ │ ├── queue_sycl.cpp │ │ ├── queue_sycl.hpp │ │ ├── verbose.cpp │ │ └── verbose.hpp │ └── tests │ │ ├── CMakeLists.txt │ │ ├── dpnp_test_utils.hpp │ │ ├── test_broadcast_iterator.cpp │ │ ├── test_main.cpp │ │ ├── test_random.cpp │ │ ├── test_utils.cpp │ │ └── test_utils_iterator.cpp ├── cmake │ └── copy_existing.cmake ├── config.py ├── dpnp_algo │ ├── CMakeLists.txt │ ├── __init__.pxd │ ├── __init__.py │ ├── dpnp_algo.pxd │ ├── dpnp_algo.pyx │ ├── dpnp_algo_indexing.pxi │ ├── dpnp_algo_mathematical.pxi │ ├── dpnp_algo_sorting.pxi │ ├── dpnp_algo_special.pxi │ ├── dpnp_arraycreation.py │ ├── dpnp_elementwise_common.py │ └── dpnp_fill.py ├── dpnp_array.py ├── dpnp_array_api_info.py ├── dpnp_container.py ├── dpnp_flatiter.py ├── dpnp_iface.py ├── dpnp_iface_arraycreation.py ├── dpnp_iface_bitwise.py ├── dpnp_iface_counting.py ├── dpnp_iface_functional.py ├── dpnp_iface_histograms.py ├── dpnp_iface_indexing.py ├── dpnp_iface_libmath.py ├── dpnp_iface_linearalgebra.py ├── dpnp_iface_logic.py ├── dpnp_iface_manipulation.py ├── dpnp_iface_mathematical.py ├── dpnp_iface_nanfunctions.py ├── dpnp_iface_searching.py ├── dpnp_iface_sorting.py ├── dpnp_iface_statistics.py ├── dpnp_iface_trigonometric.py ├── dpnp_iface_types.py ├── dpnp_iface_utils.py ├── dpnp_iface_window.py ├── dpnp_utils │ ├── CMakeLists.txt │ ├── __init__.pxd │ ├── __init__.py │ ├── dpnp_algo_utils.pxd │ ├── dpnp_algo_utils.pyx │ ├── dpnp_utils_common.py │ ├── dpnp_utils_einsum.py │ ├── dpnp_utils_linearalgebra.py │ ├── dpnp_utils_pad.py │ ├── dpnp_utils_reduction.py │ └── dpnp_utils_statistics.py ├── fft │ ├── __init__.py │ ├── dpnp_iface_fft.py │ └── dpnp_utils_fft.py ├── linalg │ ├── __init__.py │ ├── dpnp_iface_linalg.py │ └── dpnp_utils_linalg.py ├── random │ ├── CMakeLists.txt │ ├── __init__.py │ ├── dpnp_algo_random.pyx │ ├── dpnp_iface_random.py │ └── dpnp_random_state.py ├── tests │ ├── __init__.py │ ├── config.py │ ├── conftest.py │ ├── helper.py │ ├── skipped_tests.tbl │ ├── skipped_tests_cuda.tbl │ ├── skipped_tests_gpu.tbl │ ├── test_absolute.py │ ├── test_amin_amax.py │ ├── test_arithmetic.py │ ├── test_array_api_info.py │ ├── test_array_utils.py │ ├── test_arraycreation.py │ ├── test_arraymanipulation.py │ ├── test_arraypad.py │ ├── test_binary_ufuncs.py │ ├── test_bitwise.py │ ├── test_copy.py │ ├── test_counting.py │ ├── test_dlpack.py │ ├── test_dtype_routines.py │ ├── test_fft.py │ ├── test_fill.py │ ├── test_flat.py │ ├── test_flipping.py │ ├── test_functional.py │ ├── test_histogram.py │ ├── test_indexing.py │ ├── test_linalg.py │ ├── test_logic.py │ ├── test_manipulation.py │ ├── test_mathematical.py │ ├── test_mixins.py │ ├── test_nanfunctions.py │ ├── test_ndarray.py │ ├── test_outer.py │ ├── test_product.py │ ├── test_random.py │ ├── test_random_state.py │ ├── test_search.py │ ├── test_sort.py │ ├── test_special.py │ ├── test_statistics.py │ ├── test_strides.py │ ├── test_sum.py │ ├── test_sycl_queue.py │ ├── test_umath.py │ ├── test_usm_type.py │ ├── test_utils.py │ ├── test_window.py │ ├── testing │ │ ├── __init__.py │ │ └── array.py │ ├── tests_perf │ │ ├── __init__.py │ │ ├── data_generator.py │ │ ├── examples │ │ │ └── sinAB_test.py │ │ ├── math_tests │ │ │ ├── __init__.py │ │ │ ├── test_black_scholes.py │ │ │ ├── test_dpnp.py │ │ │ ├── test_mathematical.py │ │ │ └── test_trigonometric.py │ │ └── test_perf_base.py │ └── third_party │ │ ├── __init__.py │ │ ├── cupy │ │ ├── __init__.py │ │ ├── binary_tests │ │ │ ├── __init__.py │ │ │ ├── test_elementwise.py │ │ │ └── test_packing.py │ │ ├── core_tests │ │ │ ├── __init__.py │ │ │ ├── test_array_function.py │ │ │ ├── test_carray.py │ │ │ ├── test_core.py │ │ │ ├── test_cub_reduction.py │ │ │ ├── test_dlpack.py │ │ │ ├── test_elementwise.py │ │ │ ├── test_flags.py │ │ │ ├── test_function.py │ │ │ ├── test_gufuncs.py │ │ │ ├── test_include.py │ │ │ ├── test_internal.py │ │ │ ├── test_iter.py │ │ │ ├── test_ndarray.py │ │ │ ├── test_ndarray_adv_indexing.py │ │ │ ├── test_ndarray_complex_ops.py │ │ │ ├── test_ndarray_contiguity.py │ │ │ ├── test_ndarray_conversion.py │ │ │ ├── test_ndarray_copy_and_view.py │ │ │ ├── test_ndarray_cuda_array_interface.py │ │ │ ├── test_ndarray_elementwise_op.py │ │ │ ├── test_ndarray_get.py │ │ │ ├── test_ndarray_indexing.py │ │ │ ├── test_ndarray_math.py │ │ │ ├── test_ndarray_owndata.py │ │ │ ├── test_ndarray_reduction.py │ │ │ ├── test_ndarray_scatter.py │ │ │ ├── test_ndarray_ufunc.py │ │ │ ├── test_ndarray_unary_op.py │ │ │ ├── test_nep50_examples.py │ │ │ ├── test_raw.py │ │ │ ├── test_reduction.py │ │ │ ├── test_scan.py │ │ │ ├── test_syncdetect.py │ │ │ ├── test_ufunc_methods.py │ │ │ └── test_userkernel.py │ │ ├── creation_tests │ │ │ ├── __init__.py │ │ │ ├── test_basic.py │ │ │ ├── test_from_data.py │ │ │ ├── test_matrix.py │ │ │ └── test_ranges.py │ │ ├── fft_tests │ │ │ ├── __init__.py │ │ │ ├── test_cache.py │ │ │ ├── test_callback.py │ │ │ └── test_fft.py │ │ ├── indexing_tests │ │ │ ├── __init__.py │ │ │ ├── test_generate.py │ │ │ ├── test_indexing.py │ │ │ ├── test_insert.py │ │ │ └── test_iterate.py │ │ ├── io_tests │ │ │ ├── __init__.py │ │ │ ├── test_base_n.py │ │ │ ├── test_formatting.py │ │ │ ├── test_npz.py │ │ │ └── test_text.py │ │ ├── lib_tests │ │ │ ├── __init__.py │ │ │ ├── test_polynomial.py │ │ │ ├── test_shape_base.py │ │ │ └── test_strided_tricks.py │ │ ├── linalg_tests │ │ │ ├── __init__.py │ │ │ ├── test_decomposition.py │ │ │ ├── test_eigenvalue.py │ │ │ ├── test_einsum.py │ │ │ ├── test_norms.py │ │ │ ├── test_product.py │ │ │ └── test_solve.py │ │ ├── logic_tests │ │ │ ├── __init__.py │ │ │ ├── test_comparison.py │ │ │ ├── test_content.py │ │ │ ├── test_ops.py │ │ │ ├── test_truth.py │ │ │ └── test_type_test.py │ │ ├── manipulation_tests │ │ │ ├── __init__.py │ │ │ ├── test_add_remove.py │ │ │ ├── test_basic.py │ │ │ ├── test_dims.py │ │ │ ├── test_join.py │ │ │ ├── test_kind.py │ │ │ ├── test_rearrange.py │ │ │ ├── test_shape.py │ │ │ ├── test_split.py │ │ │ ├── test_tiling.py │ │ │ └── test_transpose.py │ │ ├── math_tests │ │ │ ├── __init__.py │ │ │ ├── test_arithmetic.py │ │ │ ├── test_explog.py │ │ │ ├── test_floating.py │ │ │ ├── test_hyperbolic.py │ │ │ ├── test_matmul.py │ │ │ ├── test_misc.py │ │ │ ├── test_rational.py │ │ │ ├── test_rounding.py │ │ │ ├── test_special.py │ │ │ ├── test_sumprod.py │ │ │ ├── test_trigonometric.py │ │ │ └── test_window.py │ │ ├── misc_tests │ │ │ ├── __init__.py │ │ │ ├── test_byte_bounds.py │ │ │ ├── test_memory_ranges.py │ │ │ └── test_who.py │ │ ├── padding_tests │ │ │ ├── __init__.py │ │ │ └── test_pad.py │ │ ├── random_tests │ │ │ ├── __init__.py │ │ │ ├── common_distributions.py │ │ │ ├── test_bit_generator.py │ │ │ ├── test_distributions.py │ │ │ ├── test_generator.py │ │ │ ├── test_generator_api.py │ │ │ ├── test_init.py │ │ │ ├── test_permutations.py │ │ │ ├── test_random.py │ │ │ └── test_sample.py │ │ ├── sorting_tests │ │ │ ├── __init__.py │ │ │ ├── test_count.py │ │ │ ├── test_search.py │ │ │ └── test_sort.py │ │ ├── statistics_tests │ │ │ ├── __init__.py │ │ │ ├── test_correlation.py │ │ │ ├── test_histogram.py │ │ │ ├── test_meanvar.py │ │ │ └── test_order.py │ │ ├── test_init.py │ │ ├── test_ndim.py │ │ ├── test_numpy_interop.py │ │ ├── test_type_routines.py │ │ ├── test_typing.py │ │ └── testing │ │ │ ├── __init__.py │ │ │ ├── _array.py │ │ │ ├── _attr.py │ │ │ ├── _bundle.py │ │ │ ├── _condition.py │ │ │ ├── _helper.py │ │ │ ├── _hypothesis.py │ │ │ ├── _loops.py │ │ │ ├── _parameterized.py │ │ │ ├── _pytest_impl.py │ │ │ └── _random.py │ │ ├── intel │ │ ├── test_zero_copy_test1.py │ │ └── zero-copy-test1.py │ │ └── numpy_ext │ │ └── __init__.py └── to_numba │ ├── __init__.py │ └── dpnp_iface_to_numba.py ├── environments ├── base_build_docs.txt ├── build_conda_pkg.yml ├── build_with_oneapi.yml ├── building_docs.yml ├── coverage.txt ├── coverage.yml ├── create_conda_channel.yml ├── dpctl_pkg.txt ├── dpctl_pkg.yml ├── oneapi_pkgs.yml └── upload_cleanup_conda_pkg.yml ├── examples ├── example1.py ├── example10.py ├── example2.py ├── example4.py ├── example6.py ├── example7.py ├── example_bs.py ├── example_cfd.py └── example_sum.py ├── pyproject.toml ├── scripts ├── build_locally.py └── gen_coverage.py ├── setup.cfg ├── setup.py └── tests_external ├── __init__.py ├── numpy ├── __init__.py └── runtests.py ├── skipped_tests_numpy.tbl └── skipped_tests_numpy_aborted.tbl /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | 3 | AccessModifierOffset: -4 4 | 5 | AlignConsecutiveMacros: true 6 | AlignConsecutiveBitFields: true 7 | AlignEscapedNewlines: Right 8 | 9 | AllowAllParametersOfDeclarationOnNextLine: false 10 | AllowShortBlocksOnASingleLine: Empty 11 | 12 | AlwaysBreakTemplateDeclarations: Yes 13 | 14 | BinPackParameters: false 15 | 16 | BraceWrapping: 17 | AfterCaseLabel: true 18 | AfterClass: true 19 | AfterControlStatement: MultiLine 20 | AfterEnum: true 21 | AfterFunction: true 22 | AfterNamespace: true 23 | AfterObjCDeclaration: false 24 | AfterStruct: true 25 | AfterUnion: true 26 | AfterExternBlock: true 27 | BeforeCatch: false 28 | BeforeElse: true 29 | BeforeLambdaBody: false 30 | BeforeWhile: false 31 | IndentBraces: false 32 | SplitEmptyFunction: true 33 | SplitEmptyRecord: true 34 | SplitEmptyNamespace: true 35 | BreakBeforeBraces: Custom 36 | 37 | ColumnLimit: 80 38 | 39 | IndentWidth: 4 40 | IndentWrappedFunctionNames: true 41 | 42 | Standard: c++17 43 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # $ git config blame.ignoreRevsFile .git-blame-ignore-revs 2 | 3 | # Add pre-commit hooks 4 | b0cd5f85c9b0c2705359fee3a3f4f3feda53bfa0 5 | 6 | # Add black to pre-commit config 7 | 88981b5ae1c99f9b64758db44dfb39f2c20b10db 8 | 9 | # Add clang-format to pre-commit config 10 | ae755b57a9aeeb09435594aa7f6a04bf4cdc55fa 11 | 12 | # Add isort to pre-commit config 13 | 3f202cf778cc47698310f2d040e5f83bdf2a90da 14 | 15 | # Add flake8 to pre-commit config 16 | c106d91b866f4acd30226b68519b12a73a881490 17 | 18 | # Add pygrep-hooks to pre-commit config 19 | e62718415aa3660da5f607e352c991a063a54219 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | dpnp/_version.py export-subst 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @antonwolfy @AlexanderKalistratov @vlad-perevezentsev @vtavana @ndgrigorian 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | day: "saturday" 8 | rebase-strategy: "disabled" 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | - [ ] Have you provided a meaningful PR description? 2 | - [ ] Have you added a test, reproducer or referred to an issue with a reproducer? 3 | - [ ] Have you tested your changes locally for CPU and GPU devices? 4 | - [ ] Have you made sure that new changes do not introduce compiler warnings? 5 | - [ ] Have you checked performance impact of proposed changes? 6 | - [ ] Have you added documentation for your changes, if necessary? 7 | - [ ] Have you added your changes to the changelog? 8 | -------------------------------------------------------------------------------- /.github/workflows/Windows-IntelLLVM_3.22.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | 5 | # This module is shared by multiple languages; use include blocker. 6 | if(__WINDOWS_INTEL) 7 | return() 8 | endif() 9 | set(__WINDOWS_INTEL 1) 10 | 11 | include(Platform/Windows-MSVC) 12 | macro(__windows_compiler_intel lang) 13 | __windows_compiler_msvc(${lang}) 14 | 15 | set(CMAKE_${lang}_LINK_EXECUTABLE " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -link -out: -implib: -pdb: -version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") 16 | set(CMAKE_${lang}_CREATE_SHARED_LIBRARY " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -LD -link -out: -implib: -pdb: -version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") 17 | set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) 18 | if (NOT "${lang}" STREQUAL "Fortran") # Fortran driver does not support -fuse-ld, yet 19 | set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o -link ${CMAKE_END_TEMP_FILE}") 20 | endif() 21 | set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT -QMF ") 22 | set(CMAKE_${lang}_DEPFILE_FORMAT gcc) 23 | 24 | endmacro() 25 | -------------------------------------------------------------------------------- /.github/workflows/array-api-skips.txt: -------------------------------------------------------------------------------- 1 | # array API tests to be skipped 2 | 3 | # unexpected result is returned - unmute when dpctl-1986 is resolved 4 | array_api_tests/test_operators_and_elementwise_functions.py::test_asin 5 | array_api_tests/test_operators_and_elementwise_functions.py::test_asinh 6 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: pre-commit 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: [master] 7 | 8 | permissions: read-all 9 | 10 | jobs: 11 | pre-commit: 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - name: Set up clang-format 15 | run: | 16 | sudo apt-get install -y clang-format-12 17 | sudo unlink /usr/bin/clang-format 18 | sudo ln -s /usr/bin/clang-format-12 /usr/bin/clang-format 19 | clang-format --version 20 | 21 | - name: Set up pip packages 22 | uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1 23 | with: 24 | packages: | 25 | codespell 26 | pylint 27 | 28 | - name: Checkout DPNP repo 29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 30 | 31 | - name: Set up python 32 | uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 33 | with: 34 | python-version: '3.13' 35 | 36 | - name: Run pre-commit checks 37 | uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CMake build and local install directory 2 | _skbuild 3 | build_cython 4 | cython_debug 5 | dpnp.egg-info 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | 10 | # Code project files 11 | .vscode 12 | 13 | # Files from test of code coverage 14 | coverage.xml 15 | 16 | # Backup files kept after git merge/rebase 17 | *.orig 18 | 19 | # Build examples 20 | example3 21 | 22 | *dpnp_backend* 23 | dpnp/**/*.cpython*.so 24 | dpnp/**/*.pyd 25 | *~ 26 | core 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2025, Intel Corporation 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | - Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | - Redistributions in binary form must reproduce the above copyright notice, 9 | this list of conditions and the following disclaimer in the documentation 10 | and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 13 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 16 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 18 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 19 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 21 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 | THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Report a Vulnerability 4 | 5 | Please report security issues or vulnerabilities to the [Intel® Security Center]. 6 | 7 | For more information on how Intel® works to resolve security issues, see 8 | [Vulnerability Handling Guidelines]. 9 | 10 | [Intel® Security Center]:https://www.intel.com/content/www/us/en/security-center/default.html 11 | 12 | [Vulnerability Handling Guidelines]:https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html 13 | -------------------------------------------------------------------------------- /THANKS.txt: -------------------------------------------------------------------------------- 1 | Sergey Shalnov : for the Intel NumPy core, the Intel NumPy guide, various bug-fixes and code contributions 2 | Oleksandr Pavlyk : who designed memory handling subsystem 3 | Alexander Makaryev : 4 | -------------------------------------------------------------------------------- /benchmarks/benchmarks/__init__.py: -------------------------------------------------------------------------------- 1 | from . import common 2 | -------------------------------------------------------------------------------- /benchmarks/benchmarks/bench_random.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | import dpnp 4 | 5 | from .common import Benchmark 6 | 7 | 8 | # asv run --python=python --quick --bench Sample 9 | class Sample(Benchmark): 10 | executors = {"dpnp": dpnp, "numpy": numpy} 11 | params = [["dpnp", "numpy"], [2**16, 2**20, 2**24]] 12 | param_names = ["executor", "size"] 13 | 14 | def setup(self, executor, size): 15 | self.executor = self.executors[executor] 16 | 17 | def time_rand(self, executor, size): 18 | np = self.executor 19 | np.random.rand(size) 20 | 21 | def time_randn(self, executor, size): 22 | np = self.executor 23 | np.random.randn(size) 24 | 25 | def time_random_sample(self, executor, size): 26 | np = self.executor 27 | np.random.random_sample((size,)) 28 | -------------------------------------------------------------------------------- /benchmarks/pytest_benchmark/README.md: -------------------------------------------------------------------------------- 1 | # dpnp/benchmarks/pytest_benchmark/ 2 | 3 | ## Prerequisites 4 | * pytest >= 6.1.1 5 | * pytest-benchmark >= 3.4.1 6 | 7 | 8 | ## Running benchmark tests 9 | ```bash 10 | pytest benchmarks/ --benchmark-json=results.json 11 | ``` 12 | Running tests and saving the current run into `STORAGE`, see [1] 13 | ```bash 14 | pytest benchmarks/ --benchmark-json=results.json --benchmark-autosave 15 | ``` 16 | 17 | ## Creating `.csv` report 18 | ```bash 19 | pytest-benchmark compare results.json --csv=results.csv --group-by='name' 20 | ``` 21 | 22 | ## Optional: creating histogram 23 | Note: make sure that `pytest-benchmark[histogram]` installed 24 | ```bash 25 | # example 26 | pip install pytest-benchmark[histogram] 27 | pytest -vv benchmarks/ --benchmark-autosave --benchmark-histogram 28 | pytest-benchmark compare .benchmarks/Linux-CPython-3.7-64bit/* --histogram 29 | ``` 30 | 31 | ## Advanced running example 32 | ``` 33 | pytest benchmarks/ --benchmark-columns='min, max, mean, stddev, median, rounds, iterations' --benchmark-json=results.json --benchmark-autosave 34 | pytest-benchmark compare results.json --csv=results.csv --group-by='name' 35 | ``` 36 | 37 | 38 | [1] https://pytest-benchmark.readthedocs.io/en/latest/usage.html 39 | -------------------------------------------------------------------------------- /conda-recipe/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix 4 | export LIBRARY_PATH="$LIBRARY_PATH:${BUILD_PREFIX}/lib" 5 | 6 | # Intel LLVM must cooperate with compiler and sysroot from conda 7 | echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg 8 | 9 | ICPXCFG="$(pwd)/icpx_for_conda.cfg" 10 | export ICPXCFG 11 | 12 | ICXCFG="$(pwd)/icpx_for_conda.cfg" 13 | export ICXCFG 14 | 15 | read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \ 16 | | tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')" 17 | 18 | if [ -e "_skbuild" ]; then 19 | ${PYTHON} setup.py clean --all 20 | fi 21 | 22 | export CC=icx 23 | export CXX=icpx 24 | 25 | export CMAKE_GENERATOR=Ninja 26 | # Make CMake verbose 27 | export VERBOSE=1 28 | 29 | CMAKE_ARGS="${CMAKE_ARGS} -DDPNP_WITH_REDIST:BOOL=ON" 30 | 31 | # -wnx flags mean: --wheel --no-isolation --skip-dependency-check 32 | ${PYTHON} -m build -w -n -x 33 | 34 | ${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \ 35 | --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \ 36 | dist/dpnp*.whl 37 | 38 | ${PYTHON} -m pip install dist/dpnp*.whl \ 39 | --no-build-isolation \ 40 | --no-deps \ 41 | --only-binary :all: \ 42 | --no-index \ 43 | --prefix "${PREFIX}" \ 44 | -vv 45 | 46 | # Copy wheel package 47 | if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then 48 | cp dist/dpnp*.whl "${WHEELS_OUTPUT_FOLDER[@]}" 49 | fi 50 | -------------------------------------------------------------------------------- /conda-recipe/conda_build_config.yaml: -------------------------------------------------------------------------------- 1 | numpy: 2 | - '1.25' 3 | c_compiler: # [linux] 4 | - gcc # [linux] 5 | cxx_compiler: # [linux] 6 | - gxx # [linux] 7 | cxx_compiler_version: # [linux] 8 | - '14' # [linux] 9 | c_stdlib: # [linux] 10 | - sysroot # [linux] 11 | c_stdlib_version: # [linux] 12 | - '2.28' # [linux] 13 | c_stdlib: # [win] 14 | - vs # [win] 15 | cxx_compiler: # [win] 16 | - vs2022 # [win] 17 | c_compiler: # [win] 18 | - vs2022 # [win] 19 | -------------------------------------------------------------------------------- /conda-recipe/run_test.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | 3 | REM if ONEAPI_ROOT is specified (use all from it) 4 | if defined ONEAPI_ROOT ( 5 | set "DPCPPROOT=%ONEAPI_ROOT%\compiler\latest" 6 | set "MKLROOT=%ONEAPI_ROOT%\mkl\latest" 7 | set "TBBROOT=%ONEAPI_ROOT%\tbb\latest" 8 | set "DPLROOT=%ONEAPI_ROOT%\dpl\latest" 9 | ) 10 | 11 | REM if DPCPPROOT is specified (work with custom DPCPP) 12 | if defined DPCPPROOT ( 13 | call "%DPCPPROOT%\env\vars.bat" 14 | ) 15 | 16 | REM if MKLROOT is specified (work with custom math library) 17 | if defined MKLROOT ( 18 | call "%MKLROOT%\env\vars.bat" 19 | ) 20 | 21 | REM have to activate while SYCL CPU device/driver needs paths 22 | REM if TBBROOT is specified 23 | if defined TBBROOT ( 24 | call "%TBBROOT%\env\vars.bat" 25 | ) 26 | 27 | REM If PYTHON is not set 28 | REM assign it to the Python interpreter from the testing environment 29 | if not defined PYTHON ( 30 | for %%I in (python.exe) do set PYTHON=%%~$PATH:I 31 | ) 32 | 33 | 34 | "%PYTHON%" -c "import dpnp; print(dpnp.__version__)" 35 | if %errorlevel% neq 0 exit 1 36 | 37 | "%PYTHON%" -m dpctl -f 38 | if %errorlevel% neq 0 exit 1 39 | 40 | "%PYTHON%" -m pytest -ra --pyargs dpnp 41 | if %errorlevel% neq 0 exit 1 42 | -------------------------------------------------------------------------------- /conda-recipe/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # if ONEAPI_ROOT is specified (use all from it) 4 | if [ -n "${ONEAPI_ROOT}" ]; then 5 | export DPCPPROOT=${ONEAPI_ROOT}/compiler/latest 6 | export MKLROOT=${ONEAPI_ROOT}/mkl/latest 7 | export TBBROOT=${ONEAPI_ROOT}/tbb/latest 8 | export DPLROOT=${ONEAPI_ROOT}/dpl/latest 9 | fi 10 | 11 | # if DPCPPROOT is specified (work with custom DPCPP) 12 | if [ -n "${DPCPPROOT}" ]; then 13 | # shellcheck source=/dev/null 14 | . "${DPCPPROOT}"/env/vars.sh 15 | fi 16 | 17 | # if MKLROOT is specified (work with custom math library) 18 | if [ -n "${MKLROOT}" ]; then 19 | # shellcheck source=/dev/null 20 | . "${MKLROOT}"/env/vars.sh 21 | fi 22 | 23 | # have to activate while SYCL CPU device/driver needs paths 24 | # if TBBROOT is specified 25 | if [ -n "${TBBROOT}" ]; then 26 | # shellcheck source=/dev/null 27 | . "${TBBROOT}"/env/vars.sh 28 | fi 29 | 30 | # If PYTHON is not set 31 | # assign it to the Python interpreter from the testing environment 32 | if [ -z "${PYTHON}" ]; then 33 | PYTHON=$PREFIX/bin/python 34 | fi 35 | 36 | set -e 37 | 38 | $PYTHON -c "import dpnp; print(dpnp.__version__)" 39 | $PYTHON -m dpctl -f 40 | $PYTHON -m pytest -ra --pyargs dpnp 41 | -------------------------------------------------------------------------------- /doc/0.builddoc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BUILDDOCDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")") 4 | ROOTDIR=$BUILDDOCDIR/.. 5 | 6 | cd "$ROOTDIR" || exit 1 7 | python setup.py develop 8 | 9 | cd "$BUILDDOCDIR" || exit 2 10 | make clean 11 | make html 12 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = dpnp 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/attribute.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | attribute 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/base.rst: -------------------------------------------------------------------------------- 1 | {% if objtype == 'property' %} 2 | :orphan: 3 | {% endif %} 4 | 5 | {{ fullname | escape | underline}} 6 | 7 | .. currentmodule:: {{ module }} 8 | 9 | {% if objtype == 'property' %} 10 | property 11 | {% endif %} 12 | 13 | .. auto{{ objtype }}:: {{ objname }} 14 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {% extends "!autosummary/class.rst" %} 2 | 3 | {% block methods %} 4 | {% if methods %} 5 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 6 | .. autosummary:: 7 | :toctree: 8 | {% for item in all_methods %} 9 | {%- if not item.startswith('_') or item in ['__call__'] %} 10 | {{ name }}.{{ item }} 11 | {%- endif -%} 12 | {%- endfor %} 13 | {% endif %} 14 | {% endblock %} 15 | 16 | {% block attributes %} 17 | {% if attributes %} 18 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 19 | .. autosummary:: 20 | :toctree: 21 | {% for item in all_attributes %} 22 | {%- if not item.startswith('_') %} 23 | {{ name }}.{{ item }} 24 | {%- endif -%} 25 | {%- endfor %} 26 | {% endif %} 27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/member.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | member 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/method.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | method 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/minimal_module.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. automodule:: {{ fullname }} 4 | 5 | {% block docstring %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /doc/_templates/autosummary/module.rst: -------------------------------------------------------------------------------- 1 | {% extends "!autosummary/module.rst" %} 2 | 3 | {# This file is almost the same as the default, but adds :toctree: to the 4 | autosummary directives. The original can be found at 5 | ``sphinx/ext/autosummary/templates/autosummary/module.rst``. #} 6 | 7 | {% block attributes %} 8 | {% if attributes %} 9 | .. rubric:: Module Attributes 10 | 11 | .. autosummary:: 12 | :toctree: 13 | {% for item in attributes %} 14 | {{ item }} 15 | {%- endfor %} 16 | {% endif %} 17 | {% endblock %} 18 | 19 | {% block functions %} 20 | {% if functions %} 21 | .. rubric:: Functions 22 | 23 | .. autosummary:: 24 | :toctree: 25 | {% for item in functions %} 26 | {{ item }} 27 | {%- endfor %} 28 | {% endif %} 29 | {% endblock %} 30 | 31 | {% block classes %} 32 | {% if classes %} 33 | .. rubric:: Classes 34 | 35 | .. autosummary:: 36 | :toctree: 37 | {% for item in classes %} 38 | {{ item }} 39 | {%- endfor %} 40 | {% endif %} 41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /doc/dpctl.rst: -------------------------------------------------------------------------------- 1 | .. _dptcl: 2 | .. include:: ./ext_links.txt 3 | 4 | Interplay with the Data Parallel Control Library 5 | ================================================ 6 | 7 | `Data Parallel Control Library`_ provides API to manage specific 8 | `SYCL*`_ resources for SYCL-based Python packages. 9 | 10 | An example below demonstrates how the Data Parallel Extension for NumPy* can be 11 | easily combined with the device management interface provided by dpctl package. 12 | 13 | .. code-block:: python 14 | :linenos: 15 | 16 | import dpctl 17 | import dpnp 18 | 19 | d = dpctl.select_cpu_device() 20 | x = dpnp.array([1, 2, 3], device=d) 21 | s = dpnp.sum(x) 22 | 23 | y = dpnp.linspace(0, dpnp.pi, num=10**6, device="gpu") 24 | f = 1 + y * dpnp.sin(y) 25 | 26 | # locate argument where function attains global maximum 27 | max_arg = x[dpnp.argmax(f)] 28 | max_val = dpnp.max(f) 29 | 30 | 31 | For more information please refer to `Data Parallel Control Library`_ 32 | documentation. 33 | 34 | Example 35 | ------- 36 | .. literalinclude:: ../examples/example10.py 37 | :linenos: 38 | :language: python 39 | :lines: 35- 40 | -------------------------------------------------------------------------------- /doc/dpnp_backend_api.rst: -------------------------------------------------------------------------------- 1 | .. _dpnp_backend_reference: 2 | 3 | ************************* 4 | C++ backend API Reference 5 | ************************* 6 | 7 | `C++ backend of Data Parallel Extension for NumPy* `_ 8 | -------------------------------------------------------------------------------- /doc/ext_links.txt: -------------------------------------------------------------------------------- 1 | .. 2 | ********************************************************** 3 | THESE ARE EXTERNAL PROJECT LINKS USED IN THE DOCUMENTATION 4 | ********************************************************** 5 | 6 | .. _NumPy*: https://numpy.org/ 7 | .. _Python* Array API Standard: https://data-apis.org/array-api/ 8 | .. _OpenCl*: https://www.khronos.org/opencl/ 9 | .. _oneAPI Level Zero: https://spec.oneapi.io/level-zero/latest/index.html 10 | .. _DPC++: https://www.apress.com/gp/book/9781484255735 11 | .. _SYCL*: https://www.khronos.org/sycl/ 12 | .. _dpctl: https://intelpython.github.io/dpctl/latest/index.html 13 | .. _Data Parallel Control Library: https://intelpython.github.io/dpctl/latest/index.html 14 | .. _Intel oneAPI Base Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html 15 | .. _Intel Distribution for Python*: https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html 16 | .. _Intel AI Analytics Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-analytics-toolkit.html 17 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | .. _index: 2 | .. include:: ./ext_links.txt 3 | 4 | Data Parallel Extension for NumPy* 5 | ================================== 6 | 7 | .. module:: dpnp 8 | :no-index: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | overview 14 | quick_start_guide 15 | reference/index 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | :caption: Development information 20 | 21 | dpnp_backend_api 22 | -------------------------------------------------------------------------------- /doc/known_words.txt: -------------------------------------------------------------------------------- 1 | al 2 | ary 3 | backend 4 | bandlimited 5 | bincount 6 | bitwise 7 | Blackman 8 | boolean 9 | broadcastable 10 | broadcasted 11 | byteorder 12 | cardinalis 13 | Cholesky 14 | combinatorially 15 | conda 16 | cubically 17 | Decompositions 18 | diag 19 | dimensionality 20 | discretized 21 | docstring 22 | dpctl 23 | dpnp 24 | dtype 25 | dtypes 26 | einsum 27 | endian 28 | eps 29 | epsneg 30 | et 31 | Extrema 32 | finfo 33 | finiteness 34 | Flannery 35 | Fortran 36 | Frobenius 37 | fs 38 | getter 39 | Golub 40 | Hadamard 41 | Hanning 42 | histogrammed 43 | Hypergeometric 44 | kwargs 45 | iaxis 46 | iinfo 47 | Infs 48 | intp 49 | ints 50 | iterable 51 | Lanczos 52 | Lomax 53 | Mersenne 54 | meshgrid 55 | minlength 56 | Mises 57 | multinomial 58 | multivalued 59 | namespace 60 | namespaces 61 | namedtuple 62 | NaN 63 | NaT 64 | nd 65 | ndarray 66 | ndarrays 67 | ndim 68 | Nj 69 | Nk 70 | normed 71 | nuc 72 | numpy 73 | nx 74 | ny 75 | Nyquist 76 | oneAPI 77 | ord 78 | orthonormal 79 | radix 80 | Penrose 81 | Polyutils 82 | pre 83 | prepend 84 | prepended 85 | prepending 86 | representable 87 | resampling 88 | runtimes 89 | scikit 90 | se 91 | signbit 92 | signum 93 | sinc 94 | subarray 95 | subarrays 96 | subclasses 97 | subtype 98 | SyclDevice 99 | SyclQueue 100 | tensordot 101 | Teukolsky 102 | th 103 | tril 104 | triu 105 | Tukey 106 | ufunc 107 | ufuncs 108 | Unary 109 | unscaled 110 | unstacked 111 | unicode 112 | Upcasting 113 | usm 114 | Vandermonde 115 | vectorized 116 | Vetterline 117 | von 118 | Weibull 119 | whitespace 120 | Zipf 121 | -------------------------------------------------------------------------------- /doc/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | set SPHINXPROJ=dpnp 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /doc/overview.rst: -------------------------------------------------------------------------------- 1 | .. _overview: 2 | .. include:: ./ext_links.txt 3 | 4 | Overview 5 | ======== 6 | 7 | .. module:: dpnp 8 | 9 | The Data Parallel Extension for NumPy* (dpnp package) - a library that 10 | implements a subset of `NumPy*`_ that can be executed on any 11 | data parallel device. The subset is a drop-in replacement of core `NumPy*`_ 12 | functions and numerical data types. 13 | 14 | The Data Parallel Extension for NumPy* is being developed as part of 15 | `Intel AI Analytics Toolkit`_ and is distributed with the 16 | `Intel Distribution for Python*`_. The dpnp package is also available 17 | on Anaconda cloud. Please refer the :doc:`quick_start_guide` page to learn more. 18 | 19 | Being drop-in replacement for `NumPy*`_ means that the usage is very similar: 20 | 21 | >>> import dpnp as np 22 | 23 | The :class:`dpnp.ndarray` class is a compatible alternative of 24 | :class:`numpy.ndarray`. 25 | 26 | >>> x = np.array([1, 2, 3]) 27 | 28 | ``x`` in the above example is an instance of :class:`dpnp.ndarray` that 29 | is created identically to ``NumPy*``'s one. The key difference of 30 | :class:`dpnp.ndarray` from :class:`numpy.ndarray` is that the memory 31 | is allocated on the default `SYCL*`_ device, which is a ``"gpu"`` on systems 32 | with integrated or discrete GPU (otherwise it is the ``"host"`` device 33 | on systems that do not have GPU). 34 | 35 | Most of the array manipulations are also done in the way similar to `NumPy*`_ such as: 36 | 37 | >>> s = np.sum(x) 38 | 39 | Please see the :ref:`API Reference ` for the complete list of supported `NumPy*`_ APIs 40 | along with their limitations. 41 | -------------------------------------------------------------------------------- /doc/reference/array-creation.rst: -------------------------------------------------------------------------------- 1 | .. _routines.array-creation: 2 | 3 | Array creation routines 4 | ======================= 5 | 6 | .. https://numpy.org/doc/stable/reference/routines.array-creation.html 7 | 8 | From shape or value 9 | ----------------------- 10 | 11 | .. autosummary:: 12 | :toctree: generated/ 13 | :nosignatures: 14 | 15 | dpnp.empty 16 | dpnp.empty_like 17 | dpnp.eye 18 | dpnp.identity 19 | dpnp.ones 20 | dpnp.ones_like 21 | dpnp.zeros 22 | dpnp.zeros_like 23 | dpnp.full 24 | dpnp.full_like 25 | 26 | 27 | From existing data 28 | ------------------------ 29 | 30 | .. autosummary:: 31 | :toctree: generated/ 32 | :nosignatures: 33 | 34 | dpnp.array 35 | dpnp.asarray 36 | dpnp.asanyarray 37 | dpnp.ascontiguousarray 38 | dpnp.astype 39 | dpnp.copy 40 | dpnp.frombuffer 41 | dpnp.from_dlpack 42 | dpnp.fromfile 43 | dpnp.fromfunction 44 | dpnp.fromiter 45 | dpnp.fromstring 46 | dpnp.loadtxt 47 | 48 | 49 | Numerical ranges 50 | ---------------- 51 | 52 | .. autosummary:: 53 | :toctree: generated/ 54 | :nosignatures: 55 | 56 | dpnp.arange 57 | dpnp.linspace 58 | dpnp.logspace 59 | dpnp.geomspace 60 | dpnp.meshgrid 61 | dpnp.mgrid 62 | dpnp.ogrid 63 | 64 | 65 | Building matrices 66 | ----------------- 67 | 68 | .. autosummary:: 69 | :toctree: generated/ 70 | :nosignatures: 71 | 72 | dpnp.diag 73 | dpnp.diagflat 74 | dpnp.tri 75 | dpnp.tril 76 | dpnp.triu 77 | dpnp.vander 78 | 79 | 80 | The Matrix class 81 | ---------------- 82 | .. autosummary:: 83 | :toctree: generated/ 84 | :nosignatures: 85 | 86 | dpnp.bmat 87 | -------------------------------------------------------------------------------- /doc/reference/array_api.rst: -------------------------------------------------------------------------------- 1 | .. _array-api-standard-compatibility: 2 | 3 | .. https://numpy.org/doc/stable/reference/array_api.html 4 | 5 | ******************************** 6 | Array API standard compatibility 7 | ******************************** 8 | 9 | DPNP's main namespace as well as the :mod:`dpnp.fft` and :mod:`dpnp.linalg` 10 | namespaces are compatible with the 11 | `2024.12 version `__ 12 | of the Python array API standard. 13 | 14 | Inspection 15 | ========== 16 | 17 | DPNP implements the `array API inspection utilities 18 | `__. 19 | These functions can be accessed via the ``__array_namespace_info__()`` 20 | function, which returns a namespace containing the inspection utilities. 21 | 22 | .. autosummary:: 23 | :toctree: generated/ 24 | :nosignatures: 25 | 26 | dpnp.__array_namespace_info__ 27 | -------------------------------------------------------------------------------- /doc/reference/bitwise.rst: -------------------------------------------------------------------------------- 1 | Bit-wise operations 2 | =================== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.bitwise.html 5 | 6 | Element-wise bit operations 7 | --------------------------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.bitwise_and 14 | dpnp.bitwise_not 15 | dpnp.bitwise_or 16 | dpnp.bitwise_xor 17 | dpnp.invert 18 | dpnp.bitwise_invert 19 | dpnp.left_shift 20 | dpnp.bitwise_left_shift 21 | dpnp.right_shift 22 | dpnp.bitwise_right_shift 23 | dpnp.bitwise_count 24 | 25 | Bit packing 26 | ----------- 27 | 28 | .. autosummary:: 29 | :toctree: generated/ 30 | :nosignatures: 31 | 32 | dpnp.packbits 33 | dpnp.unpackbits 34 | 35 | Output formatting 36 | ----------------- 37 | 38 | .. autosummary:: 39 | :toctree: generated/ 40 | :nosignatures: 41 | 42 | dpnp.binary_repr 43 | -------------------------------------------------------------------------------- /doc/reference/comparison.rst: -------------------------------------------------------------------------------- 1 | Comparison Table NumPy/ DPNP/ CuPy 2 | ================================== 3 | 4 | Here is a list of NumPy and CuPy APIs and its corresponding DPNP implementations. 5 | 6 | ``-`` in DPNP column means that DPNP implementation is not provided yet. 7 | 8 | .. include:: comparison_table.rst.inc 9 | -------------------------------------------------------------------------------- /doc/reference/dtype.rst: -------------------------------------------------------------------------------- 1 | .. _dtype: 2 | 3 | Data type routines 4 | ================== 5 | 6 | .. https://numpy.org/doc/stable/reference/routines.dtype.html 7 | 8 | .. autosummary:: 9 | :toctree: generated/ 10 | :nosignatures: 11 | 12 | dpnp.can_cast 13 | dpnp.promote_types 14 | dpnp.min_scalar_type 15 | dpnp.result_type 16 | dpnp.common_type 17 | 18 | Creating data types 19 | ------------------- 20 | .. autosummary:: 21 | :toctree: generated/ 22 | :nosignatures: 23 | 24 | dpnp.dtype 25 | dpnp.format_parser 26 | 27 | Data type information 28 | --------------------- 29 | .. autosummary:: 30 | :toctree: generated/ 31 | :nosignatures: 32 | 33 | dpnp.finfo 34 | dpnp.iinfo 35 | 36 | Data type testing 37 | ----------------- 38 | .. autosummary:: 39 | :toctree: generated/ 40 | :nosignatures: 41 | 42 | dpnp.isdtype 43 | dpnp.issubdtype 44 | 45 | Miscellaneous 46 | ------------- 47 | .. autosummary:: 48 | :toctree: generated/ 49 | :nosignatures: 50 | 51 | dpnp.typename 52 | dpnp.mintypecode 53 | -------------------------------------------------------------------------------- /doc/reference/dtypes_table.rst: -------------------------------------------------------------------------------- 1 | .. _Data types: 2 | 3 | Available array data types 4 | ========================== 5 | 6 | Table below shows a list of all supported data types (dtypes) and constants of the Data Parallel Extension for NumPy*. 7 | 8 | .. list-table:: 9 | :header-rows: 1 10 | 11 | * - Data Types 12 | - Type aliases 13 | - Constants 14 | * - 15 | - :obj:`bool ` 16 | - :obj:`int8 ` 17 | - :obj:`int16 ` 18 | - :obj:`int32 ` 19 | - :obj:`int64 ` 20 | - :obj:`uint8 ` 21 | - :obj:`uint16 ` 22 | - :obj:`uint32 ` 23 | - :obj:`uint64 ` 24 | - :obj:`float32 ` 25 | - :obj:`float64 ` 26 | - :obj:`complex64 ` 27 | - :obj:`complex128 ` 28 | - 29 | - :obj:`bool_ ` 30 | - :obj:`byte ` 31 | - :obj:`cdouble ` 32 | - :obj:`csingle ` 33 | - :obj:`double ` 34 | - :obj:`float16 ` 35 | - :obj:`int_ ` 36 | - :obj:`intc ` 37 | - :obj:`intp ` 38 | - :obj:`longlong ` 39 | - :obj:`single ` 40 | - :obj:`ubyte ` 41 | - :obj:`uintc ` 42 | - :obj:`uintp ` 43 | - :obj:`ushort ` 44 | - :obj:`ulonglong ` 45 | - 46 | - :obj:`e ` 47 | - :obj:`euler_gamma ` 48 | - :obj:`inf ` 49 | - :obj:`nan ` 50 | - :obj:`pi ` 51 | -------------------------------------------------------------------------------- /doc/reference/fft.rst: -------------------------------------------------------------------------------- 1 | .. _routines.fft: 2 | 3 | .. py:module:: dpnp.fft 4 | 5 | Discrete Fourier Transform 6 | ========================== 7 | 8 | .. https://numpy.org/doc/stable/reference/routines.fft.html 9 | 10 | Standard FFTs 11 | ------------- 12 | 13 | .. autosummary:: 14 | :toctree: generated/ 15 | :nosignatures: 16 | 17 | dpnp.fft.fft 18 | dpnp.fft.ifft 19 | dpnp.fft.fft2 20 | dpnp.fft.ifft2 21 | dpnp.fft.fftn 22 | dpnp.fft.ifftn 23 | 24 | 25 | Real FFTs 26 | --------- 27 | 28 | .. autosummary:: 29 | :toctree: generated/ 30 | :nosignatures: 31 | 32 | dpnp.fft.rfft 33 | dpnp.fft.irfft 34 | dpnp.fft.rfft2 35 | dpnp.fft.irfft2 36 | dpnp.fft.rfftn 37 | dpnp.fft.irfftn 38 | 39 | 40 | Hermitian FFTs 41 | -------------- 42 | 43 | .. autosummary:: 44 | :toctree: generated/ 45 | :nosignatures: 46 | 47 | dpnp.fft.hfft 48 | dpnp.fft.ihfft 49 | 50 | 51 | Helper routines 52 | --------------- 53 | 54 | .. autosummary:: 55 | :toctree: generated/ 56 | :nosignatures: 57 | 58 | dpnp.fft.fftfreq 59 | dpnp.fft.rfftfreq 60 | dpnp.fft.fftshift 61 | dpnp.fft.ifftshift 62 | 63 | .. fft.config module is not implemented yet 64 | .. dpnp.fft.config.set_cufft_callbacks 65 | .. dpnp.fft.config.set_cufft_gpus 66 | .. dpnp.fft.config.get_plan_cache 67 | .. dpnp.fft.config.show_plan_cache_info 68 | 69 | .. automodule:: dpnp.fft 70 | :no-index: 71 | -------------------------------------------------------------------------------- /doc/reference/functional.rst: -------------------------------------------------------------------------------- 1 | Functional programming 2 | ====================== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.functional.html 5 | 6 | .. autosummary:: 7 | :toctree: generated/ 8 | :nosignatures: 9 | 10 | dpnp.apply_along_axis 11 | dpnp.apply_over_axes 12 | dpnp.vectorize 13 | dpnp.frompyfunc 14 | dpnp.piecewise 15 | -------------------------------------------------------------------------------- /doc/reference/index.rst: -------------------------------------------------------------------------------- 1 | .. _dpnp_reference: 2 | 3 | ************* 4 | API Reference 5 | ************* 6 | 7 | API reference of the Data Parallel Extension for NumPy* 8 | 9 | ---- 10 | 11 | .. currentmodule:: dpnp 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | ndarray 17 | ufunc 18 | routines 19 | special 20 | scipy 21 | sparse 22 | ndimage 23 | generic 24 | memory 25 | cuda 26 | memoize 27 | kernel 28 | optimize 29 | interoperability 30 | testing 31 | prof 32 | environment 33 | dtypes_table 34 | comparison 35 | misc 36 | array_api 37 | -------------------------------------------------------------------------------- /doc/reference/indexing.rst: -------------------------------------------------------------------------------- 1 | .. _routines.indexing: 2 | .. _arrays.indexing: 3 | 4 | Indexing routines 5 | ================= 6 | 7 | .. https://numpy.org/doc/stable/reference/routines.indexing.html 8 | 9 | Generating index arrays 10 | ----------------------- 11 | .. autosummary:: 12 | :toctree: generated/ 13 | :nosignatures: 14 | 15 | dpnp.c_ 16 | dpnp.r_ 17 | dpnp.s_ 18 | dpnp.nonzero 19 | dpnp.where 20 | dpnp.indices 21 | dpnp.ix_ 22 | dpnp.ogrid 23 | dpnp.ravel_multi_index 24 | dpnp.unravel_index 25 | dpnp.diag_indices 26 | dpnp.diag_indices_from 27 | dpnp.mask_indices 28 | dpnp.tril_indices 29 | dpnp.tril_indices_from 30 | dpnp.triu_indices 31 | dpnp.triu_indices_from 32 | 33 | 34 | Indexing-like operations 35 | ------------------------ 36 | .. autosummary:: 37 | :toctree: generated/ 38 | :nosignatures: 39 | 40 | dpnp.take 41 | dpnp.take_along_axis 42 | dpnp.choose 43 | dpnp.compress 44 | dpnp.diag 45 | dpnp.diagonal 46 | dpnp.select 47 | 48 | 49 | Inserting data into arrays 50 | -------------------------- 51 | .. autosummary:: 52 | :toctree: generated/ 53 | :nosignatures: 54 | 55 | dpnp.place 56 | dpnp.put 57 | dpnp.put_along_axis 58 | dpnp.putmask 59 | dpnp.fill_diagonal 60 | 61 | 62 | Iterating over arrays 63 | --------------------- 64 | .. autosummary:: 65 | :toctree: generated/ 66 | :nosignatures: 67 | 68 | dpnp.nditer 69 | dpnp.ndenumerate 70 | dpnp.ndindex 71 | dpnp.nested_iters 72 | dpnp.flatiter 73 | dpnp.iterable 74 | -------------------------------------------------------------------------------- /doc/reference/logic.rst: -------------------------------------------------------------------------------- 1 | Logic functions 2 | =============== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.logic.html 5 | 6 | Truth value testing 7 | ------------------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.all 14 | dpnp.any 15 | 16 | 17 | Array contents 18 | -------------- 19 | 20 | .. autosummary:: 21 | :toctree: generated/ 22 | :nosignatures: 23 | 24 | dpnp.isfinite 25 | dpnp.isinf 26 | dpnp.isnan 27 | dpnp.isneginf 28 | dpnp.isposinf 29 | 30 | 31 | Array type testing 32 | ------------------ 33 | 34 | .. autosummary:: 35 | :toctree: generated/ 36 | :nosignatures: 37 | 38 | dpnp.iscomplex 39 | dpnp.iscomplexobj 40 | dpnp.isfortran 41 | dpnp.isreal 42 | dpnp.isrealobj 43 | dpnp.isscalar 44 | 45 | 46 | Logical operations 47 | ------------------ 48 | 49 | .. autosummary:: 50 | :toctree: generated/ 51 | :nosignatures: 52 | 53 | dpnp.logical_and 54 | dpnp.logical_or 55 | dpnp.logical_not 56 | dpnp.logical_xor 57 | 58 | 59 | Comparison 60 | ---------- 61 | 62 | .. autosummary:: 63 | :toctree: generated/ 64 | :nosignatures: 65 | 66 | dpnp.allclose 67 | dpnp.isclose 68 | dpnp.array_equal 69 | dpnp.array_equiv 70 | dpnp.greater 71 | dpnp.greater_equal 72 | dpnp.less 73 | dpnp.less_equal 74 | dpnp.equal 75 | dpnp.not_equal 76 | -------------------------------------------------------------------------------- /doc/reference/other.rst: -------------------------------------------------------------------------------- 1 | Miscellaneous routines 2 | ====================== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.other.html 5 | 6 | Utility 7 | ------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.byte_bounds 14 | dpnp.get_include 15 | dpnp.show_config 16 | dpnp.show_runtime 17 | dpnp.broadcast_shapes 18 | -------------------------------------------------------------------------------- /doc/reference/polynomials.rst: -------------------------------------------------------------------------------- 1 | Polynomials 2 | =========== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.polynomials.html 5 | 6 | Polynomial Package 7 | ------------------ 8 | 9 | Polynomial Module 10 | ~~~~~~~~~~~~~~~~~ 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | :nosignatures: 15 | 16 | .. polynomial module is not implemented yet 17 | .. dpnp.polynomial.polynomial.polyvander 18 | .. dpnp.polynomial.polynomial.polycompanion 19 | 20 | 21 | Polyutils 22 | ~~~~~~~~~ 23 | 24 | .. autosummary:: 25 | :toctree: generated/ 26 | :nosignatures: 27 | 28 | .. polyutils module is not implemented yet 29 | .. dpnp.polynomial.polyutils.as_series 30 | .. dpnp.polynomial.polyutils.trimseq 31 | .. dpnp.polynomial.polyutils.trimcoef 32 | 33 | 34 | Poly1d 35 | ------ 36 | 37 | Basics 38 | ~~~~~~ 39 | 40 | .. autosummary:: 41 | :toctree: generated/ 42 | :nosignatures: 43 | 44 | dpnp.poly1d 45 | dpnp.polyval 46 | dpnp.roots 47 | 48 | 49 | Arithmetic 50 | ~~~~~~~~~~ 51 | 52 | .. autosummary:: 53 | :toctree: generated/ 54 | :nosignatures: 55 | 56 | dpnp.polyadd 57 | dpnp.polysub 58 | dpnp.polymul 59 | -------------------------------------------------------------------------------- /doc/reference/routines.rst: -------------------------------------------------------------------------------- 1 | -------- 2 | Routines 3 | -------- 4 | 5 | The following pages describe NumPy-compatible routines. 6 | These functions cover a subset of 7 | `NumPy routines `_. 8 | 9 | .. currentmodule:: dpnp 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | array-creation 15 | array-manipulation 16 | bitwise 17 | dtype 18 | fft 19 | functional 20 | indexing 21 | linalg 22 | logic 23 | math 24 | other 25 | .. polynomials 26 | random 27 | set 28 | sort 29 | statistics 30 | window 31 | -------------------------------------------------------------------------------- /doc/reference/set.rst: -------------------------------------------------------------------------------- 1 | Set routines 2 | ============ 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.set.html 5 | 6 | Making proper sets 7 | ------------------ 8 | .. autosummary:: 9 | :toctree: generated/ 10 | :nosignatures: 11 | 12 | dpnp.unique 13 | dpnp.unique_all 14 | dpnp.unique_counts 15 | dpnp.unique_inverse 16 | dpnp.unique_values 17 | 18 | Boolean operations 19 | ------------------ 20 | .. autosummary:: 21 | :toctree: generated/ 22 | :nosignatures: 23 | 24 | dpnp.in1d 25 | dpnp.intersect1d 26 | dpnp.isin 27 | dpnp.setdiff1d 28 | dpnp.setxor1d 29 | dpnp.union1d 30 | -------------------------------------------------------------------------------- /doc/reference/sort.rst: -------------------------------------------------------------------------------- 1 | Sorting, searching, and counting 2 | ================================ 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.sort.html 5 | 6 | Sorting 7 | ------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.sort 14 | dpnp.lexsort 15 | dpnp.argsort 16 | dpnp.sort_complex 17 | dpnp.partition 18 | dpnp.argpartition 19 | 20 | .. seealso:: 21 | :func:`dpnp.ndarray.sort` 22 | 23 | Searching 24 | --------- 25 | 26 | .. autosummary:: 27 | :toctree: generated/ 28 | :nosignatures: 29 | 30 | dpnp.argmax 31 | dpnp.nanargmax 32 | dpnp.argmin 33 | dpnp.nanargmin 34 | dpnp.argwhere 35 | dpnp.nonzero 36 | dpnp.flatnonzero 37 | dpnp.where 38 | dpnp.searchsorted 39 | dpnp.extract 40 | 41 | Counting 42 | -------- 43 | 44 | .. autosummary:: 45 | :toctree: generated/ 46 | :nosignatures: 47 | 48 | dpnp.count_nonzero 49 | -------------------------------------------------------------------------------- /doc/reference/special.rst: -------------------------------------------------------------------------------- 1 | Special Functions 2 | ================= 3 | 4 | .. https://docs.scipy.org/doc/scipy/reference/special.html 5 | 6 | Error Function 7 | -------------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.erf 14 | dpnp.erfc 15 | dpnp.erfcx 16 | dpnp.erfinv 17 | dpnp.erfcinv 18 | -------------------------------------------------------------------------------- /doc/reference/statistics.rst: -------------------------------------------------------------------------------- 1 | Statistics 2 | ========== 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.statistics.html 5 | 6 | Order statistics 7 | ---------------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.ptp 14 | dpnp.percentile 15 | dpnp.nanpercentile 16 | dpnp.quantile 17 | dpnp.nanquantile 18 | 19 | 20 | Averages and variances 21 | ---------------------- 22 | 23 | .. autosummary:: 24 | :toctree: generated/ 25 | :nosignatures: 26 | 27 | dpnp.median 28 | dpnp.average 29 | dpnp.mean 30 | dpnp.std 31 | dpnp.var 32 | dpnp.nanmedian 33 | dpnp.nanmean 34 | dpnp.nanstd 35 | dpnp.nanvar 36 | 37 | 38 | Correlations 39 | ------------ 40 | 41 | .. autosummary:: 42 | :toctree: generated/ 43 | :nosignatures: 44 | 45 | dpnp.corrcoef 46 | dpnp.correlate 47 | dpnp.cov 48 | 49 | 50 | Histograms 51 | ---------- 52 | 53 | .. autosummary:: 54 | :toctree: generated/ 55 | :nosignatures: 56 | 57 | dpnp.histogram 58 | dpnp.histogram2d 59 | dpnp.histogramdd 60 | dpnp.bincount 61 | dpnp.histogram_bin_edges 62 | dpnp.digitize 63 | -------------------------------------------------------------------------------- /doc/reference/window.rst: -------------------------------------------------------------------------------- 1 | Window functions 2 | ================ 3 | 4 | .. https://numpy.org/doc/stable/reference/routines.window.html 5 | 6 | Various windows 7 | --------------- 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | :nosignatures: 12 | 13 | dpnp.bartlett 14 | dpnp.blackman 15 | dpnp.hamming 16 | dpnp.hanning 17 | dpnp.kaiser 18 | -------------------------------------------------------------------------------- /dpnp/backend/cmake/Modules/README.md: -------------------------------------------------------------------------------- 1 | # oneAPI CMake scripts vendored from Intel oneAPI BaseKit 2023.0.0 2 | 3 | This is done to work around absence of this script in onedpl-devel conda 4 | package. Once it is added, expected 2023.2.0, this vendored package is 5 | to be removed. 6 | 7 | tbb-devel script has been modified to allow it to work correctly in conda 8 | environment. 9 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/indexing/choose.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::indexing 33 | { 34 | void init_choose(py::module_ m); 35 | } // namespace dpnp::extensions::indexing 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/lapack/heevd.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::lapack 33 | { 34 | void init_heevd(py::module_ m); 35 | } // namespace dpnp::extensions::lapack 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/lapack/heevd_batch.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::lapack 33 | { 34 | void init_heevd_batch(py::module_ m); 35 | } // namespace dpnp::extensions::lapack 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/lapack/syevd.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::lapack 33 | { 34 | void init_syevd(py::module_ m); 35 | } // namespace dpnp::extensions::lapack 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/lapack/syevd_batch.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::lapack 33 | { 34 | void init_syevd_batch(py::module_ m); 35 | } // namespace dpnp::extensions::lapack 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/degrees.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_degrees(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/fabs.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_fabs(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/fix.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_fix(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/fmax.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_fmax(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/fmin.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_fmin(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/fmod.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_fmod(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/gcd.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_gcd(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/i0.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_i0(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/lcm.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_lcm(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/ldexp.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_ldexp(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/ufunc/elementwise_functions/sinc.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::ufunc 33 | { 34 | void init_sinc(py::module_ m); 35 | } // namespace dpnp::extensions::ufunc 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/abs.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_abs(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/acos.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_acos(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/acosh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_acosh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/add.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_add(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/arg.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_arg(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/asin.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_asin(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/asinh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_asinh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/atan.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_atan(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/atan2.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_atan2(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/atanh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_atanh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/cbrt.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_cbrt(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/ceil.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_ceil(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/conj.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_conj(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/copysign.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_copysign(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/cos.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_cos(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/cosh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_cosh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/div.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_div(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/exp.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_exp(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/exp2.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_exp2(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/expm1.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_expm1(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/floor.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_floor(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/fmax.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_fmax(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/fmin.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_fmin(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/fmod.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_fmod(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/hypot.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_hypot(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/i0.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_i0(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/inv.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_inv(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/ln.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_ln(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/log10.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_log10(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/log1p.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_log1p(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/log2.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_log2(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/mul.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_mul(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/nextafter.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2024-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_nextafter(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/pow.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_pow(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/rint.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_rint(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/sin.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_sin(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/sinh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_sinh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/sqr.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_sqr(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/sqrt.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_sqrt(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/sub.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_sub(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/tan.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_tan(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/tanh.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_tanh(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/extensions/vm/trunc.hpp: -------------------------------------------------------------------------------- 1 | //***************************************************************************** 2 | // Copyright (c) 2023-2025, Intel Corporation 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // - Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // - Redistributions in binary form must reproduce the above copyright notice, 10 | // this list of conditions and the following disclaimer in the documentation 11 | // and/or other materials provided with the distribution. 12 | // 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 | // THE POSSIBILITY OF SUCH DAMAGE. 24 | //***************************************************************************** 25 | 26 | #pragma once 27 | 28 | #include 29 | 30 | namespace py = pybind11; 31 | 32 | namespace dpnp::extensions::vm 33 | { 34 | void init_trunc(py::module_ m); 35 | } // namespace dpnp::extensions::vm 36 | -------------------------------------------------------------------------------- /dpnp/backend/tests/dpnp_test_utils.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "dpnp_iterator.hpp" 5 | 6 | using namespace std; 7 | using dpnpc_it_t = DPNPC_id::iterator; 8 | using dpnpc_value_t = dpnpc_it_t::value_type; 9 | using dpnpc_index_t = dpnpc_it_t::size_type; 10 | 11 | template 12 | vector<_DataType> get_input_data(const vector &shape) 13 | { 14 | const dpnpc_index_t size = 15 | accumulate(shape.begin(), shape.end(), dpnpc_index_t(1), 16 | multiplies()); 17 | 18 | vector<_DataType> input_data(size); 19 | iota(input_data.begin(), input_data.end(), 20 | 1); // let's start from 1 to avoid cleaned memory comparison 21 | 22 | return input_data; 23 | } 24 | 25 | template 26 | _DataType *get_shared_data(const vector<_DataType> &input_data) 27 | { 28 | const size_t data_size_in_bytes = input_data.size() * sizeof(_DataType); 29 | _DataType *shared_data = 30 | reinterpret_cast<_DataType *>(dpnp_memory_alloc_c(data_size_in_bytes)); 31 | copy(input_data.begin(), input_data.end(), shared_data); 32 | 33 | return shared_data; 34 | } 35 | -------------------------------------------------------------------------------- /dpnp/cmake/copy_existing.cmake: -------------------------------------------------------------------------------- 1 | if (EXISTS ${SOURCE_FILE}) 2 | configure_file(${SOURCE_FILE} ${DEST} COPYONLY) 3 | endif() 4 | -------------------------------------------------------------------------------- /dpnp/dpnp_algo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(dpnp_algo_pyx_deps 3 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_sorting.pxi 4 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_mathematical.pxi 5 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_indexing.pxi 6 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_special.pxi 7 | ) 8 | 9 | build_dpnp_cython_ext_with_backend( 10 | dpnp_algo 11 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo.pyx 12 | dpnp/dpnp_algo 13 | ) 14 | 15 | add_custom_target(_dpnp_algo_deps DEPENDS ${dpnp_algo_pyx_deps}) 16 | add_dependencies(dpnp_algo _dpnp_algo_deps) 17 | -------------------------------------------------------------------------------- /dpnp/dpnp_algo/__init__.pxd: -------------------------------------------------------------------------------- 1 | # cython: language_level=3 2 | # -*- coding: utf-8 -*- 3 | # ***************************************************************************** 4 | # Copyright (c) 2016-2025, Intel Corporation 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # - Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # - Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 25 | # THE POSSIBILITY OF SUCH DAMAGE. 26 | # ***************************************************************************** 27 | 28 | from libcpp.vector cimport vector 29 | 30 | ctypedef ssize_t shape_elem_type 31 | ctypedef vector.vector[shape_elem_type] shape_type_c 32 | 33 | from dpnp.dpnp_algo.dpnp_algo cimport * 34 | -------------------------------------------------------------------------------- /dpnp/dpnp_algo/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ***************************************************************************** 3 | # Copyright (c) 2016-2025, Intel Corporation 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # - Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # - Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | # THE POSSIBILITY OF SUCH DAMAGE. 25 | # ***************************************************************************** 26 | 27 | from dpnp.dpnp_algo.dpnp_algo import * 28 | from dpnp.dpnp_algo.dpnp_algo import __all__ as __all__dpnp_algo 29 | 30 | __all__ = __all__dpnp_algo 31 | -------------------------------------------------------------------------------- /dpnp/dpnp_utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Building dpnp_algo_utils Cython extension 2 | 3 | build_dpnp_cython_ext_with_backend( 4 | dpnp_algo_utils 5 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_utils.pyx 6 | dpnp/dpnp_utils 7 | ) 8 | -------------------------------------------------------------------------------- /dpnp/dpnp_utils/__init__.pxd: -------------------------------------------------------------------------------- 1 | # cython: language_level=3 2 | # -*- coding: utf-8 -*- 3 | # ***************************************************************************** 4 | # Copyright (c) 2016-2025, Intel Corporation 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # - Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # - Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 25 | # THE POSSIBILITY OF SUCH DAMAGE. 26 | # ***************************************************************************** 27 | 28 | from dpnp.dpnp_utils.dpnp_algo_utils cimport * 29 | -------------------------------------------------------------------------------- /dpnp/dpnp_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ***************************************************************************** 3 | # Copyright (c) 2016-2025, Intel Corporation 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # - Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # - Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | # THE POSSIBILITY OF SUCH DAMAGE. 25 | # ***************************************************************************** 26 | 27 | from dpnp.dpnp_utils.dpnp_algo_utils import * 28 | from dpnp.dpnp_utils.dpnp_algo_utils import __all__ as __all__dpnp_algo_utils 29 | 30 | __all__ = __all__dpnp_algo_utils 31 | -------------------------------------------------------------------------------- /dpnp/random/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Building dpnp_algo_random Cython extension 2 | 3 | build_dpnp_cython_ext_with_backend( 4 | dpnp_algo_random 5 | ${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_random.pyx 6 | dpnp/random 7 | ) 8 | -------------------------------------------------------------------------------- /dpnp/tests/__init__.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | 3 | from . import testing 4 | 5 | numpy.testing.assert_allclose = testing.assert_allclose 6 | numpy.testing.assert_almost_equal = testing.assert_almost_equal 7 | numpy.testing.assert_array_almost_equal = testing.assert_array_almost_equal 8 | numpy.testing.assert_array_equal = testing.assert_array_equal 9 | numpy.testing.assert_equal = testing.assert_equal 10 | -------------------------------------------------------------------------------- /dpnp/tests/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | all_int_types = bool(os.getenv("DPNP_TEST_ALL_INT_TYPES", 0)) 4 | float16_types = bool(os.getenv("DPNP_TEST_FLOAT_16", 0)) 5 | complex_types = bool(os.getenv("DPNP_TEST_COMPLEX_TYPES", 0)) 6 | bool_types = bool(os.getenv("DPNP_TEST_BOOL_TYPES", 0)) 7 | -------------------------------------------------------------------------------- /dpnp/tests/skipped_tests.tbl: -------------------------------------------------------------------------------- 1 | tests/test_random.py::TestDistributionsMultivariateNormal::test_moments 2 | tests/test_random.py::TestDistributionsMultivariateNormal::test_output_shape_check 3 | tests/test_random.py::TestDistributionsMultivariateNormal::test_seed 4 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray(x).astype(dpnp.complex64)] 5 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.astype(dpnp.asarray(x), dpnp.int8)] 6 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.astype(dpnp.asarray(x), object)] 7 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.vstack([x, x]).T] 8 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: (dpnp.asarray([(i, i) for i in x], [("a", int), ("b", int)]).view(dpnp.recarray))] 9 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([(i, i) for i in x], [("a", object), ("b", dpnp.int32)])]] 10 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray(x).astype(dpnp.int8)] 11 | 12 | tests/third_party/intel/test_zero_copy_test1.py::test_dpnp_interaction_with_dpctl_memory 13 | -------------------------------------------------------------------------------- /dpnp/tests/skipped_tests_gpu.tbl: -------------------------------------------------------------------------------- 1 | tests/test_random.py::TestDistributionsMultivariateNormal::test_moments 2 | tests/test_random.py::TestDistributionsMultivariateNormal::test_output_shape_check 3 | tests/test_random.py::TestDistributionsMultivariateNormal::test_seed 4 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle[float32] 5 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle[float64] 6 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle[int32] 7 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle[int64] 8 | tests/test_random.py::TestPermutationsTestShuffle::test_no_miss_numbers[float32] 9 | tests/test_random.py::TestPermutationsTestShuffle::test_no_miss_numbers[float64] 10 | tests/test_random.py::TestPermutationsTestShuffle::test_no_miss_numbers[int32] 11 | tests/test_random.py::TestPermutationsTestShuffle::test_no_miss_numbers[int64] 12 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray(x).astype(dpnp.complex64)] 13 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.astype(dpnp.asarray(x), dpnp.int8)] 14 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.astype(dpnp.asarray(x), object)] 15 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.vstack([x, x]).T] 16 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: (dpnp.asarray([(i, i) for i in x], [("a", int), ("b", int)]).view(dpnp.recarray))] 17 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([(i, i) for i in x], [("a", object), ("b", dpnp.int32)])]] 18 | tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray(x).astype(dpnp.int8)] 19 | 20 | tests/third_party/intel/test_zero_copy_test1.py::test_dpnp_interaction_with_dpctl_memory 21 | -------------------------------------------------------------------------------- /dpnp/tests/test_arithmetic.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from .third_party.cupy import testing 4 | 5 | 6 | class TestArithmetic(unittest.TestCase): 7 | @testing.for_float_dtypes() 8 | @testing.numpy_cupy_allclose() 9 | def test_modf_part1(self, xp, dtype): 10 | a = xp.array([-2.5, -1.5, -0.5, 0, 0.5, 1.5, 2.5], dtype=dtype) 11 | b, _ = xp.modf(a) 12 | return b 13 | 14 | @testing.for_float_dtypes() 15 | @testing.numpy_cupy_allclose() 16 | def test_modf_part2(self, xp, dtype): 17 | a = xp.array([-2.5, -1.5, -0.5, 0, 0.5, 1.5, 2.5], dtype=dtype) 18 | _, c = xp.modf(a) 19 | return c 20 | 21 | @testing.for_float_dtypes() 22 | @testing.numpy_cupy_allclose(type_check=False) 23 | def test_nanprod(self, xp, dtype): 24 | a = xp.array([-2.5, -1.5, xp.nan, 10.5, 1.5, xp.nan], dtype=dtype) 25 | return xp.nanprod(a) 26 | 27 | @testing.for_float_dtypes() 28 | @testing.numpy_cupy_allclose() 29 | def test_nansum(self, xp, dtype): 30 | a = xp.array([-2.5, -1.5, xp.nan, 10.5, 1.5, xp.nan], dtype=dtype) 31 | return xp.nansum(a) 32 | 33 | @testing.for_float_dtypes() 34 | @testing.numpy_cupy_allclose() 35 | def test_remainder(self, xp, dtype): 36 | a = xp.array([5, -3, -2, -1, -5], dtype=dtype) 37 | b = xp.full(a.size, 3, dtype=dtype) 38 | return xp.remainder(a, b) 39 | -------------------------------------------------------------------------------- /dpnp/tests/test_array_utils.py: -------------------------------------------------------------------------------- 1 | import dpnp 2 | 3 | 4 | def test_byte_bounds(): 5 | a = dpnp.zeros((3, 4), dtype=dpnp.int64, usm_type="shared") 6 | values = dpnp.arange(12, dtype="int64") 7 | for i in range(3): 8 | a[i, :] = values[i * 4 : (i + 1) * 4] 9 | low, high = dpnp.byte_bounds(a) 10 | assert (high - low) == (a.size * a.itemsize) 11 | 12 | 13 | def test_unusual_order_positive_stride(): 14 | a = dpnp.zeros((3, 4), dtype=dpnp.int64, usm_type="shared") 15 | values = dpnp.arange(12, dtype="int64") 16 | for i in range(3): 17 | a[i, :] = values[i * 4 : (i + 1) * 4] 18 | b = a.T 19 | low, high = dpnp.byte_bounds(b) 20 | assert (high - low) == (b.size * b.itemsize) 21 | 22 | 23 | def test_unusual_order_negative_stride(): 24 | a = dpnp.zeros((3, 4), dtype=dpnp.int64, usm_type="shared") 25 | values = dpnp.arange(12, dtype="int64") 26 | for i in range(3): 27 | a[i, :] = values[i * 4 : (i + 1) * 4] 28 | b = a.T[::-1] 29 | low, high = dpnp.byte_bounds(b) 30 | assert (high - low) == (b.size * b.itemsize) 31 | 32 | 33 | def test_strided(): 34 | a = dpnp.zeros(12, dtype=dpnp.int64, usm_type="shared") 35 | a[:] = dpnp.arange(12, dtype="int64") 36 | b = a[::2] 37 | low, high = dpnp.byte_bounds(b) 38 | expected_byte_diff = b.size * 2 * b.itemsize - b.itemsize 39 | assert (high - low) == expected_byte_diff 40 | -------------------------------------------------------------------------------- /dpnp/tests/test_flat.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | from numpy.testing import assert_array_equal, assert_raises 4 | 5 | import dpnp 6 | 7 | 8 | class TestFlatiter: 9 | @pytest.mark.parametrize( 10 | "a, index", 11 | [ 12 | (np.array([1, 0, 2, -3, -1, 2, 21, -9]), 0), 13 | (np.arange(1, 7).reshape(2, 3), 3), 14 | (np.arange(1, 7).reshape(2, 3).T, 3), 15 | ], 16 | ids=["1D array", "2D array", "2D.T array"], 17 | ) 18 | def test_flat_getitem(self, a, index): 19 | a_dp = dpnp.array(a) 20 | result = a_dp.flat[index] 21 | expected = a.flat[index] 22 | assert_array_equal(expected, result) 23 | 24 | def test_flat_iteration(self): 25 | a = np.array([[1, 2], [3, 4]]) 26 | a_dp = dpnp.array(a) 27 | for dp_val, np_val in zip(a_dp.flat, a.flat): 28 | assert dp_val == np_val 29 | 30 | def test_init_error(self): 31 | assert_raises(TypeError, dpnp.flatiter, [1, 2, 3]) 32 | 33 | def test_flat_key_error(self): 34 | a_dp = dpnp.array(42) 35 | with pytest.raises(KeyError): 36 | _ = a_dp.flat[1] 37 | 38 | def test_flat_invalid_key(self): 39 | a_dp = dpnp.array([1, 2, 3]) 40 | flat = dpnp.flatiter(a_dp) 41 | # check __getitem__ 42 | with pytest.raises(TypeError): 43 | _ = flat["invalid"] 44 | # check __setitem__ 45 | with pytest.raises(TypeError): 46 | flat["invalid"] = 42 47 | 48 | def test_flat_out_of_bounds(self): 49 | a_dp = dpnp.array([1, 2, 3]) 50 | flat = dpnp.flatiter(a_dp) 51 | with pytest.raises(IndexError): 52 | _ = flat[10] 53 | -------------------------------------------------------------------------------- /dpnp/tests/test_mixins.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from .third_party.cupy import testing 4 | 5 | 6 | class TestMatMul(unittest.TestCase): 7 | @testing.for_float_dtypes() 8 | @testing.numpy_cupy_allclose() 9 | def test_matmul(self, xp, dtype): 10 | data = [1.0, 2.0, 3.0, 4.0] 11 | shape = (2, 2) 12 | 13 | a = xp.array(data, dtype=dtype).reshape(shape) 14 | b = xp.array(data, dtype=dtype).reshape(shape) 15 | 16 | return xp.matmul(a, b) 17 | 18 | @testing.for_float_dtypes() 19 | @testing.numpy_cupy_allclose() 20 | def test_matmul2(self, xp, dtype): 21 | data1 = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] 22 | data2 = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] 23 | 24 | a = xp.array(data1, dtype=dtype).reshape(3, 2) 25 | b = xp.array(data2, dtype=dtype).reshape(2, 4) 26 | 27 | return xp.matmul(a, b) 28 | 29 | @testing.for_float_dtypes() 30 | @testing.numpy_cupy_allclose() 31 | def test_matmul3(self, xp, dtype): 32 | data1 = xp.full((513, 513), 5) 33 | data2 = xp.full((513, 513), 2) 34 | out = xp.empty((513, 513), dtype=dtype) 35 | 36 | a = xp.array(data1, dtype=dtype) 37 | b = xp.array(data2, dtype=dtype) 38 | 39 | xp.matmul(a, b, out=out) 40 | 41 | return out 42 | 43 | 44 | if __name__ == "__main__": 45 | unittest.main() 46 | -------------------------------------------------------------------------------- /dpnp/tests/test_special.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | import numpy 4 | from numpy.testing import assert_allclose 5 | 6 | import dpnp 7 | 8 | 9 | def test_erf(): 10 | a = numpy.linspace(2.0, 3.0, num=10) 11 | ia = dpnp.array(a) 12 | 13 | expected = numpy.empty_like(a) 14 | for idx, val in enumerate(a): 15 | expected[idx] = math.erf(val) 16 | 17 | result = dpnp.erf(ia) 18 | 19 | assert_allclose(result, expected) 20 | 21 | 22 | def test_erf_fallback(): 23 | a = numpy.linspace(2.0, 3.0, num=10) 24 | dpa = dpnp.linspace(2.0, 3.0, num=10) 25 | 26 | expected = numpy.empty_like(a) 27 | for idx, val in enumerate(a): 28 | expected[idx] = math.erf(val) 29 | 30 | result = dpnp.erf(dpa) 31 | 32 | assert_allclose(result, expected) 33 | -------------------------------------------------------------------------------- /dpnp/tests/testing/__init__.py: -------------------------------------------------------------------------------- 1 | from .array import ( 2 | assert_allclose, 3 | assert_almost_equal, 4 | assert_array_almost_equal, 5 | assert_array_equal, 6 | assert_equal, 7 | ) 8 | -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/tests_perf/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/examples/sinAB_test.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | 4 | def cos_2_args(executor, size, test_type): 5 | """sin(A + B) = sin A cos B + cos A sin B""" 6 | 7 | start_time = time.perf_counter() 8 | input_A = executor.arange(size, dtype=test_type) 9 | input_B = executor.arange(size, dtype=test_type) 10 | end_time = time.perf_counter() 11 | memalloc_time = end_time - start_time 12 | 13 | start_time = time.perf_counter() 14 | 15 | sin_A = executor.sin(input_A) 16 | cos_B = executor.cos(input_B) 17 | sincosA = sin_A * cos_B 18 | 19 | cos_A = executor.cos(input_A) 20 | sin_B = executor.sin(input_B) 21 | sincosB = cos_A * sin_B 22 | 23 | result = sincosA + sincosB 24 | 25 | end_time = time.perf_counter() 26 | calculation_time = end_time - start_time 27 | 28 | print( 29 | f"memalloc_time={memalloc_time}, calculation_time={calculation_time}, executor={executor}" 30 | ) 31 | 32 | return result 33 | 34 | 35 | if __name__ == "__main__": 36 | size = 33554432 # 16777216 37 | 38 | import dpnp 39 | 40 | cos_2_args(dpnp, size, dpnp.float64) 41 | 42 | import numpy 43 | 44 | cos_2_args(numpy, size, numpy.float64) 45 | -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/math_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/tests_perf/math_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/math_tests/test_black_scholes.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | import numpy 4 | import pytest 5 | 6 | from ..data_generator import * 7 | from ..test_perf_base import DPNPTestPerfBase 8 | 9 | SEED = 7777777 10 | SL, SH = 10.0, 50.0 11 | KL, KH = 10.0, 50.0 12 | TL, TH = 1.0, 2.0 13 | RISK_FREE = 0.1 14 | VOLATILITY = 0.2 15 | 16 | 17 | def math_erf(x): 18 | result = numpy.empty(x.shape, dtype=x.dtype) 19 | for i in range(result.size): 20 | result[i] = math.erf(x[i]) 21 | 22 | return result 23 | 24 | 25 | # module 'numpy' has no attribute 'erf' 26 | numpy.erf = math_erf 27 | 28 | 29 | def gen_data(lib, low, high, size): 30 | return lib.random.uniform(low, high, size) 31 | 32 | 33 | def black_scholes_put(lib, S, K, T, r, sigma): 34 | d1 = (lib.log(S / K) + (r + sigma * sigma / 2.0) * T) / ( 35 | sigma * lib.sqrt(T) 36 | ) 37 | d2 = d1 - sigma * lib.sqrt(T) 38 | 39 | cdf_d1 = (1 + lib.erf(d1 / lib.sqrt(2))) / 2 40 | cdf_d2 = (1 + lib.erf(d2 / lib.sqrt(2))) / 2 41 | 42 | bs_call = S * cdf_d1 - K * lib.exp(-r * T) * cdf_d2 43 | 44 | return K * lib.exp(-r * T) - S + bs_call 45 | 46 | 47 | class TestBlackScholes(DPNPTestPerfBase): 48 | @pytest.mark.parametrize("dtype", [numpy.float64]) 49 | @pytest.mark.parametrize("size", [1024, 2048, 4096, 8192]) 50 | def test_bs_put(self, lib, dtype, size): 51 | numpy.random.seed(SEED) 52 | S = gen_data(lib, SL, SH, size) 53 | K = gen_data(lib, KL, KH, size) 54 | T = gen_data(lib, TL, TH, size) 55 | 56 | self.dpnp_benchmark( 57 | "bs_put", 58 | lib, 59 | dtype, 60 | size, 61 | lib, 62 | S, 63 | K, 64 | T, 65 | RISK_FREE, 66 | VOLATILITY, 67 | custom_fptr=black_scholes_put, 68 | ) 69 | -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/math_tests/test_dpnp.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import pytest 3 | 4 | import dpnp 5 | 6 | from ..data_generator import * 7 | from ..test_perf_base import DPNPTestPerfBase 8 | 9 | 10 | class TestDPNP(DPNPTestPerfBase): 11 | @pytest.mark.parametrize( 12 | "dtype", [numpy.float64, numpy.float32, numpy.int64, numpy.int32] 13 | ) 14 | @pytest.mark.parametrize( 15 | "size", [32, 64, 128, 256] 16 | ) # , 512, 1024, 2048, 4096]) 17 | def test_matmul(self, lib, dtype, size): 18 | input1 = gen_array_2d(lib, size, size, dtype=dtype, seed=self.seed) 19 | input2 = gen_array_2d(lib, size, size, dtype=dtype, seed=self.seed) 20 | 21 | self.dpnp_benchmark("matmul", lib, dtype, input1.size, input1, input2) 22 | -------------------------------------------------------------------------------- /dpnp/tests/tests_perf/math_tests/test_mathematical.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import pytest 3 | 4 | from ..data_generator import * 5 | from ..test_perf_base import DPNPTestPerfBase 6 | 7 | 8 | class TestDPNPMathematical(DPNPTestPerfBase): 9 | @pytest.mark.parametrize( 10 | "func_name", ["add", "divide", "multiply", "subtract"] 11 | ) 12 | @pytest.mark.parametrize( 13 | "dtype", [numpy.float64, numpy.float32, numpy.int64, numpy.int32] 14 | ) 15 | @pytest.mark.parametrize( 16 | "size", [512, 1024, 2048, 4096, 8192, 16384, 32768] 17 | ) 18 | def test_math_2args(self, func_name, lib, dtype, size): 19 | input1 = gen_array_1d(lib, size, dtype=dtype, seed=self.seed) 20 | input2 = gen_array_1d(lib, size, dtype=dtype, seed=self.seed) 21 | 22 | self.dpnp_benchmark(func_name, lib, dtype, input1.size, input1, input2) 23 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/binary_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/binary_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/binary_tests/test_elementwise.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from dpnp.tests.third_party.cupy import testing 4 | 5 | 6 | class TestElementwise(unittest.TestCase): 7 | 8 | @testing.for_int_dtypes() 9 | @testing.numpy_cupy_array_equal() 10 | def check_unary_int(self, name, xp, dtype): 11 | a = xp.array([-3, -2, -1, 0, 1, 2, 3]).astype(dtype) 12 | return getattr(xp, name)(a) 13 | 14 | @testing.for_int_dtypes() 15 | @testing.numpy_cupy_array_equal() 16 | def check_binary_int(self, name, xp, dtype): 17 | a = xp.array([-3, -2, -1, 0, 1, 2, 3]).astype(dtype) 18 | b = xp.array([0, 1, 2, 3, 4, 5, 6]).astype(dtype) 19 | return getattr(xp, name)(a, b) 20 | 21 | def test_bitwise_and(self): 22 | self.check_binary_int("bitwise_and") 23 | 24 | def test_bitwise_or(self): 25 | self.check_binary_int("bitwise_or") 26 | 27 | def test_bitwise_xor(self): 28 | self.check_binary_int("bitwise_xor") 29 | 30 | def test_invert(self): 31 | self.check_unary_int("invert") 32 | 33 | def test_left_shift(self): 34 | self.check_binary_int("left_shift") 35 | 36 | def test_right_shift(self): 37 | self.check_binary_int("right_shift") 38 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/core_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_iter.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import numpy 4 | import pytest 5 | 6 | import dpnp as cupy 7 | from dpnp.tests.third_party.cupy import testing 8 | 9 | 10 | @testing.parameterize( 11 | *testing.product( 12 | {"shape": [(3,), (2, 3, 4), (0,), (0, 2), (3, 0)]}, 13 | ) 14 | ) 15 | class TestIter(unittest.TestCase): 16 | 17 | @testing.for_all_dtypes() 18 | @testing.numpy_cupy_array_equal() 19 | def test_list(self, xp, dtype): 20 | x = testing.shaped_arange(self.shape, xp, dtype) 21 | return list(x) 22 | 23 | @testing.for_all_dtypes() 24 | @testing.numpy_cupy_equal() 25 | def test_len(self, xp, dtype): 26 | x = testing.shaped_arange(self.shape, xp, dtype) 27 | return len(x) 28 | 29 | 30 | class TestIterInvalid(unittest.TestCase): 31 | 32 | @testing.for_all_dtypes() 33 | def test_iter(self, dtype): 34 | for xp in (numpy, cupy): 35 | x = testing.shaped_arange((), xp, dtype) 36 | with pytest.raises(TypeError): 37 | iter(x) 38 | 39 | @testing.for_all_dtypes() 40 | def test_len(self, dtype): 41 | for xp in (numpy, cupy): 42 | x = testing.shaped_arange((), xp, dtype) 43 | with pytest.raises(TypeError): 44 | len(x) 45 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_ndarray_contiguity.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from dpnp.tests.third_party.cupy import testing 4 | 5 | 6 | class TestArrayContiguity(unittest.TestCase): 7 | 8 | def test_is_contiguous(self): 9 | a = testing.shaped_arange((2, 3, 4)) 10 | assert a.flags.c_contiguous is True 11 | b = a.transpose(2, 0, 1) 12 | assert b.flags.c_contiguous is False 13 | c = a[::-1] 14 | assert c.flags.c_contiguous is False 15 | d = a[:, :, ::2] 16 | assert d.flags.c_contiguous is False 17 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_ndarray_conversion.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import numpy 4 | import pytest 5 | 6 | import dpnp as cupy 7 | from dpnp.tests.third_party.cupy import testing 8 | 9 | 10 | @testing.parameterize( 11 | {"shape": ()}, 12 | {"shape": (1,)}, 13 | {"shape": (1, 1, 1)}, 14 | ) 15 | class TestNdarrayItem(unittest.TestCase): 16 | 17 | @testing.for_all_dtypes() 18 | @testing.numpy_cupy_equal() 19 | def test_item(self, xp, dtype): 20 | a = xp.full(self.shape, 3, dtype=dtype) 21 | return a.item() 22 | 23 | 24 | @testing.parameterize( 25 | {"shape": (0,)}, 26 | {"shape": (2, 3)}, 27 | {"shape": (1, 0, 1)}, 28 | ) 29 | class TestNdarrayItemRaise(unittest.TestCase): 30 | 31 | def test_item(self): 32 | for xp in (numpy, cupy): 33 | a = testing.shaped_arange(self.shape, xp, xp.float32) 34 | with pytest.raises(ValueError): 35 | a.item() 36 | 37 | 38 | @testing.parameterize( 39 | {"shape": ()}, 40 | {"shape": (1,)}, 41 | {"shape": (2, 3)}, 42 | {"shape": (2, 3), "order": "C"}, 43 | {"shape": (2, 3), "order": "F"}, 44 | ) 45 | @pytest.mark.skip("tobytes() method is not supported yet") 46 | class TestNdarrayToBytes(unittest.TestCase): 47 | 48 | @testing.for_all_dtypes() 49 | @testing.numpy_cupy_equal() 50 | def test_item(self, xp, dtype): 51 | a = testing.shaped_arange(self.shape, xp, dtype) 52 | if hasattr(self, "order"): 53 | return a.tobytes(self.order) 54 | else: 55 | return a.tobytes() 56 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_ndarray_owndata.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pytest 4 | 5 | # from cupy import _core 6 | 7 | pytest.skip("owndata attribute is not supported", allow_module_level=True) 8 | 9 | 10 | class TestArrayOwndata(unittest.TestCase): 11 | 12 | def setUp(self): 13 | self.a = _core.ndarray(()) 14 | 15 | def test_original_array(self): 16 | assert self.a.flags.owndata is True 17 | 18 | def test_view_array(self): 19 | v = self.a.view() 20 | assert v.flags.owndata is False 21 | 22 | def test_reshaped_array(self): 23 | r = self.a.reshape(()) 24 | assert r.flags.owndata is False 25 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_scan.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import unittest 4 | 5 | import pytest 6 | 7 | import dpnp as cupy 8 | 9 | # from cupy import cuda 10 | # from cupy._core._routines_math import _scan_for_test as scan 11 | from dpnp.tests.third_party.cupy import testing 12 | 13 | pytest.skip("scan() is not supported", allow_module_level=True) 14 | 15 | 16 | class TestScan(unittest.TestCase): 17 | 18 | @testing.for_all_dtypes() 19 | def test_scan(self, dtype): 20 | element_num = 10000 21 | 22 | if dtype in {cupy.int8, cupy.uint8, cupy.float16}: 23 | element_num = 100 24 | 25 | a = cupy.ones((element_num,), dtype=dtype) 26 | prefix_sum = scan(a) 27 | expect = cupy.arange(start=1, stop=element_num + 1).astype(dtype) 28 | 29 | testing.assert_array_equal(prefix_sum, expect) 30 | 31 | def test_check_1d_array(self): 32 | with self.assertRaises(TypeError): 33 | a = cupy.zeros((2, 2)) 34 | scan(a) 35 | 36 | @testing.multi_gpu(2) 37 | def test_multi_gpu(self): 38 | with cuda.Device(0): 39 | a = cupy.zeros((10,)) 40 | scan(a) 41 | with cuda.Device(1): 42 | a = cupy.zeros((10,)) 43 | scan(a) 44 | 45 | @testing.for_all_dtypes() 46 | def test_scan_out(self, dtype): 47 | element_num = 10000 48 | 49 | if dtype in {cupy.int8, cupy.uint8, cupy.float16}: 50 | element_num = 100 51 | 52 | a = cupy.ones((element_num,), dtype=dtype) 53 | b = cupy.zeros_like(a) 54 | scan(a, b) 55 | expect = cupy.arange(start=1, stop=element_num + 1).astype(dtype) 56 | 57 | testing.assert_array_equal(b, expect) 58 | 59 | scan(a, a) 60 | testing.assert_array_equal(a, expect) 61 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/core_tests/test_syncdetect.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pytest 4 | 5 | import dpnp as cupy 6 | 7 | # import cupyx 8 | 9 | pytest.skip("get() method is not supported", allow_module_level=True) 10 | 11 | 12 | class TestSyncDetect(unittest.TestCase): 13 | 14 | def test_disallowed(self): 15 | a = cupy.array([2, 3]) 16 | with cupyx.allow_synchronize(False): 17 | with pytest.raises(cupyx.DeviceSynchronized): 18 | a.get() 19 | 20 | def test_allowed(self): 21 | a = cupy.array([2, 3]) 22 | with cupyx.allow_synchronize(True): 23 | a.get() 24 | 25 | def test_nested_disallowed(self): 26 | a = cupy.array([2, 3]) 27 | with cupyx.allow_synchronize(True): 28 | with cupyx.allow_synchronize(False): 29 | with pytest.raises(cupyx.DeviceSynchronized): 30 | a.get() 31 | 32 | def test_nested_allowed(self): 33 | a = cupy.array([2, 3]) 34 | with cupyx.allow_synchronize(False): 35 | with cupyx.allow_synchronize(True): 36 | a.get() 37 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/creation_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/creation_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/fft_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/fft_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/indexing_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/indexing_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/io_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/io_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/io_tests/test_formatting.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import numpy 4 | import pytest 5 | 6 | import dpnp as cupy 7 | from dpnp.tests.third_party.cupy import testing 8 | 9 | pytest.skip("text formatting is not supported yet", allow_module_level=True) 10 | 11 | 12 | class TestFormatting(unittest.TestCase): 13 | 14 | def test_array_repr(self): 15 | a = testing.shaped_arange((2, 3, 4), cupy) 16 | b = testing.shaped_arange((2, 3, 4), numpy) 17 | assert cupy.array_repr(a) == numpy.array_repr(b) 18 | 19 | def test_array_str(self): 20 | a = testing.shaped_arange((2, 3, 4), cupy) 21 | b = testing.shaped_arange((2, 3, 4), numpy) 22 | assert cupy.array_str(a) == numpy.array_str(b) 23 | 24 | def test_array2string(self): 25 | a = testing.shaped_arange((2, 3, 4), cupy) 26 | b = testing.shaped_arange((2, 3, 4), numpy) 27 | assert cupy.array2string(a) == numpy.array2string(b) 28 | 29 | def test_format_float_positional_python_scalar(self): 30 | x = 1.0 31 | assert cupy.format_float_positional(x) == numpy.format_float_positional( 32 | x 33 | ) 34 | 35 | def test_format_float_positional(self): 36 | a = testing.shaped_arange((), cupy) 37 | b = testing.shaped_arange((), numpy) 38 | assert cupy.format_float_positional(a) == numpy.format_float_positional( 39 | b 40 | ) 41 | 42 | def test_format_float_scientific(self): 43 | a = testing.shaped_arange((), cupy) 44 | b = testing.shaped_arange((), numpy) 45 | assert cupy.format_float_scientific(a) == numpy.format_float_scientific( 46 | b 47 | ) 48 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/io_tests/test_text.py: -------------------------------------------------------------------------------- 1 | import filecmp 2 | import os 3 | import tempfile 4 | import unittest 5 | 6 | import numpy 7 | import pytest 8 | 9 | import dpnp as cupy 10 | 11 | pytest.skip("text functions are not supported yet", allow_module_level=True) 12 | 13 | 14 | class TestText(unittest.TestCase): 15 | 16 | def test_savetxt(self): 17 | tmp_cupy = tempfile.NamedTemporaryFile(delete=False) 18 | tmp_numpy = tempfile.NamedTemporaryFile(delete=False) 19 | try: 20 | tmp_cupy.close() 21 | tmp_numpy.close() 22 | array = [[1, 2, 3], [2, 3, 4]] 23 | cupy.savetxt(tmp_cupy.name, cupy.array(array)) 24 | numpy.savetxt(tmp_numpy.name, numpy.array(array)) 25 | assert filecmp.cmp(tmp_cupy.name, tmp_numpy.name) 26 | finally: 27 | os.remove(tmp_cupy.name) 28 | os.remove(tmp_numpy.name) 29 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/lib_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/lib_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/linalg_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/linalg_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/logic_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/logic_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/logic_tests/test_content.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import numpy 4 | 5 | from dpnp.tests.third_party.cupy import testing 6 | 7 | 8 | class TestContent(unittest.TestCase): 9 | 10 | @testing.for_dtypes("efFdD") 11 | @testing.numpy_cupy_array_equal() 12 | def check_unary_inf(self, name, xp, dtype): 13 | a = xp.array([-3, numpy.inf, -1, -numpy.inf, 0, 1, 2], dtype=dtype) 14 | return getattr(xp, name)(a) 15 | 16 | @testing.for_dtypes("efFdD") 17 | @testing.numpy_cupy_array_equal() 18 | def check_unary_nan(self, name, xp, dtype): 19 | a = xp.array( 20 | [-3, numpy.nan, -1, numpy.nan, 0, numpy.nan, numpy.inf], dtype=dtype 21 | ) 22 | return getattr(xp, name)(a) 23 | 24 | def test_isfinite(self): 25 | self.check_unary_inf("isfinite") 26 | 27 | def test_isinf(self): 28 | self.check_unary_inf("isinf") 29 | 30 | def test_isnan(self): 31 | self.check_unary_nan("isnan") 32 | 33 | 34 | class TestUfuncLike(unittest.TestCase): 35 | 36 | @testing.numpy_cupy_array_equal() 37 | def check_unary(self, name, xp): 38 | a = xp.array([-3, xp.inf, -1, -xp.inf, 0, 1, 2, xp.nan]) 39 | return getattr(xp, name)(a) 40 | 41 | def test_isneginf(self): 42 | self.check_unary("isneginf") 43 | 44 | def test_isposinf(self): 45 | self.check_unary("isposinf") 46 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/logic_tests/test_ops.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from dpnp.tests.third_party.cupy import testing 4 | 5 | 6 | class TestOps(unittest.TestCase): 7 | 8 | @testing.for_all_dtypes(no_complex=True) 9 | @testing.numpy_cupy_allclose(atol=1e-5) 10 | def check_unary(self, name, xp, dtype): 11 | a = testing.shaped_arange((2, 3), xp, dtype) 12 | return getattr(xp, name)(a) 13 | 14 | @testing.for_all_dtypes(no_complex=True) 15 | @testing.numpy_cupy_allclose(atol=1e-5) 16 | def check_binary(self, name, xp, dtype): 17 | a = testing.shaped_arange((2, 3), xp, dtype) 18 | b = testing.shaped_reverse_arange((2, 3), xp, dtype) 19 | return getattr(xp, name)(a, b) 20 | 21 | def test_logical_and(self): 22 | self.check_binary("logical_and") 23 | 24 | def test_logical_or(self): 25 | self.check_binary("logical_or") 26 | 27 | def test_logical_xor(self): 28 | self.check_binary("logical_xor") 29 | 30 | def test_logical_not(self): 31 | self.check_unary("logical_not") 32 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/manipulation_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/manipulation_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/math_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/math_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from dpnp.tests.helper import has_support_aspect64 4 | from dpnp.tests.third_party.cupy import testing 5 | 6 | 7 | class TestHyperbolic(unittest.TestCase): 8 | 9 | @testing.for_all_dtypes() 10 | @testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64()) 11 | def check_unary(self, name, xp, dtype): 12 | a = testing.shaped_arange((2, 3), xp, dtype) 13 | return getattr(xp, name)(a) 14 | 15 | @testing.for_dtypes(["e", "f", "d"]) 16 | @testing.numpy_cupy_allclose(atol=1e-5) 17 | def check_unary_unit(self, name, xp, dtype): 18 | a = xp.array([0.2, 0.4, 0.6, 0.8], dtype=dtype) 19 | return getattr(xp, name)(a) 20 | 21 | def test_sinh(self): 22 | self.check_unary("sinh") 23 | 24 | def test_cosh(self): 25 | self.check_unary("cosh") 26 | 27 | def test_tanh(self): 28 | self.check_unary("tanh") 29 | 30 | def test_arcsinh(self): 31 | self.check_unary("arcsinh") 32 | 33 | @testing.for_dtypes(["e", "f", "d"]) 34 | @testing.numpy_cupy_allclose(atol=1e-5) 35 | def test_arccosh(self, xp, dtype): 36 | a = xp.array([1, 2, 3], dtype=dtype) 37 | return xp.arccosh(a) 38 | 39 | def test_arctanh(self): 40 | self.check_unary_unit("arctanh") 41 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/math_tests/test_special.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import dpnp as cupy 4 | from dpnp.tests.third_party.cupy import testing 5 | 6 | 7 | class TestSpecial(unittest.TestCase): 8 | 9 | @testing.for_dtypes(["e", "f", "d"]) 10 | @testing.numpy_cupy_allclose(rtol=1e-3) 11 | def test_i0(self, xp, dtype): 12 | a = testing.shaped_random((2, 3), xp, dtype) 13 | return xp.i0(a) 14 | 15 | @testing.with_requires("numpy>=2.0") 16 | @testing.for_dtypes(["e", "f", "d", "F", "D"]) 17 | @testing.numpy_cupy_allclose(atol=1e-3) 18 | def test_sinc(self, xp, dtype): 19 | a = testing.shaped_random((2, 3), xp, dtype, scale=1) 20 | return xp.sinc(a) 21 | 22 | @testing.for_dtypes(["e", "f", "d", "F", "D"]) 23 | def test_sinc_zero(self, dtype): 24 | a = cupy.sinc(cupy.zeros(1, dtype=dtype)) 25 | testing.assert_array_equal(a, cupy.ones(1, dtype=dtype)) 26 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/math_tests/test_window.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pytest 4 | 5 | from dpnp.tests.helper import has_support_aspect64 6 | from dpnp.tests.third_party.cupy import testing 7 | 8 | 9 | @testing.parameterize( 10 | *testing.product( 11 | { 12 | "m": [0, 1, -1, 1024], 13 | "name": ["bartlett", "blackman", "hamming", "hanning"], 14 | } 15 | ) 16 | ) 17 | class TestWindow(unittest.TestCase): 18 | 19 | @testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64()) 20 | def test_window(self, xp): 21 | return getattr(xp, self.name)(self.m) 22 | 23 | 24 | @testing.parameterize( 25 | *testing.product( 26 | { 27 | "m": [10, 30, 1024], 28 | "beta": [-3.4, 0, 5, 6, 8.6], 29 | "name": ["kaiser"], 30 | } 31 | ) 32 | ) 33 | class TestKaiser(unittest.TestCase): 34 | 35 | @testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64()) 36 | def test_kaiser_parametric(self, xp): 37 | return getattr(xp, self.name)(self.m, self.beta) 38 | 39 | 40 | @testing.parameterize(*testing.product({"m": [-1, 0, 1]})) 41 | class TestKaiserBoundary(unittest.TestCase): 42 | 43 | @testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64()) 44 | def test_kaiser(self, xp): 45 | return xp.kaiser(self.m, 1.5) 46 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/misc_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/misc_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/padding_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/padding_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/random_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/random_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/random_tests/test_init.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import dpnp as cupy 4 | 5 | 6 | @pytest.mark.usefixtures("allow_fall_back_on_numpy") 7 | def test_bytes(): 8 | out = cupy.random.bytes(10) 9 | assert isinstance(out, bytes) 10 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/random_tests/test_random.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | import pytest 4 | 5 | from dpnp import random 6 | from dpnp.tests.third_party.cupy import testing 7 | 8 | 9 | @pytest.mark.skip("random.get_random_state() is not supported yet") 10 | class TestResetSeed(unittest.TestCase): 11 | 12 | @testing.for_float_dtypes(no_float16=True) 13 | def test_reset_seed(self, dtype): 14 | rs = random.get_random_state() 15 | rs.seed(0) 16 | l1 = rs.rand(10, dtype=dtype) 17 | 18 | rs = random.get_random_state() 19 | rs.seed(0) 20 | l2 = rs.rand(10, dtype=dtype) 21 | 22 | testing.assert_array_equal(l1, l2) 23 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/sorting_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/sorting_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/statistics_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/dpnp/tests/third_party/cupy/statistics_tests/__init__.py -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/test_typing.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import dpnp as cupy 4 | 5 | 6 | @pytest.mark.skip("dpnp.typing is not implemented yet") 7 | class TestClassGetItem: 8 | 9 | def test_class_getitem(self): 10 | from typing import Any 11 | 12 | cupy.ndarray[Any, Any] 13 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/testing/_attr.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from dpnp.tests.third_party.cupy.testing._pytest_impl import ( 4 | check_available, 5 | is_available, 6 | ) 7 | 8 | if is_available(): 9 | import pytest 10 | 11 | _gpu_limit = int(os.getenv("CUPY_TEST_GPU_LIMIT", "-1")) 12 | 13 | def slow(*args, **kwargs): 14 | return pytest.mark.slow(*args, **kwargs) 15 | 16 | else: 17 | 18 | def _dummy_callable(*args, **kwargs): 19 | check_available("pytest attributes") 20 | assert False # Not reachable 21 | 22 | slow = _dummy_callable 23 | 24 | 25 | def multi_gpu(gpu_num): 26 | """Decorator to indicate number of GPUs required to run the test. 27 | 28 | Tests can be annotated with this decorator (e.g., ``@multi_gpu(2)``) to 29 | declare number of GPUs required to run. When running tests, if 30 | ``CUPY_TEST_GPU_LIMIT`` environment variable is set to value greater 31 | than or equals to 0, test cases that require GPUs more than the limit will 32 | be skipped. 33 | """ 34 | 35 | check_available("multi_gpu attribute") 36 | # at this point we know pytest is available for sure 37 | 38 | assert 1 < gpu_num 39 | 40 | def _wrapper(f): 41 | return pytest.mark.skipif( 42 | 0 <= _gpu_limit < gpu_num, reason="{} GPUs required".format(gpu_num) 43 | )(pytest.mark.multi_gpu(f)) 44 | 45 | return _wrapper 46 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/cupy/testing/_bundle.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | import sys 3 | 4 | 5 | def make_decorator(test_case_generator): 6 | # `test_case_generator` is a callable that receives the source test class 7 | # (typically a subclass of unittest.TestCase) and returns an iterable of 8 | # generated test cases. 9 | # Each element of the iterable is a 3-element tuple: 10 | # [0] Generated class name 11 | # [1] Dict of members 12 | # [2] Method generator 13 | # The method generator is also a callable that receives an original test 14 | # method and returns a new test method. 15 | 16 | def f(cls): 17 | # The input is a bare test case 18 | module_name = cls.__module__ 19 | 20 | # Generate parameterized test cases out of the input test case. 21 | module = sys.modules[module_name] 22 | assert module.__name__ == module_name 23 | for cls_name, members, method_generator in test_case_generator(cls): 24 | _generate_case(cls, module, cls_name, members, method_generator) 25 | 26 | # Remove original base class 27 | return None 28 | 29 | return f 30 | 31 | 32 | def _generate_case(base, module, cls_name, mb, method_generator): 33 | members = mb.copy() 34 | base_methods = inspect.getmembers(base, predicate=inspect.isfunction) 35 | for name, value in base_methods: 36 | if not name.startswith("test_"): 37 | continue 38 | value = method_generator(value) 39 | # If the return value of method_generator is None, None is assigned 40 | # as the value of the test method and it is ignored by pytest. 41 | members[name] = value 42 | 43 | cls = type(cls_name, (base,), members) 44 | 45 | # Add new test class to module 46 | cls.__module__ = module.__name__ 47 | setattr(module, cls_name, cls) 48 | -------------------------------------------------------------------------------- /dpnp/tests/third_party/intel/test_zero_copy_test1.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | import sys 3 | 4 | import pytest 5 | 6 | 7 | class dummymodule: 8 | pass 9 | 10 | 11 | sys.modules["numba_dppy"] = dummymodule 12 | 13 | module_not_found = False 14 | 15 | reason = "" 16 | 17 | try: 18 | zero_copy_test1 = importlib.import_module("zero-copy-test1") 19 | except ModuleNotFoundError as e: 20 | module_not_found = True 21 | reason = str(e) 22 | 23 | 24 | @pytest.mark.skipif(module_not_found, reason=reason) 25 | def test_dpnp_interaction_with_dpctl_memory(): 26 | return zero_copy_test1.test_dpnp_interaction_with_dpctl_memory() 27 | 28 | 29 | @pytest.mark.skipif(module_not_found, reason=reason) 30 | def test_dpnp_array_has_iface(): 31 | return zero_copy_test1.test_dpnp_array_has_iface() 32 | 33 | 34 | @pytest.mark.skipif(module_not_found, reason=reason) 35 | def test_dpctl_dparray_has_iface(): 36 | return zero_copy_test1.test_dpctl_dparray_has_iface() 37 | -------------------------------------------------------------------------------- /dpnp/to_numba/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # ***************************************************************************** 3 | # Copyright (c) 2016-2025, Intel Corporation 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # - Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # - Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | # THE POSSIBILITY OF SUCH DAMAGE. 25 | # ***************************************************************************** 26 | 27 | from dpnp.to_numba.dpnp_iface_to_numba import * 28 | -------------------------------------------------------------------------------- /environments/base_build_docs.txt: -------------------------------------------------------------------------------- 1 | pyenchant==3.2.2 2 | sphinxcontrib-googleanalytics==0.4 3 | sphinxcontrib-spelling==8.0.1 4 | -------------------------------------------------------------------------------- /environments/build_conda_pkg.yml: -------------------------------------------------------------------------------- 1 | name: Build DPNP conda package 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.13 6 | - conda-build=25.5.0 7 | -------------------------------------------------------------------------------- /environments/build_with_oneapi.yml: -------------------------------------------------------------------------------- 1 | name: Packages to build DPNP with OneAPI env activated 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - cmake 6 | - cython 7 | - ninja 8 | - numpy 9 | - pytest 10 | - setuptools 11 | - scikit-build 12 | - versioneer 13 | -------------------------------------------------------------------------------- /environments/building_docs.yml: -------------------------------------------------------------------------------- 1 | name: Building docs specific packages 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.12 6 | - cupy 7 | - sphinx 8 | - sphinx_rtd_theme 9 | - pip: 10 | - -r base_build_docs.txt 11 | -------------------------------------------------------------------------------- /environments/coverage.txt: -------------------------------------------------------------------------------- 1 | coveralls==4.0.1 2 | -------------------------------------------------------------------------------- /environments/coverage.yml: -------------------------------------------------------------------------------- 1 | name: Coverage specific packages 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.12 6 | - coverage[toml] 7 | - llvm 8 | - pytest-cov 9 | - pip: 10 | - -r coverage.txt 11 | -------------------------------------------------------------------------------- /environments/create_conda_channel.yml: -------------------------------------------------------------------------------- 1 | name: Create conda channel with DPNP package 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.12 # DPNP does not support python 3.13 6 | - conda-index=0.6.1 7 | -------------------------------------------------------------------------------- /environments/dpctl_pkg.txt: -------------------------------------------------------------------------------- 1 | --index-url https://pypi.anaconda.org/dppy/label/dev/simple 2 | dpctl>=0.20.0dev0 3 | -------------------------------------------------------------------------------- /environments/dpctl_pkg.yml: -------------------------------------------------------------------------------- 1 | name: Install dpctl package 2 | channels: 3 | - dppy/label/dev 4 | dependencies: 5 | - dpctl>=0.20.0dev0 6 | -------------------------------------------------------------------------------- /environments/oneapi_pkgs.yml: -------------------------------------------------------------------------------- 1 | name: OneAPI packages to build DPNP without OneAPI env activated 2 | channels: 3 | - https://software.repos.intel.com/python/conda/ 4 | dependencies: 5 | - dpcpp_linux-64 6 | - mkl-devel-dpcpp 7 | - onedpl-devel 8 | - tbb-devel 9 | -------------------------------------------------------------------------------- /environments/upload_cleanup_conda_pkg.yml: -------------------------------------------------------------------------------- 1 | name: Upload or clean up a conda package 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.13 6 | - anaconda-client=1.13.0 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | max_line_length = 120 3 | ignore = E201 4 | -------------------------------------------------------------------------------- /tests_external/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/tests_external/__init__.py -------------------------------------------------------------------------------- /tests_external/numpy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IntelPython/dpnp/662148d5879f53f0397d31b658e4c3ccfa473444/tests_external/numpy/__init__.py --------------------------------------------------------------------------------