Skip to content

Commit 5859aec

Browse files
committed
Applying the review comments
1 parent 153f1ca commit 5859aec

File tree

4 files changed

+39
-21
lines changed

4 files changed

+39
-21
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# CMake build and local install directory
22
_skbuild
3-
build
43
build_cython
54
dpnp.egg-info
65

dpnp/backend/extensions/lapack/heevd.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ namespace mkl_lapack = oneapi::mkl::lapack;
4444
namespace py = pybind11;
4545

4646
template <typename T, typename RealT>
47-
static inline sycl::event call_heevd(sycl::queue exec_q,
48-
const oneapi::mkl::job jobz,
49-
const oneapi::mkl::uplo upper_lower,
50-
const std::int64_t n,
51-
T* a,
52-
RealT* w,
53-
std::vector<sycl::event> &host_task_events,
54-
const std::vector<sycl::event>& depends)
47+
static sycl::event call_heevd(sycl::queue exec_q,
48+
const oneapi::mkl::job jobz,
49+
const oneapi::mkl::uplo upper_lower,
50+
const std::int64_t n,
51+
T* a,
52+
RealT* w,
53+
std::vector<sycl::event>& host_task_events,
54+
const std::vector<sycl::event>& depends)
5555
{
5656
validate_type_for_device<T>(exec_q);
5757
validate_type_for_device<RealT>(exec_q);
@@ -171,6 +171,17 @@ std::pair<sycl::event, sycl::event> heevd(sycl::queue exec_q,
171171
// throw py::value_error("Arrays index overlapping segments of memory");
172172
// }
173173

174+
bool is_eig_vecs_f_contig = eig_vecs.is_f_contiguous();
175+
bool is_eig_vals_c_contig = eig_vals.is_c_contiguous();
176+
if (!is_eig_vecs_f_contig)
177+
{
178+
throw py::value_error("An array with input matrix / ouput eigenvectors must be F-contiguous");
179+
}
180+
else if (!is_eig_vals_c_contig)
181+
{
182+
throw py::value_error("An array with output eigenvalues must be C-contiguous");
183+
}
184+
174185
int eig_vecs_typenum = eig_vecs.get_typenum();
175186
int eig_vals_typenum = eig_vals.get_typenum();
176187
auto const& dpctl_capi = dpctl::detail::dpctl_capi::get();

dpnp/backend/extensions/lapack/syevd.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ namespace mkl_lapack = oneapi::mkl::lapack;
4444
namespace py = pybind11;
4545

4646
template <typename T>
47-
static inline sycl::event call_syevd(sycl::queue exec_q,
48-
const oneapi::mkl::job jobz,
49-
const oneapi::mkl::uplo upper_lower,
50-
const std::int64_t n,
51-
T* a,
52-
T* w,
53-
std::vector<sycl::event> &host_task_events,
54-
const std::vector<sycl::event>& depends)
47+
static sycl::event call_syevd(sycl::queue exec_q,
48+
const oneapi::mkl::job jobz,
49+
const oneapi::mkl::uplo upper_lower,
50+
const std::int64_t n,
51+
T* a,
52+
T* w,
53+
std::vector<sycl::event>& host_task_events,
54+
const std::vector<sycl::event>& depends)
5555
{
5656
validate_type_for_device<T>(exec_q);
5757

@@ -170,6 +170,17 @@ std::pair<sycl::event, sycl::event> syevd(sycl::queue exec_q,
170170
// throw py::value_error("Arrays index overlapping segments of memory");
171171
// }
172172

173+
bool is_eig_vecs_f_contig = eig_vecs.is_f_contiguous();
174+
bool is_eig_vals_c_contig = eig_vals.is_c_contiguous();
175+
if (!is_eig_vecs_f_contig)
176+
{
177+
throw py::value_error("An array with input matrix / ouput eigenvectors must be F-contiguous");
178+
}
179+
else if (!is_eig_vals_c_contig)
180+
{
181+
throw py::value_error("An array with output eigenvalues must be C-contiguous");
182+
}
183+
173184
int eig_vecs_typenum = eig_vecs.get_typenum();
174185
int eig_vals_typenum = eig_vals.get_typenum();
175186
auto const& dpctl_capi = dpctl::detail::dpctl_capi::get();

dpnp/linalg/dpnp_utils_linalg.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,8 @@ def dpnp_eigh(a, UPLO):
9696
# call LAPACK extension function to get eigenvalues and eigenvectors of a portion of matrix A
9797
ht_lapack_ev[i], _ = getattr(li, lapack_func)(a_sycl_queue, jobz, uplo, eig_vecs[i].get_array(), w[i].get_array(), depends=[copy_ev])
9898

99-
# TODO: remove once dpctl fix is available
100-
ht_lapack_ev[i].wait()
101-
10299
for i in range(op_count):
103-
# ht_lapack_ev[i].wait()
100+
ht_lapack_ev[i].wait()
104101
ht_copy_ev[i].wait()
105102

106103
# combine the list of eigenvectors into a single array

0 commit comments

Comments
 (0)