-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathdpnp_algo.pxd
More file actions
166 lines (150 loc) · 7.55 KB
/
dpnp_algo.pxd
File metadata and controls
166 lines (150 loc) · 7.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# cython: language_level=3
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2016-2024, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
# *****************************************************************************
cimport dpctl as c_dpctl
from libcpp cimport bool as cpp_bool
from dpnp.dpnp_algo cimport shape_elem_type, shape_type_c
from dpnp.dpnp_utils.dpnp_algo_utils cimport dpnp_descriptor
cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this namespace for Enum import
cdef enum DPNPFuncName "DPNPFuncName":
DPNP_FN_ALLCLOSE_EXT
DPNP_FN_CHOOSE_EXT
DPNP_FN_CORRELATE_EXT
DPNP_FN_EDIFF1D_EXT
DPNP_FN_ERF_EXT
DPNP_FN_FFT_FFT_EXT
DPNP_FN_FFT_RFFT_EXT
DPNP_FN_MEDIAN_EXT
DPNP_FN_MODF_EXT
DPNP_FN_PARTITION_EXT
DPNP_FN_RNG_BETA_EXT
DPNP_FN_RNG_BINOMIAL_EXT
DPNP_FN_RNG_CHISQUARE_EXT
DPNP_FN_RNG_EXPONENTIAL_EXT
DPNP_FN_RNG_F_EXT
DPNP_FN_RNG_GAMMA_EXT
DPNP_FN_RNG_GAUSSIAN_EXT
DPNP_FN_RNG_GEOMETRIC_EXT
DPNP_FN_RNG_GUMBEL_EXT
DPNP_FN_RNG_HYPERGEOMETRIC_EXT
DPNP_FN_RNG_LAPLACE_EXT
DPNP_FN_RNG_LOGISTIC_EXT
DPNP_FN_RNG_LOGNORMAL_EXT
DPNP_FN_RNG_MULTINOMIAL_EXT
DPNP_FN_RNG_MULTIVARIATE_NORMAL
DPNP_FN_RNG_MULTIVARIATE_NORMAL_EXT
DPNP_FN_RNG_NEGATIVE_BINOMIAL_EXT
DPNP_FN_RNG_NONCENTRAL_CHISQUARE_EXT
DPNP_FN_RNG_NORMAL_EXT
DPNP_FN_RNG_PARETO_EXT
DPNP_FN_RNG_POISSON_EXT
DPNP_FN_RNG_POWER_EXT
DPNP_FN_RNG_RAYLEIGH_EXT
DPNP_FN_RNG_SHUFFLE_EXT
DPNP_FN_RNG_SRAND
DPNP_FN_RNG_SRAND_EXT
DPNP_FN_RNG_STANDARD_CAUCHY_EXT
DPNP_FN_RNG_STANDARD_EXPONENTIAL_EXT
DPNP_FN_RNG_STANDARD_GAMMA_EXT
DPNP_FN_RNG_STANDARD_NORMAL
DPNP_FN_RNG_STANDARD_T_EXT
DPNP_FN_RNG_TRIANGULAR_EXT
DPNP_FN_RNG_UNIFORM_EXT
DPNP_FN_RNG_VONMISES_EXT
DPNP_FN_RNG_WALD_EXT
DPNP_FN_RNG_WEIBULL_EXT
DPNP_FN_RNG_ZIPF_EXT
cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncType": # need this namespace for Enum import
cdef enum DPNPFuncType "DPNPFuncType":
DPNP_FT_NONE
DPNP_FT_INT
DPNP_FT_LONG
DPNP_FT_FLOAT
DPNP_FT_DOUBLE
DPNP_FT_CMPLX64
DPNP_FT_CMPLX128
DPNP_FT_BOOL
cdef extern from "dpnp_iface_fptr.hpp":
struct DPNPFuncData:
DPNPFuncType return_type
void * ptr
DPNPFuncType return_type_no_fp64
void *ptr_no_fp64
DPNPFuncData get_dpnp_function_ptr(DPNPFuncName name, DPNPFuncType first_type, DPNPFuncType second_type) except +
cdef extern from "constants.hpp":
void dpnp_python_constants_initialize_c(void * py_none, void * py_nan)
cdef extern from "dpnp_iface.hpp":
char * dpnp_memory_alloc_c(size_t size_in_bytes) except +
void dpnp_memory_free_c(void * ptr)
void dpnp_memory_memcpy_c(void * dst, const void * src, size_t size_in_bytes)
void dpnp_rng_srand_c(size_t seed)
# C function pointer to the C library template functions
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_1in_1out_strides_t)(c_dpctl.DPCTLSyclQueueRef,
void *, const size_t, const size_t,
const shape_elem_type * , const shape_elem_type * ,
void *, const size_t, const size_t,
const shape_elem_type * , const shape_elem_type * ,
const long * ,
const c_dpctl.DPCTLEventVectorRef)
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_2in_1out_t)(c_dpctl.DPCTLSyclQueueRef,
void * ,
const void * ,
const size_t,
const shape_elem_type * ,
const size_t,
const void *,
const size_t,
const shape_elem_type * ,
const size_t,
const long * ,
const c_dpctl.DPCTLEventVectorRef)
ctypedef c_dpctl.DPCTLSyclEventRef(*fptr_2in_1out_strides_t)(c_dpctl.DPCTLSyclQueueRef,
void *,
const size_t,
const size_t,
const shape_elem_type * ,
const shape_elem_type * ,
void *,
const size_t,
const size_t,
const shape_elem_type * ,
const shape_elem_type * ,
void *,
const size_t, const size_t,
const shape_elem_type * ,
const shape_elem_type * ,
const long * ,
const c_dpctl.DPCTLEventVectorRef) except +
"""
Internal functions
"""
cdef DPNPFuncType dpnp_dtype_to_DPNPFuncType(dtype)
cdef dpnp_DPNPFuncType_to_dtype(size_t type)
"""
Logic functions
"""
cpdef dpnp_descriptor dpnp_isclose(dpnp_descriptor input1, dpnp_descriptor input2,
double rtol=*, double atol=*, cpp_bool equal_nan=*)