Skip to content

Commit ce02c6c

Browse files
Add comments explaining intention of unique_ptr::reset call
1 parent 8c167bf commit ce02c6c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dpctl/tensor/libtensor/include/kernels/accumulators.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,8 @@ std::size_t cumsum_val_contig_impl(sycl::queue &q,
12331233
copy_e.wait();
12341234
std::size_t return_val = static_cast<std::size_t>(*last_elem_host_usm);
12351235

1236-
// free USM host allocation
1236+
// explicitly free USM host allocation, by envoking deleter of
1237+
// the unique_ptr
12371238
host_usm_owner.reset(nullptr);
12381239

12391240
return return_val;
@@ -1347,7 +1348,8 @@ cumsum_val_strided_impl(sycl::queue &q,
13471348
copy_e.wait();
13481349
std::size_t return_val = static_cast<std::size_t>(*last_elem_host_usm);
13491350

1350-
// free USM-host temporary
1351+
// explicitly free USM-host temporary, by envoking deleter of
1352+
// the unique_ptr
13511353
host_usm_owner.reset(nullptr);
13521354

13531355
return return_val;

0 commit comments

Comments
 (0)