Skip to content

Commit cd335ce

Browse files
committed
Fix padding the dependencies of copy_for_roll
1 parent 5085a49 commit cd335ce

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ This release is compatible with NumPy 2.5.
101101
* Fixed `dpnp.einsum` returning a result whose memory layout differs from NumPy for the default `order="K"`, and ignoring `out` and `order` for a contraction over a size-0 dimension [#3058](https://github.com/IntelPython/dpnp/pull/3058)
102102
* Fixed operations on a boolean array whose bytes are not `0x00`/`0x01` [#3055](https://github.com/IntelPython/dpnp/pull/3055)
103103
* Fixed the strided kernel of `dpnp.full` and `dpnp.tensor.full` not waiting on the events passed to the binding [#3073](https://github.com/IntelPython/dpnp/pull/3073)
104-
* Fixed the list of events the copy kernel of `dpnp.reshape` and `dpnp.tensor.reshape` waits on being padded with default-constructed events [#3073](https://github.com/IntelPython/dpnp/pull/3073)
104+
* Fixed the list of events the copy kernels of `dpnp.reshape`, `dpnp.tensor.reshape`, `dpnp.roll` and `dpnp.tensor.roll` wait on being padded with default-constructed events [#3073](https://github.com/IntelPython/dpnp/pull/3073)
105105
* Fixed `simplify_iteration_three_strides` and `simplify_iteration_four_strides` accumulating into their third and fourth output displacements without zeroing them first, which required the caller to initialize them [#3073](https://github.com/IntelPython/dpnp/pull/3073)
106106

107107
### Security

‎dpnp/tensor/libtensor/source/copy_for_roll.cpp‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ std::pair<sycl::event, sycl::event>
233233
sycl::event copy_shape_ev = std::get<2>(ptr_size_event_tuple);
234234
const py::ssize_t *shape_strides = shape_strides_owner.get();
235235

236-
std::vector<sycl::event> all_deps(depends.size() + 1);
237-
all_deps.push_back(copy_shape_ev);
236+
std::vector<sycl::event> all_deps;
237+
all_deps.reserve(depends.size() + 1);
238238
all_deps.insert(std::end(all_deps), std::begin(depends), std::end(depends));
239+
all_deps.push_back(copy_shape_ev);
239240

240241
sycl::event copy_for_roll_event =
241242
fn(exec_q, offset, src_nelems, src_nd, shape_strides, src_data,
@@ -357,9 +358,10 @@ std::pair<sycl::event, sycl::event>
357358
sycl::event copy_shape_ev = std::get<2>(ptr_size_event_tuple);
358359
const py::ssize_t *shape_strides_shifts = shape_strides_shifts_owner.get();
359360

360-
std::vector<sycl::event> all_deps(depends.size() + 1);
361-
all_deps.push_back(copy_shape_ev);
361+
std::vector<sycl::event> all_deps;
362+
all_deps.reserve(depends.size() + 1);
362363
all_deps.insert(std::end(all_deps), std::begin(depends), std::end(depends));
364+
all_deps.push_back(copy_shape_ev);
363365

364366
sycl::event copy_for_roll_event =
365367
fn(exec_q, src_nelems, src_nd, shape_strides_shifts, src_data,

0 commit comments

Comments
 (0)