diff --git a/dpnp/backend/extensions/statistics/sliding_window1d.hpp b/dpnp/backend/extensions/statistics/sliding_window1d.hpp index be9bd85f8faf..278fdaaa83c0 100644 --- a/dpnp/backend/extensions/statistics/sliding_window1d.hpp +++ b/dpnp/backend/extensions/statistics/sliding_window1d.hpp @@ -436,7 +436,7 @@ class PaddedSpan : public Span using size_type = SizeT; PaddedSpan(T *const data, const SizeT size, const SizeT pad) - : Span(data, size), pad_(pad) + : Span(data, size), pad_(pad) { } @@ -574,9 +574,20 @@ void submit_sliding_window1d(const PaddedSpan &a, } auto *const out_ptr = out.begin(); - auto *const out_end = out.end(); - results.store(&out_ptr[glid], - [out_end](auto &&ptr) { return ptr < out_end; }); + // auto *const out_end = out.end(); + + auto y_start = glid; + auto y_stop = + std::min(y_start + WorkPI * results.size_x(), out.size()); + uint32_t i = 0; + for (uint32_t y = y_start; y < y_stop; y += results.size_x()) { + out_ptr[y] = results[i++]; + } + // while the code itself seems to be valid, inside correlate + // kernel it results in memory corruption. Further investigation + // is needed. SAT-7693 + // corruption results.store(&out_ptr[glid], + // [out_end](auto &&ptr) { return ptr < out_end; }); }); } @@ -635,9 +646,20 @@ void submit_sliding_window1d_small_kernel(const PaddedSpan &a, red); auto *const out_ptr = out.begin(); - auto *const out_end = out.end(); - results.store(&out_ptr[glid], - [out_end](auto &&ptr) { return ptr < out_end; }); + // auto *const out_end = out.end(); + + auto y_start = glid; + auto y_stop = + std::min(y_start + WorkPI * results.size_x(), out.size()); + uint32_t i = 0; + for (uint32_t y = y_start; y < y_stop; y += results.size_x()) { + out_ptr[y] = results[i++]; + } + // while the code itself seems to be valid, inside correlate + // kernel it results in memory corruption. Further investigation + // is needed. SAT-7693 + // corruption results.store(&out_ptr[glid], + // [out_end](auto &&ptr) { return ptr < out_end; }); }); } diff --git a/dpnp/tests/test_usm_type.py b/dpnp/tests/test_usm_type.py index 74fdd28d1272..213f618f187d 100644 --- a/dpnp/tests/test_usm_type.py +++ b/dpnp/tests/test_usm_type.py @@ -800,9 +800,6 @@ def test_1in_1out(func, data, usm_type): @pytest.mark.parametrize("usm_type_x", list_of_usm_types, ids=list_of_usm_types) @pytest.mark.parametrize("usm_type_y", list_of_usm_types, ids=list_of_usm_types) def test_2in_1out(func, data1, data2, usm_type_x, usm_type_y): - if func == "correlate" and is_win_platform(): - pytest.skip("due to SAT-7693") - x = dp.array(data1, usm_type=usm_type_x) y = dp.array(data2, usm_type=usm_type_y) z = getattr(dp, func)(x, y)