Skip to content

Commit 1798bf2

Browse files
Removed unneeded temporaries
1 parent 56b134c commit 1798bf2

File tree

1 file changed

+3
-6
lines changed
  • dpctl/tensor/libtensor/include/kernels/elementwise_functions

1 file changed

+3
-6
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/common.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,13 @@ struct UnaryStridedFunctor
240240

241241
void operator()(sycl::id<1> wid) const
242242
{
243-
const argT *const &in = inp_;
244-
resT *const &out = res_;
245-
246-
auto offsets_ = inp_out_indexer_(wid.get(0));
243+
const auto &offsets_ = inp_out_indexer_(wid.get(0));
247244
const py::ssize_t &inp_offset = offsets_.get_first_offset();
248-
const py::ssize_t &out_offset = offsets_.get_second_offset();
245+
const py::ssize_t &res_offset = offsets_.get_second_offset();
249246

250247
UnaryOpT op{};
251248

252-
out[out_offset] = op(in[inp_offset]);
249+
res_[res_offset] = op(inp_[inp_offset]);
253250
}
254251
};
255252

0 commit comments

Comments
 (0)