From 8e45a67e6f551fd184096f1e7a01087b2e24f274 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Tue, 4 Apr 2023 20:34:45 +0200 Subject: [PATCH] Enable profiling for .pxi and .pyx files --- dpnp/dparray.pyx | 1 + dpnp/dpnp_algo/dpnp_algo.pyx | 1 + dpnp/dpnp_algo/dpnp_algo_arraycreation.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_bitwise.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_counting.pxi | 3 ++- dpnp/dpnp_algo/dpnp_algo_indexing.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_logic.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_manipulation.pxi | 3 ++- dpnp/dpnp_algo/dpnp_algo_mathematical.pxi | 3 ++- dpnp/dpnp_algo/dpnp_algo_searching.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_sorting.pxi | 3 ++- dpnp/dpnp_algo/dpnp_algo_special.pxi | 3 ++- dpnp/dpnp_algo/dpnp_algo_statistics.pxi | 1 + dpnp/dpnp_algo/dpnp_algo_trigonometric.pxi | 3 ++- dpnp/dpnp_utils/dpnp_algo_utils.pyx | 3 ++- dpnp/fft/dpnp_algo_fft.pyx | 3 ++- dpnp/linalg/dpnp_algo_linalg.pyx | 3 ++- dpnp/random/dpnp_algo_random.pyx | 11 ++++++----- 19 files changed, 33 insertions(+), 14 deletions(-) diff --git a/dpnp/dparray.pyx b/dpnp/dparray.pyx index dffbf6f65d1..0cf94759a6c 100644 --- a/dpnp/dparray.pyx +++ b/dpnp/dparray.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo.pyx b/dpnp/dpnp_algo/dpnp_algo.pyx index 9befd6d20d6..3174b5cbb3f 100644 --- a/dpnp/dpnp_algo/dpnp_algo.pyx +++ b/dpnp/dpnp_algo/dpnp_algo.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_arraycreation.pxi b/dpnp/dpnp_algo/dpnp_algo_arraycreation.pxi index 7b538118b93..3525a42ca0d 100644 --- a/dpnp/dpnp_algo/dpnp_algo_arraycreation.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_arraycreation.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_bitwise.pxi b/dpnp/dpnp_algo/dpnp_algo_bitwise.pxi index a8af53b709d..6c630f791ad 100644 --- a/dpnp/dpnp_algo/dpnp_algo_bitwise.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_bitwise.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_counting.pxi b/dpnp/dpnp_algo/dpnp_algo_counting.pxi index 119c0d27b69..ef32d3ed362 100644 --- a/dpnp/dpnp_algo/dpnp_algo_counting.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_counting.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_algo/dpnp_algo_indexing.pxi b/dpnp/dpnp_algo/dpnp_algo_indexing.pxi index 1759d6f782b..e9dc538393c 100644 --- a/dpnp/dpnp_algo/dpnp_algo_indexing.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_indexing.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi b/dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi index 91c1da88405..f9eac4ffd35 100644 --- a/dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_logic.pxi b/dpnp/dpnp_algo/dpnp_algo_logic.pxi index b6ac36db412..f84e90b186f 100644 --- a/dpnp/dpnp_algo/dpnp_algo_logic.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_logic.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_manipulation.pxi b/dpnp/dpnp_algo/dpnp_algo_manipulation.pxi index 0a51b44e7e5..3e27af363c3 100644 --- a/dpnp/dpnp_algo/dpnp_algo_manipulation.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_manipulation.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_algo/dpnp_algo_mathematical.pxi b/dpnp/dpnp_algo/dpnp_algo_mathematical.pxi index 5d937a7008b..18285b1ec10 100644 --- a/dpnp/dpnp_algo/dpnp_algo_mathematical.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_mathematical.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_algo/dpnp_algo_searching.pxi b/dpnp/dpnp_algo/dpnp_algo_searching.pxi index 44621b5cca0..07c7dec5f65 100644 --- a/dpnp/dpnp_algo/dpnp_algo_searching.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_searching.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_sorting.pxi b/dpnp/dpnp_algo/dpnp_algo_sorting.pxi index 9a701dd7c90..4d8b475cce4 100644 --- a/dpnp/dpnp_algo/dpnp_algo_sorting.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_sorting.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_algo/dpnp_algo_special.pxi b/dpnp/dpnp_algo/dpnp_algo_special.pxi index fb6ff0d74cc..17974261384 100644 --- a/dpnp/dpnp_algo/dpnp_algo_special.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_special.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_algo/dpnp_algo_statistics.pxi b/dpnp/dpnp_algo/dpnp_algo_statistics.pxi index 5d21dcf8c74..6131d292bf9 100644 --- a/dpnp/dpnp_algo/dpnp_algo_statistics.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_statistics.pxi @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation diff --git a/dpnp/dpnp_algo/dpnp_algo_trigonometric.pxi b/dpnp/dpnp_algo/dpnp_algo_trigonometric.pxi index bf9c4d5e0ed..364e2dca7fb 100644 --- a/dpnp/dpnp_algo/dpnp_algo_trigonometric.pxi +++ b/dpnp/dpnp_algo/dpnp_algo_trigonometric.pxi @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2020, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/dpnp_utils/dpnp_algo_utils.pyx b/dpnp/dpnp_utils/dpnp_algo_utils.pyx index a9438178876..e741a353771 100644 --- a/dpnp/dpnp_utils/dpnp_algo_utils.pyx +++ b/dpnp/dpnp_utils/dpnp_algo_utils.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation @@ -257,7 +258,7 @@ def get_usm_allocations(objects): if not isinstance(objects, (list, tuple)): raise TypeError("Expected a list or a tuple, got {}".format(type(objects))) - + if len(objects) == 0: return (None, None) return (_get_coerced_usm_type(objects), _get_common_allocation_queue(objects)) diff --git a/dpnp/fft/dpnp_algo_fft.pyx b/dpnp/fft/dpnp_algo_fft.pyx index 393c744d4f3..7f8d1161074 100644 --- a/dpnp/fft/dpnp_algo_fft.pyx +++ b/dpnp/fft/dpnp_algo_fft.pyx @@ -1,7 +1,8 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** -# Copyright (c) 2016-2022, Intel Corporation +# Copyright (c) 2016-2023, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/dpnp/linalg/dpnp_algo_linalg.pyx b/dpnp/linalg/dpnp_algo_linalg.pyx index ddcaf677499..232a70cafb3 100644 --- a/dpnp/linalg/dpnp_algo_linalg.pyx +++ b/dpnp/linalg/dpnp_algo_linalg.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation @@ -87,7 +88,7 @@ cpdef utils.dpnp_descriptor dpnp_cholesky(utils.dpnp_descriptor input_): # ceate result array with type given by FPTR data cdef utils.dpnp_descriptor result = utils.create_output_descriptor(input_.shape, - kernel_data.return_type, + kernel_data.return_type, None, device=input_obj.sycl_device, usm_type=input_obj.usm_type, diff --git a/dpnp/random/dpnp_algo_random.pyx b/dpnp/random/dpnp_algo_random.pyx index 314906cee6d..504e365405b 100644 --- a/dpnp/random/dpnp_algo_random.pyx +++ b/dpnp/random/dpnp_algo_random.pyx @@ -1,4 +1,5 @@ # cython: language_level=3 +# cython: linetrace=True # -*- coding: utf-8 -*- # ***************************************************************************** # Copyright (c) 2016-2023, Intel Corporation @@ -143,7 +144,7 @@ ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_dpnp_rng_laplace_c_1out_t)(c_dpctl.DPCT const double, const size_t, const c_dpctl.DPCTLEventVectorRef) except + -ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_dpnp_rng_logistic_c_1out_t)(c_dpctl.DPCTLSyclQueueRef, void * , +ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_dpnp_rng_logistic_c_1out_t)(c_dpctl.DPCTLSyclQueueRef, void * , const double, const double, const size_t, @@ -514,7 +515,7 @@ cpdef utils.dpnp_descriptor dpnp_rng_binomial(int ntrial, double p, size): with nogil: c_dpctl.DPCTLEvent_WaitAndThrow(event_ref) c_dpctl.DPCTLEvent_Delete(event_ref) - + return result @@ -831,7 +832,7 @@ cpdef utils.dpnp_descriptor dpnp_rng_logistic(double loc, double scale, size): cdef fptr_dpnp_rng_logistic_c_1out_t func = < fptr_dpnp_rng_logistic_c_1out_t > kernel_data.ptr # call FPTR function cdef c_dpctl.DPCTLSyclEventRef event_ref = func(q_ref, result.get_data(), loc, scale, result.size, NULL) - + with nogil: c_dpctl.DPCTLEvent_WaitAndThrow(event_ref) c_dpctl.DPCTLEvent_Delete(event_ref) @@ -1015,7 +1016,7 @@ cpdef utils.dpnp_descriptor dpnp_rng_negative_binomial(double a, double p, size) func = kernel_data.ptr # call FPTR function event_ref = func(q_ref, result.get_data(), a, p, result.size, NULL) - + with nogil: c_dpctl.DPCTLEvent_WaitAndThrow(event_ref) c_dpctl.DPCTLEvent_Delete(event_ref) @@ -1204,7 +1205,7 @@ cpdef utils.dpnp_descriptor dpnp_rng_rayleigh(double scale, size): q = result_sycl_queue q_ref = q.get_queue_ref() - + func = kernel_data.ptr # call FPTR function event_ref = func(q_ref, result.get_data(), scale, result.size, NULL)