Skip to content

Commit

Permalink
Update dpnp.linalg.eig/eigvals (IntelPython#1780)
Browse files Browse the repository at this point in the history
* Remove old impl of dpnp_eig and dpnp_eigvals

* Update dpnp.linalg.eig func

* Update dpnp.linalg.eigvals func

* Update test_sycl_queue with eig and eigvals

* Update test_usm_type.py with eig and eigvals

* Update TestEigenvalue in test_linalg.py

* Remove dpnp_algo_linalg.pyx

* Update docstrings for solve and matrix_power

---------

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
  • Loading branch information
vlad-perevezentsev and antonwolfy authored Apr 11, 2024
1 parent 506d7a7 commit ceff0c7
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 404 deletions.
1 change: 0 additions & 1 deletion dpnp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ add_subdirectory(backend/extensions/sycl_ext)
add_subdirectory(dpnp_algo)
add_subdirectory(dpnp_utils)
add_subdirectory(fft)
add_subdirectory(linalg)
add_subdirectory(random)
4 changes: 0 additions & 4 deletions dpnp/backend/include/dpnp_iface_fptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ enum class DPNPFuncName : size_t
DPNP_FN_EDIFF1D_EXT, /**< Used in numpy.ediff1d() impl, requires extra
parameters */
DPNP_FN_EIG, /**< Used in numpy.linalg.eig() impl */
DPNP_FN_EIG_EXT, /**< Used in numpy.linalg.eig() impl, requires extra
parameters */
DPNP_FN_EIGVALS, /**< Used in numpy.linalg.eigvals() impl */
DPNP_FN_EIGVALS_EXT, /**< Used in numpy.linalg.eigvals() impl, requires
extra parameters */
DPNP_FN_ERF, /**< Used in scipy.special.erf impl */
DPNP_FN_ERF_EXT, /**< Used in scipy.special.erf impl, requires extra
parameters */
Expand Down
59 changes: 0 additions & 59 deletions dpnp/backend/kernels/dpnp_krnl_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,15 +630,6 @@ template <typename _DataType, typename _ResultType>
void (*dpnp_eig_default_c)(const void *, void *, void *, size_t) =
dpnp_eig_c<_DataType, _ResultType>;

template <typename _DataType, typename _ResultType>
DPCTLSyclEventRef (*dpnp_eig_ext_c)(DPCTLSyclQueueRef,
const void *,
void *,
void *,
size_t,
const DPCTLEventVectorRef) =
dpnp_eig_c<_DataType, _ResultType>;

template <typename _DataType, typename _ResultType>
DPCTLSyclEventRef dpnp_eigvals_c(DPCTLSyclQueueRef q_ref,
const void *array_in,
Expand Down Expand Up @@ -724,14 +715,6 @@ void (*dpnp_eigvals_default_c)(const void *,
void *,
size_t) = dpnp_eigvals_c<_DataType, _ResultType>;

template <typename _DataType, typename _ResultType>
DPCTLSyclEventRef (*dpnp_eigvals_ext_c)(DPCTLSyclQueueRef,
const void *,
void *,
size_t,
const DPCTLEventVectorRef) =
dpnp_eigvals_c<_DataType, _ResultType>;

template <typename _DataType>
class dpnp_initval_c_kernel;

Expand Down Expand Up @@ -1083,27 +1066,6 @@ void func_map_init_linalg(func_map_t &fmap)
fmap[DPNPFuncName::DPNP_FN_EIG][eft_DBL][eft_DBL] = {
eft_DBL, (void *)dpnp_eig_default_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_INT][eft_INT] = {
get_default_floating_type(),
(void *)dpnp_eig_ext_c<
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
get_default_floating_type<std::false_type>(),
(void *)dpnp_eig_ext_c<
int32_t, func_type_map_t::find_type<
get_default_floating_type<std::false_type>()>>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_LNG][eft_LNG] = {
get_default_floating_type(),
(void *)dpnp_eig_ext_c<
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
get_default_floating_type<std::false_type>(),
(void *)dpnp_eig_ext_c<
int64_t, func_type_map_t::find_type<
get_default_floating_type<std::false_type>()>>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_FLT][eft_FLT] = {
eft_FLT, (void *)dpnp_eig_ext_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_DBL][eft_DBL] = {
eft_DBL, (void *)dpnp_eig_ext_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_INT][eft_INT] = {
eft_DBL, (void *)dpnp_eigvals_default_c<int32_t, double>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_LNG][eft_LNG] = {
Expand All @@ -1113,27 +1075,6 @@ void func_map_init_linalg(func_map_t &fmap)
fmap[DPNPFuncName::DPNP_FN_EIGVALS][eft_DBL][eft_DBL] = {
eft_DBL, (void *)dpnp_eigvals_default_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_INT][eft_INT] = {
get_default_floating_type(),
(void *)dpnp_eigvals_ext_c<
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
get_default_floating_type<std::false_type>(),
(void *)dpnp_eigvals_ext_c<
int32_t, func_type_map_t::find_type<
get_default_floating_type<std::false_type>()>>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_LNG][eft_LNG] = {
get_default_floating_type(),
(void *)dpnp_eigvals_ext_c<
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
get_default_floating_type<std::false_type>(),
(void *)dpnp_eigvals_ext_c<
int64_t, func_type_map_t::find_type<
get_default_floating_type<std::false_type>()>>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_FLT][eft_FLT] = {
eft_FLT, (void *)dpnp_eigvals_ext_c<float, float>};
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_DBL][eft_DBL] = {
eft_DBL, (void *)dpnp_eigvals_ext_c<double, double>};

fmap[DPNPFuncName::DPNP_FN_INITVAL][eft_BLN][eft_BLN] = {
eft_BLN, (void *)dpnp_initval_default_c<bool>};
fmap[DPNPFuncName::DPNP_FN_INITVAL][eft_INT][eft_INT] = {
Expand Down
2 changes: 0 additions & 2 deletions dpnp/dpnp_algo/dpnp_algo.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this na
DPNP_FN_DIAG_INDICES_EXT
DPNP_FN_DIAGONAL_EXT
DPNP_FN_EDIFF1D_EXT
DPNP_FN_EIG_EXT
DPNP_FN_EIGVALS_EXT
DPNP_FN_ERF_EXT
DPNP_FN_FABS_EXT
DPNP_FN_FFT_FFT_EXT
Expand Down
7 changes: 0 additions & 7 deletions dpnp/linalg/CMakeLists.txt

This file was deleted.

147 changes: 0 additions & 147 deletions dpnp/linalg/dpnp_algo_linalg.pyx

This file was deleted.

Loading

0 comments on commit ceff0c7

Please sign in to comment.