File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
dpctl/tensor/libtensor/source Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1827,9 +1827,9 @@ eye(py::ssize_t k,
1827
1827
}
1828
1828
1829
1829
sycl::queue dst_q = dst.get_queue ();
1830
- if (dst_q != exec_q && dst_q. get_context () != exec_q. get_context ( )) {
1831
- throw py::value_error (
1832
- " Execution queue context is not the same as allocation context " );
1830
+ if (! dpctl::utils::queues_are_compatible ( exec_q, { dst_q} )) {
1831
+ throw py::value_error (" Execution queue is not compatible with the "
1832
+ " allocation queue " );
1833
1833
}
1834
1834
1835
1835
int dst_typenum = dst.get_typenum ();
@@ -1857,17 +1857,17 @@ eye(py::ssize_t k,
1857
1857
start = (k < 0 ) ? -k : k * rows;
1858
1858
}
1859
1859
1860
+ const py::ssize_t *strides = dst.get_strides_raw ();
1860
1861
py::ssize_t step;
1861
- if (dst. get_strides_raw () == nullptr ) {
1862
+ if (strides == nullptr ) {
1862
1863
step = (is_dst_c_contig) ? cols + 1 : rows + 1 ;
1863
1864
}
1864
1865
else {
1865
- const py::ssize_t *strides = dst.get_strides_raw ();
1866
1866
step = strides[0 ] + strides[1 ];
1867
1867
}
1868
1868
1869
1869
const py::ssize_t length = std::min ({rows, cols, rows + k, cols - k});
1870
- const py::ssize_t end = start + step * (length - 1 ) + 1 ;
1870
+ const py::ssize_t end = start + step * (length - 1 );
1871
1871
1872
1872
char *dst_data = dst.get_data ();
1873
1873
sycl::event eye_event;
You can’t perform that action at this time.
0 commit comments