From 54dc4541ad1f61cb856e642627c5ebec590474fd Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 12 May 2025 16:40:31 +0200 Subject: [PATCH 1/4] Disabling line tracing in dpnp/dpnp_utils/dpnp_algo_utils.pyx --- dpnp/dpnp_utils/dpnp_algo_utils.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpnp/dpnp_utils/dpnp_algo_utils.pyx b/dpnp/dpnp_utils/dpnp_algo_utils.pyx index 60ab5aa16c1..c41b39f08ed 100644 --- a/dpnp/dpnp_utils/dpnp_algo_utils.pyx +++ b/dpnp/dpnp_utils/dpnp_algo_utils.pyx @@ -1,5 +1,5 @@ # cython: language_level=3 -# cython: linetrace=True +# cython: linetrace=False # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2025, Intel Corporation From 99b61c0d9bf439a0356d38e8f0718eeebbafd9c9 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 12 May 2025 16:41:58 +0200 Subject: [PATCH 2/4] Remove limitation on cython version --- conda-recipe/meta.yaml | 2 +- environments/build_with_oneapi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index dc22ac24815..d7d647c7a19 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -13,7 +13,7 @@ requirements: - python - setuptools - numpy >=1.23 - - cython <3.1 + - cython - cmake >=3.21 - ninja - git diff --git a/environments/build_with_oneapi.yml b/environments/build_with_oneapi.yml index ba9f878235e..443b7a5202c 100644 --- a/environments/build_with_oneapi.yml +++ b/environments/build_with_oneapi.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - cmake - - cython <3.1 + - cython - ninja - numpy - pytest From 6460aad0576c429eae7f71565ddd4ea83f405677 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Mon, 12 May 2025 17:53:43 +0200 Subject: [PATCH 3/4] Disable line tracing per function --- dpnp/dpnp_utils/dpnp_algo_utils.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dpnp/dpnp_utils/dpnp_algo_utils.pyx b/dpnp/dpnp_utils/dpnp_algo_utils.pyx index c41b39f08ed..cc8acf06844 100644 --- a/dpnp/dpnp_utils/dpnp_algo_utils.pyx +++ b/dpnp/dpnp_utils/dpnp_algo_utils.pyx @@ -1,5 +1,5 @@ # cython: language_level=3 -# cython: linetrace=False +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2025, Intel Corporation @@ -449,6 +449,7 @@ cdef tuple get_common_usm_allocation(dpnp_descriptor x1, dpnp_descriptor x2): return (common_sycl_queue.sycl_device, common_usm_type, common_sycl_queue) +@cython.linetrace(False) cdef (DPNPFuncType, void *) get_ret_type_and_func(DPNPFuncData kernel_data, cpp_bool has_aspect_fp64): """ From fca3c91ad70dce2ac80e4534bb71144dd4baa75f Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 13 May 2025 11:46:18 +0200 Subject: [PATCH 4/4] Import only used function from cython built extension to keep coverage consistent --- dpnp/dpnp_algo/dpnp_arraycreation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dpnp/dpnp_algo/dpnp_arraycreation.py b/dpnp/dpnp_algo/dpnp_arraycreation.py index b327c340a0f..138e1778bef 100644 --- a/dpnp/dpnp_algo/dpnp_arraycreation.py +++ b/dpnp/dpnp_algo/dpnp_arraycreation.py @@ -32,8 +32,8 @@ import numpy import dpnp -import dpnp.dpnp_utils as utils from dpnp.dpnp_array import dpnp_array +from dpnp.dpnp_utils import get_usm_allocations, map_dtype_to_device __all__ = [ "dpnp_geomspace", @@ -60,7 +60,7 @@ def dpnp_geomspace( endpoint=True, axis=0, ): - usm_type_alloc, sycl_queue_alloc = utils.get_usm_allocations([start, stop]) + usm_type_alloc, sycl_queue_alloc = get_usm_allocations([start, stop]) if sycl_queue is None and device is None: sycl_queue = sycl_queue_alloc @@ -77,7 +77,7 @@ def dpnp_geomspace( stop = _as_usm_ndarray(stop, _usm_type, sycl_queue_normalized) dt = numpy.result_type(start, stop, float(num)) - dt = utils.map_dtype_to_device(dt, sycl_queue_normalized.sycl_device) + dt = map_dtype_to_device(dt, sycl_queue_normalized.sycl_device) if dtype is None: dtype = dt @@ -144,7 +144,7 @@ def dpnp_linspace( retstep=False, axis=0, ): - usm_type_alloc, sycl_queue_alloc = utils.get_usm_allocations([start, stop]) + usm_type_alloc, sycl_queue_alloc = get_usm_allocations([start, stop]) if sycl_queue is None and device is None: sycl_queue = sycl_queue_alloc @@ -164,7 +164,7 @@ def dpnp_linspace( stop = _as_usm_ndarray(stop, _usm_type, sycl_queue_normalized) dt = numpy.result_type(start, stop, float(num)) - dt = utils.map_dtype_to_device(dt, sycl_queue_normalized.sycl_device) + dt = map_dtype_to_device(dt, sycl_queue_normalized.sycl_device) if dtype is None: dtype = dt @@ -251,7 +251,7 @@ def dpnp_logspace( axis=0, ): if not dpnp.isscalar(base): - usm_type_alloc, sycl_queue_alloc = utils.get_usm_allocations( + usm_type_alloc, sycl_queue_alloc = get_usm_allocations( [start, stop, base] )