From acaa457da491abbb03dbfbf0ec0c986155d9949a Mon Sep 17 00:00:00 2001 From: "Yuhsiang M. Tsai" Date: Fri, 11 Sep 2020 12:16:44 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: fritzgoebel --- common/matrix/dense_kernels.hpp.inc | 2 +- core/matrix/csr.cpp | 1 + core/test/base/lin_op.cpp | 1 + include/ginkgo/core/base/lin_op.hpp | 2 +- reference/test/components/absolute_array.cpp | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/matrix/dense_kernels.hpp.inc b/common/matrix/dense_kernels.hpp.inc index 49be1ba3724..c26203115fe 100644 --- a/common/matrix/dense_kernels.hpp.inc +++ b/common/matrix/dense_kernels.hpp.inc @@ -534,7 +534,7 @@ __global__ __launch_bounds__(default_block_size) void outplace_absolute_dense( auto row = tidx / num_cols; auto col = tidx % num_cols; if (row < num_rows) { - out[row * stride_out + col] = abs(in[row * stride_out + col]); + out[row * stride_out + col] = abs(in[row * stride_in + col]); } } diff --git a/core/matrix/csr.cpp b/core/matrix/csr.cpp index 605f7b09fed..eae8599a3bb 100644 --- a/core/matrix/csr.cpp +++ b/core/matrix/csr.cpp @@ -87,6 +87,7 @@ GKO_REGISTER_OPERATION(inplace_absolute_array, GKO_REGISTER_OPERATION(outplace_absolute_array, components::outplace_absolute_array); + } // namespace csr diff --git a/core/test/base/lin_op.cpp b/core/test/base/lin_op.cpp index 497396efaeb..6f1feb0d15d 100644 --- a/core/test/base/lin_op.cpp +++ b/core/test/base/lin_op.cpp @@ -34,6 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + #include diff --git a/include/ginkgo/core/base/lin_op.hpp b/include/ginkgo/core/base/lin_op.hpp index a72f3685848..e7a9ff46cbd 100644 --- a/include/ginkgo/core/base/lin_op.hpp +++ b/include/ginkgo/core/base/lin_op.hpp @@ -625,7 +625,7 @@ class DiagonalExtractable { /** - * The AbsoluteComputable is an interface to allow get absolute from a LinOp. + * The AbsoluteComputable is an interface that allows to get the component wise absolute of a LinOp. * Use EnableAbsoluteComputation to implement this interface. */ class AbsoluteComputable { diff --git a/reference/test/components/absolute_array.cpp b/reference/test/components/absolute_array.cpp index 1c2f2952551..83cc444df20 100644 --- a/reference/test/components/absolute_array.cpp +++ b/reference/test/components/absolute_array.cpp @@ -78,7 +78,7 @@ class AbsoluteArray : public ::testing::Test { TYPED_TEST_CASE(AbsoluteArray, gko::test::ValueTypes); -TYPED_TEST(AbsoluteArray, InplaceEqualsReference) +TYPED_TEST(AbsoluteArray, InplaceEqualsExpected) { using T = typename TestFixture::value_type; gko::kernels::reference::components::inplace_absolute_array( @@ -87,7 +87,7 @@ TYPED_TEST(AbsoluteArray, InplaceEqualsReference) } -TYPED_TEST(AbsoluteArray, OutplaceEqualsReference) +TYPED_TEST(AbsoluteArray, OutplaceEqualsExpected) { using T = typename TestFixture::value_type; using AbsT = typename TestFixture::abs_type;