Skip to content

Commit d9371ff

Browse files
committed
Minor changes
1 parent d660147 commit d9371ff

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dpctl/tensor/_ctors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ def tril(X, k=0):
11301130
k = operator.index(k)
11311131

11321132
# F_CONTIGUOUS = 2
1133-
order = "f" if (X.flags & 2) else "c"
1133+
order = "F" if (X.flags & 2) else "C"
11341134

11351135
shape = X.shape
11361136
nd = X.ndim
@@ -1171,7 +1171,7 @@ def triu(X, k=0):
11711171
k = operator.index(k)
11721172

11731173
# F_CONTIGUOUS = 2
1174-
order = "f" if (X.flags & 2) else "c"
1174+
order = "F" if (X.flags & 2) else "C"
11751175

11761176
shape = X.shape
11771177
nd = X.ndim

dpctl/tensor/libtensor/source/tensor_py.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,10 @@ tri(sycl::queue &exec_q,
20242024
}
20252025

20262026
// check that arrays do not overlap, and concurrent copying is safe.
2027+
char *src_data = src.get_data();
2028+
char *dst_data = dst.get_data();
20272029
auto src_offsets = src.get_minmax_offsets();
2030+
auto dst_offsets = dst.get_minmax_offsets();
20282031
int src_elem_size = src.get_elemsize();
20292032
int dst_elem_size = dst.get_elemsize();
20302033

@@ -2112,9 +2115,8 @@ tri(sycl::queue &exec_q,
21122115
int nd = src_nd - 2;
21132116
const py::ssize_t *shape = src_shape;
21142117
const py::ssize_t *p_src_strides = src_strides.data();
2115-
;
21162118
const py::ssize_t *p_dst_strides = dst_strides.data();
2117-
;
2119+
21182120
simplify_iteration_space(nd, shape, p_src_strides, src_itemsize,
21192121
is_src_c_contig, is_src_f_contig, p_dst_strides,
21202122
dst_itemsize, is_dst_c_contig, is_dst_f_contig,
@@ -2160,14 +2162,14 @@ tri(sycl::queue &exec_q,
21602162
if (part == 'l') {
21612163
auto fn = tril_generic_dispatch_vector[src_typeid];
21622164
tri_ev =
2163-
fn(exec_q, inner_range, outer_range, src.get_data(), dst.get_data(),
2164-
nd, dev_shape_and_strides, k, depends, {copy_shape_and_strides});
2165+
fn(exec_q, inner_range, outer_range, src_data, dst_data, nd,
2166+
dev_shape_and_strides, k, depends, {copy_shape_and_strides});
21652167
}
21662168
else {
21672169
auto fn = triu_generic_dispatch_vector[src_typeid];
21682170
tri_ev =
2169-
fn(exec_q, inner_range, outer_range, src.get_data(), dst.get_data(),
2170-
nd, dev_shape_and_strides, k, depends, {copy_shape_and_strides});
2171+
fn(exec_q, inner_range, outer_range, src_data, dst_data, nd,
2172+
dev_shape_and_strides, k, depends, {copy_shape_and_strides});
21712173
}
21722174

21732175
exec_q.submit([&](sycl::handler &cgh) {

0 commit comments

Comments
 (0)