From 0df8493ec5d4b40acd6023b1c1a10dde17491aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20F=C3=B6rster?= <97973773+mfoerste4@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:41:38 +0200 Subject: [PATCH] linewiseop padded span test (#964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should fix the failures @Nyrio found in [#911](https://github.com/rapidsai/raft/pull/911#issuecomment-1295301874). This is a test issue within a new testcase that was introduced by [#725](https://github.com/rapidsai/raft/pull/725). @cjnolet , FYI. Authors: - Malte Förster (https://github.com/mfoerste4) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/964 --- cpp/test/matrix/linewise_op.cu | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cpp/test/matrix/linewise_op.cu b/cpp/test/matrix/linewise_op.cu index 931c3ecb16..c61af89bec 100644 --- a/cpp/test/matrix/linewise_op.cu +++ b/cpp/test/matrix/linewise_op.cu @@ -108,7 +108,7 @@ struct LinewiseTest : public ::testing::TestWithParam T { return a + b; }; - auto vec_view = raft::make_device_vector_view(vec, lineLen); + auto vec_view = raft::make_device_vector_view(vec, alongLines ? lineLen : nLines); matrix::linewise_op(handle, in, out, alongLines, f, vec_view); } @@ -234,8 +234,8 @@ struct LinewiseTest : public ::testing::TestWithParam::mapping> layout{extents}; matrix_size_padded = layout.required_span_size(); } else { - auto extents = matrix_extent{m, n}; + auto extents = matrix_extent{n, m}; typename raft::layout_left_padded::mapping> layout{extents}; matrix_size_padded = layout.required_span_size(); } @@ -259,9 +259,9 @@ struct LinewiseTest : public ::testing::TestWithParam>( - blob_in.data(), nLines, lineLen); + blob_in.data(), n, m); auto outSpan = make_device_aligned_matrix_view>( - blob_out.data(), nLines, lineLen); + blob_out.data(), n, m); // prep padded input data thrust::for_each_n(rmm::exec_policy(stream), thrust::make_counting_iterator(0ul), @@ -271,7 +271,7 @@ struct LinewiseTest : public ::testing::TestWithParam>( - blob_in.data(), nLines, lineLen); + blob_in.data(), n, m); runLinewiseSumPadded>( outSpan, inSpanConst, lineLen, nLines, alongRows, vec1); @@ -292,9 +292,9 @@ struct LinewiseTest : public ::testing::TestWithParam>( - blob_in.data(), lineLen, nLines); + blob_in.data(), n, m); auto outSpan = make_device_aligned_matrix_view>( - blob_out.data(), lineLen, nLines); + blob_out.data(), n, m); // prep padded input data thrust::for_each_n(rmm::exec_policy(stream), thrust::make_counting_iterator(0ul), @@ -304,7 +304,7 @@ struct LinewiseTest : public ::testing::TestWithParam>( - blob_in.data(), lineLen, nLines); + blob_in.data(), n, m); runLinewiseSumPadded>( outSpan, inSpanConst, lineLen, nLines, alongRows, vec1);