Skip to content

Remove unused enums with function names #1758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions dpnp/backend/include/dpnp_iface_fptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@
*/
enum class DPNPFuncName : size_t
{
DPNP_FN_NONE, /**< Very first element of the enumeration */
DPNP_FN_ABSOLUTE, /**< Used in numpy.absolute() impl */
DPNP_FN_ADD, /**< Used in numpy.add() impl */
DPNP_FN_ADD_EXT, /**< Used in numpy.add() impl, requires extra parameters */
DPNP_FN_ALL, /**< Used in numpy.all() impl */
DPNP_FN_NONE, /**< Very first element of the enumeration */
DPNP_FN_ABSOLUTE, /**< Used in numpy.absolute() impl */
DPNP_FN_ADD, /**< Used in numpy.add() impl */
DPNP_FN_ALL, /**< Used in numpy.all() impl */
DPNP_FN_ALLCLOSE, /**< Used in numpy.allclose() impl */
DPNP_FN_ALLCLOSE_EXT, /**< Used in numpy.allclose() impl, requires extra
parameters */
Expand Down Expand Up @@ -123,8 +122,6 @@ enum class DPNPFuncName : size_t
DPNP_FN_DIAGONAL_EXT, /**< Used in numpy.diagonal() impl, requires extra
parameters */
DPNP_FN_DIVIDE, /**< Used in numpy.divide() impl */
DPNP_FN_DIVIDE_EXT, /**< Used in numpy.divide() impl, requires extra
parameters */
DPNP_FN_DOT, /**< Used in numpy.dot() impl */
DPNP_FN_DOT_EXT, /**< Used in numpy.dot() impl, requires extra parameters */
DPNP_FN_EDIFF1D, /**< Used in numpy.ediff1d() impl */
Expand Down Expand Up @@ -158,8 +155,6 @@ enum class DPNPFuncName : size_t
DPNP_FN_FLATTEN, /**< Used in numpy.flatten() impl */
DPNP_FN_FLOOR, /**< Used in numpy.floor() impl */
DPNP_FN_FLOOR_DIVIDE, /**< Used in numpy.floor_divide() impl */
DPNP_FN_FLOOR_DIVIDE_EXT, /**< Used in numpy.floor_divide() impl, requires
extra parameters */
DPNP_FN_FMOD, /**< Used in numpy.fmod() impl */
DPNP_FN_FMOD_EXT, /**< Used in numpy.fmod() impl, requires extra parameters
*/
Expand Down Expand Up @@ -194,17 +189,15 @@ enum class DPNPFuncName : size_t
DPNP_FN_MINIMUM_EXT, /**< Used in numpy.fmax() impl, requires extra
parameters */
DPNP_FN_MODF, /**< Used in numpy.modf() impl */
DPNP_FN_MODF_EXT, /**< Used in numpy.modf() impl, requires extra parameters
*/
DPNP_FN_MULTIPLY, /**< Used in numpy.multiply() impl */
DPNP_FN_MULTIPLY_EXT, /**< Used in numpy.multiply() impl, requires extra
parameters */
DPNP_FN_NANVAR, /**< Used in numpy.nanvar() impl */
DPNP_FN_NEGATIVE, /**< Used in numpy.negative() impl */
DPNP_FN_NONZERO, /**< Used in numpy.nonzero() impl */
DPNP_FN_ONES, /**< Used in numpy.ones() impl */
DPNP_FN_ONES_LIKE, /**< Used in numpy.ones_like() impl */
DPNP_FN_PARTITION, /**< Used in numpy.partition() impl */
DPNP_FN_MODF_EXT, /**< Used in numpy.modf() impl, requires extra parameters
*/
DPNP_FN_MULTIPLY, /**< Used in numpy.multiply() impl */
DPNP_FN_NANVAR, /**< Used in numpy.nanvar() impl */
DPNP_FN_NEGATIVE, /**< Used in numpy.negative() impl */
DPNP_FN_NONZERO, /**< Used in numpy.nonzero() impl */
DPNP_FN_ONES, /**< Used in numpy.ones() impl */
DPNP_FN_ONES_LIKE, /**< Used in numpy.ones_like() impl */
DPNP_FN_PARTITION, /**< Used in numpy.partition() impl */
DPNP_FN_PARTITION_EXT, /**< Used in numpy.partition() impl, requires extra
parameters */
DPNP_FN_PLACE, /**< Used in numpy.place() impl */
Expand Down
28 changes: 1 addition & 27 deletions dpnp/backend/kernels/dpnp_krnl_elemwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1397,33 +1397,7 @@ static constexpr DPNPFuncType get_divide_res_type()
template <DPNPFuncType FT1, DPNPFuncType... FTs>
static void func_map_elemwise_2arg_3type_core(func_map_t &fmap)
{
((fmap[DPNPFuncName::DPNP_FN_ADD_EXT][FT1][FTs] =
{populate_func_types<FT1, FTs>(),
(void *)dpnp_add_c_ext<
func_type_map_t::find_type<populate_func_types<FT1, FTs>()>,
func_type_map_t::find_type<FT1>,
func_type_map_t::find_type<FTs>>}),
...);
((fmap[DPNPFuncName::DPNP_FN_DIVIDE_EXT][FT1][FTs] =
{get_divide_res_type<FT1, FTs>(),
(void *)dpnp_divide_c_ext<
func_type_map_t::find_type<get_divide_res_type<FT1, FTs>()>,
func_type_map_t::find_type<FT1>,
func_type_map_t::find_type<FTs>>,
get_divide_res_type<FT1, FTs, std::false_type>(),
(void *)
dpnp_divide_c_ext<func_type_map_t::find_type<get_divide_res_type<
FT1, FTs, std::false_type>()>,
func_type_map_t::find_type<FT1>,
func_type_map_t::find_type<FTs>>}),
...);
((fmap[DPNPFuncName::DPNP_FN_MULTIPLY_EXT][FT1][FTs] =
{populate_func_types<FT1, FTs>(),
(void *)dpnp_multiply_c_ext<
func_type_map_t::find_type<populate_func_types<FT1, FTs>()>,
func_type_map_t::find_type<FT1>,
func_type_map_t::find_type<FTs>>}),
...);
// dpnp_subtract_c_ext is implicitly used by dpnp_ptp_c
((fmap[DPNPFuncName::DPNP_FN_SUBTRACT_EXT][FT1][FTs] =
{populate_func_types<FT1, FTs>(),
(void *)dpnp_subtract_c_ext<
Expand Down
79 changes: 0 additions & 79 deletions dpnp/dpnp_algo/dpnp_algo.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -33,145 +33,70 @@ from dpnp.dpnp_utils.dpnp_algo_utils cimport dpnp_descriptor

cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this namespace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NG_STANDARD_CAUCHY
DPNP_FN_RNG_STANDARD_CAUCHY_EXT
DPNP_FN_RNG_STANDARD_EXPONENTIAL
DPNP_FN_RNG_STANDARD_EXPONENTIAL_EXT
DPNP_FN_RNG_STANDARD_GAMMA
DPNP_FN_RNG_STANDARD_GAMMA_EXT
DPNP_FN_RNG_STANDARD_NORMAL
DPNP_FN_RNG_STANDARD_T
DPNP_FN_RNG_STANDARD_T_EXT
DPNP_FN_RNG_TRIANGULAR
DPNP_FN_RNG_TRIANGULAR_EXT
DPNP_FN_RNG_UNIFORM
DPNP_FN_RNG_UNIFORM_EXT
DPNP_FN_RNG_VONMISES
DPNP_FN_RNG_VONMISES_EXT
DPNP_FN_RNG_WALD
DPNP_FN_RNG_WALD_EXT
DPNP_FN_RNG_WEIBULL
DPNP_FN_RNG_WEIBULL_EXT
DPNP_FN_RNG_ZIPF
DPNP_FN_RNG_ZIPF_EXT
DPNP_FN_SEARCHSORTED
DPNP_FN_SEARCHSORTED_EXT
DPNP_FN_TRACE
DPNP_FN_TRACE_EXT
DPNP_FN_TRANSPOSE
DPNP_FN_TRAPZ
DPNP_FN_TRAPZ_EXT
DPNP_FN_TRIL
DPNP_FN_TRIL_EXT
DPNP_FN_TRIU
DPNP_FN_TRIU_EXT
DPNP_FN_ZEROS
DPNP_FN_ZEROS_LIKE

cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncType": # need this namespace for Enum import
cdef enum DPNPFuncType "DPNPFuncType":
Expand Down Expand Up @@ -206,9 +131,6 @@ cdef extern from "dpnp_iface.hpp":


# C function pointer to the C library template functions
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_1out_t)(c_dpctl.DPCTLSyclQueueRef,
void * , size_t,
const c_dpctl.DPCTLEventVectorRef) except +
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_1in_1out_t)(c_dpctl.DPCTLSyclQueueRef,
void *, void * , size_t,
const c_dpctl.DPCTLEventVectorRef)
Expand Down Expand Up @@ -248,7 +170,6 @@ ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_2in_1out_strides_t)(c_dpctl.DPCTLSyclQu
const shape_elem_type * ,
const long * ,
const c_dpctl.DPCTLEventVectorRef) except +
ctypedef void(*fptr_blas_gemm_2in_1out_t)(void *, void * , void * , size_t, size_t, size_t)


"""
Expand Down