diff --git a/test/api/test_merge.cpp b/test/api/test_merge.cpp index 987110116efa8890a84638ec65cfff7fdfa5108b..24cea43f1d5839347a803f61b1f9067d541948f6 100644 --- a/test/api/test_merge.cpp +++ b/test/api/test_merge.cpp @@ -11,16 +11,16 @@ template class MergeTest final { public: - /// Shorthand for internal data layout representation. + // Shorthand for internal data layout representation. using ArrayType = test::Array2D; - /// Sets the number of padding bytes at the end of rows. + // Sets the number of padding bytes at the end of rows. MergeTest& with_padding(size_t padding) { padding_ = padding; return *this; } - /// Executes the test + // Executes the test void test() { // Width of input is set to execute 2 vector paths and 1 scalar path size_t vector_length = test::Options::vector_length(); @@ -85,7 +85,7 @@ class MergeTest final { } private: - /// Number of padding bytes at the end of rows. + // Number of padding bytes at the end of rows. size_t padding_{0}; }; diff --git a/test/api/test_min_max.cpp b/test/api/test_min_max.cpp index aa3306573afb0d9938ce1284d98e959e45a5225c..71942bfb6c37b108be78e57631ac0d38ef283d50 100644 --- a/test/api/test_min_max.cpp +++ b/test/api/test_min_max.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -27,23 +27,23 @@ class MinMaxTest { using ArrayType = test::Array2D; protected: - /// Returns the minimum value for ElementType. + // Returns the minimum value for ElementType. static constexpr ElementType min() { return std::numeric_limits::min(); } - /// Returns the maximum value for ElementType. + // Returns the maximum value for ElementType. static constexpr ElementType max() { return std::numeric_limits::max(); } - /// Returns the number of vector lanes. + // Returns the number of vector lanes. static size_t lanes() { return test::Options::vector_lanes(); } // We have 2 rows, source_row0 and source_row1 static size_t height() { return 2; } - /// Tested number of elements in a row. + // Tested number of elements in a row. static size_t width() { // Sufficient number of elements to exercise both vector and scalar paths. return 3 * lanes() - 1; diff --git a/test/api/test_saturating_absdiff.cpp b/test/api/test_saturating_absdiff.cpp index 5bfcf01c5beded1b3213b5a2db93636735fbf1a8..a9cfbf68bec5cf02472bc2d4447ccb4a13704a76 100644 --- a/test/api/test_saturating_absdiff.cpp +++ b/test/api/test_saturating_absdiff.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -21,7 +21,7 @@ INTRINSICCV_SATURATING_ABSDIFF(int32_t, s32); template class SaturatingAbsDiffTest final : public BinaryOperationTest { - /// Expose constructor of base class. + // Expose constructor of base class. using BinaryOperationTest::BinaryOperationTest; protected: @@ -29,7 +29,7 @@ class SaturatingAbsDiffTest final : public BinaryOperationTest { using BinaryOperationTest::min; using BinaryOperationTest::max; - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. void call_api() override { saturating_absdiff()( this->inputs_[0].data(), this->inputs_[0].stride(), @@ -38,7 +38,7 @@ class SaturatingAbsDiffTest final : public BinaryOperationTest { this->height()); } - /// Returns different test data for signed and unsigned element types. + // Returns different test data for signed and unsigned element types. const std::vector& test_elements() override { if constexpr (std::is_unsigned_v) { static const std::vector kTestElements = { @@ -89,7 +89,7 @@ using ElementTypes = ::testing::Types; TYPED_TEST_SUITE(SaturatingAbsDiff, ElementTypes); -/// Tests \ref intrinsiccv_saturating_absdiff_ API. +// Tests \ref intrinsiccv_saturating_absdiff_ API. TYPED_TEST(SaturatingAbsDiff, API) { // Test without padding. SaturatingAbsDiffTest{}.test(); diff --git a/test/api/test_saturating_add.cpp b/test/api/test_saturating_add.cpp index b3c7cdb09530e3da0a7a3a8aab43ebdf71e7ede1..03177fe557dfc156e32267b8fc6cb4759f4786cb 100644 --- a/test/api/test_saturating_add.cpp +++ b/test/api/test_saturating_add.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -23,7 +23,7 @@ INTRINSICCV_SATURATING_ADD(uint64_t, u64); template class SaturatingAddTest final : public BinaryOperationTest { - /// Expose constructor of base class. + // Expose constructor of base class. using BinaryOperationTest::BinaryOperationTest; protected: @@ -31,7 +31,7 @@ class SaturatingAddTest final : public BinaryOperationTest { using BinaryOperationTest::min; using BinaryOperationTest::max; - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. void call_api() override { saturating_add()( this->inputs_[0].data(), this->inputs_[0].stride(), @@ -40,7 +40,7 @@ class SaturatingAddTest final : public BinaryOperationTest { this->height()); } - /// Returns different test data for signed and unsigned element types. + // Returns different test data for signed and unsigned element types. const std::vector& test_elements() override { if constexpr (std::is_unsigned_v) { static const std::vector kTestElements = { @@ -81,7 +81,7 @@ using ElementTypes = ::testing::Types; TYPED_TEST_SUITE(SaturatingAdd, ElementTypes); -/// Tests \ref intrinsiccv_saturating_add_ API. +// Tests \ref intrinsiccv_saturating_add_ API. TYPED_TEST(SaturatingAdd, API) { // Test without padding. SaturatingAddTest{}.test(); diff --git a/test/api/test_saturating_multiply.cpp b/test/api/test_saturating_multiply.cpp index bf14c39b45b5341f5d7ec6a1bf5e12c8f2bd214d..00e1c2c739dbec19093a0576dbbc05baceabe34d 100644 --- a/test/api/test_saturating_multiply.cpp +++ b/test/api/test_saturating_multiply.cpp @@ -21,7 +21,7 @@ INTRINSICCV_SATURATING_MULTIPLY(int32_t, s32); template class SaturatingMultiplyTest final : public BinaryOperationTest { - /// Expose constructor of base class. + // Expose constructor of base class. using BinaryOperationTest::BinaryOperationTest; protected: @@ -29,7 +29,7 @@ class SaturatingMultiplyTest final : public BinaryOperationTest { using BinaryOperationTest::min; using BinaryOperationTest::max; - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. void call_api() override { saturating_multiply()( this->inputs_[0].data(), this->inputs_[0].stride(), @@ -40,7 +40,7 @@ class SaturatingMultiplyTest final : public BinaryOperationTest { double scale() { return 1.0; // This is the only parameter IntrinsicCV supports. } - /// Returns different test data for signed and unsigned element types. + // Returns different test data for signed and unsigned element types. const std::vector& test_elements() override { if constexpr (std::is_unsigned_v) { static const std::vector kTestElements = { @@ -89,7 +89,7 @@ using ElementTypes = ::testing::Types; TYPED_TEST_SUITE(SaturatingMultiply, ElementTypes); -/// Tests \ref intrinsiccv_saturating_multiply_ API. +// Tests \ref intrinsiccv_saturating_multiply_ API. TYPED_TEST(SaturatingMultiply, API) { // Test without padding. SaturatingMultiplyTest{}.test(); diff --git a/test/api/test_saturating_sub.cpp b/test/api/test_saturating_sub.cpp index ba88d455a9c1739091e68d948eee965dffc7d60b..6f95b6fd751d29b60fc6f6f269ed1303313fe974 100644 --- a/test/api/test_saturating_sub.cpp +++ b/test/api/test_saturating_sub.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -23,7 +23,7 @@ INTRINSICCV_SATURATING_SUB(uint64_t, u64); template class SaturatingSubTest final : public BinaryOperationTest { - /// Expose constructor of base class. + // Expose constructor of base class. using BinaryOperationTest::BinaryOperationTest; protected: @@ -31,7 +31,7 @@ class SaturatingSubTest final : public BinaryOperationTest { using BinaryOperationTest::min; using BinaryOperationTest::max; - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. void call_api() override { saturating_sub()( this->inputs_[0].data(), this->inputs_[0].stride(), @@ -40,7 +40,7 @@ class SaturatingSubTest final : public BinaryOperationTest { this->height()); } - /// Returns different test data for signed and unsigned element types. + // Returns different test data for signed and unsigned element types. const std::vector& test_elements() override { if constexpr (std::is_unsigned_v) { static const std::vector kTestElements = { @@ -83,7 +83,7 @@ using ElementTypes = ::testing::Types; TYPED_TEST_SUITE(SaturatingSub, ElementTypes); -/// Tests \ref intrinsiccv_saturating_sub_ API. +// Tests \ref intrinsiccv_saturating_sub_ API. TYPED_TEST(SaturatingSub, API) { // Test without padding. SaturatingSubTest{}.test(); diff --git a/test/api/test_sobel.cpp b/test/api/test_sobel.cpp index 0c5d8a7c16a4f0063cc5145a5fa315d1236a5ec2..6136e4401f4953f9b7da66447313cb7283bf53cb 100644 --- a/test/api/test_sobel.cpp +++ b/test/api/test_sobel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -23,7 +23,7 @@ INTRINSICCV_SOBEL_3X3_HORIZONTAL(uint8_t, s16_u8); INTRINSICCV_SOBEL_3X3_VERTICAL(uint8_t, s16_u8); -/// Implements KernelTestParams for Sobel operators. +// Implements KernelTestParams for Sobel operators. template struct SobelKernelTestParams; @@ -40,7 +40,7 @@ static constexpr std::array kSupportedBorders = { INTRINSICCV_BORDER_TYPE_REPLICATE, }; -/// Default test fo horizontal Sobel 3x3 operator. +// Default test fo horizontal Sobel 3x3 operator. template class Sobel3x3Test : public test::KernelTest { using typename test::KernelTest::InputType; @@ -78,7 +78,7 @@ class Sobel : public testing::Test {}; using ElementTypes = ::testing::Types; TYPED_TEST_SUITE(Sobel, ElementTypes); -/// Tests sobel_3x3_horizontal__ API. +// Tests sobel_3x3_horizontal__ API. TYPED_TEST(Sobel, Horizontal3x3) { using KernelTestParams = SobelKernelTestParams; // Horizontal 3x3 Sobel operator. @@ -89,7 +89,7 @@ TYPED_TEST(Sobel, Horizontal3x3) { Sobel3x3Test{}.test(mask); } -/// Tests sobel_3x3_vertical__ API. +// Tests sobel_3x3_vertical__ API. TYPED_TEST(Sobel, Vertical3x3) { using KernelTestParams = SobelKernelTestParams; // Horizontal 3x3 Sobel operator. diff --git a/test/api/test_split.cpp b/test/api/test_split.cpp index bb126bb70dad870e8e6e50b54a738cddc8fc6233..186f853fc67d57cdb6059aff593a92b3efcd0221 100644 --- a/test/api/test_split.cpp +++ b/test/api/test_split.cpp @@ -11,16 +11,16 @@ template class SplitTest final { public: - /// Shorthand for internal data layout representation. + // Shorthand for internal data layout representation. using ArrayType = test::Array2D; - /// Sets the number of padding bytes at the end of rows. + // Sets the number of padding bytes at the end of rows. SplitTest& with_padding(size_t padding) { padding_ = padding; return *this; } - /// Executes the test + // Executes the test void test() { // Width of input is set to execute 2 vector paths and 1 scalar path size_t vector_length = test::Options::vector_length(); @@ -84,7 +84,7 @@ class SplitTest final { } private: - /// Number of padding bytes at the end of rows. + // Number of padding bytes at the end of rows. size_t padding_{0}; }; diff --git a/test/api/test_threshold_binary.cpp b/test/api/test_threshold_binary.cpp index 69c016791a29efc6dc7823030f8edd913c669a25..d2ccb27424165c762b6eb02c4f1840dcec324564 100644 --- a/test/api/test_threshold_binary.cpp +++ b/test/api/test_threshold_binary.cpp @@ -13,7 +13,7 @@ class ThresholdBinaryTestBase : public UnaryOperationTest { using UnaryOperationTest::max; protected: - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. void call_api() override { intrinsiccv_threshold_binary_u8( this->inputs_[0].data(), this->inputs_[0].stride(), diff --git a/test/framework/abstract.h b/test/framework/abstract.h index 700ea98934109d12d4aa40730649ba9235237192..59906c6e6b26358399f830a14ec1377802e5b88a 100644 --- a/test/framework/abstract.h +++ b/test/framework/abstract.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -10,58 +10,58 @@ namespace test { -/// Interface for objects which represent a finite two-dimensional array. +// Interface for objects which represent a finite two-dimensional array. template class TwoDimensional { public: virtual ~TwoDimensional() = default; - /// Returns the number of elements in a row of a two-dimensional array. + // Returns the number of elements in a row of a two-dimensional array. virtual size_t width() const = 0; - /// Returns the number of rows of a two-dimensional array. + // Returns the number of rows of a two-dimensional array. virtual size_t height() const = 0; - /// Returns the number of channels. + // Returns the number of channels. virtual size_t channels() const { return 1UL; } - /// Returns a pointer to a data element at a given row and column position, or - /// nullptr if the requested position is invalid. + // Returns a pointer to a data element at a given row and column position, or + // nullptr if the requested position is invalid. virtual ElementType *at(size_t row, size_t column) = 0; - /// Returns a const pointer to a data element at a given row and column - /// position, or nullptr if the requested position is invalid. + // Returns a const pointer to a data element at a given row and column + // position, or nullptr if the requested position is invalid. virtual const ElementType *at(size_t row, size_t column) const = 0; }; // end of class TwoDimensional -/// Interface for objects which have a border. +// Interface for objects which have a border. class Bordered { public: virtual ~Bordered() = default; - /// Returns left border width. + // Returns left border width. virtual size_t left() const = 0; - /// Returns top border height. + // Returns top border height. virtual size_t top() const = 0; - /// Returns right border width. + // Returns right border width. virtual size_t right() const = 0; - /// Returns bottom border height. + // Returns bottom border height. virtual size_t bottom() const = 0; }; // end of class Bordered -/// Interface for objects which generate some values. +// Interface for objects which generate some values. template class Generator { public: virtual ~Generator() = default; - /// Resets the generator to its initial state. + // Resets the generator to its initial state. virtual void reset() {} - /// Yields the next value or std::nullopt. + // Yields the next value or std::nullopt. virtual std::optional next() = 0; }; // end of class Generator diff --git a/test/framework/array.h b/test/framework/array.h index be1f75948288aa0559c8f2f2e6b0402ccc547681..19bf2a03e7373cba3b4a24c223604ae7b8887774 100644 --- a/test/framework/array.h +++ b/test/framework/array.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -23,7 +23,7 @@ namespace test { -/// A simple two-dimensional array representation. +// A simple two-dimensional array representation. template class Array2D : public TwoDimensional { public: @@ -46,16 +46,16 @@ class Array2D : public TwoDimensional { fill_padding(); } - /// Destructor checks that padding bytes are not overwritten. + // Destructor checks that padding bytes are not overwritten. ~Array2D() override { check_padding(); } - /// Copy constructor. + // Copy constructor. Array2D(const Array2D &other) { this->operator=(other); } - /// Move constructor. + // Move constructor. Array2D(Array2D &&other) noexcept { this->operator=(other); } - /// Copy assignment operator. + // Copy assignment operator. Array2D &operator=(const Array2D &other) { if (this == &other) { return *this; @@ -75,7 +75,7 @@ class Array2D : public TwoDimensional { return *this; } - /// Move assignment operator. + // Move assignment operator. Array2D &operator=(Array2D &&other) noexcept { if (this == &other) { return *this; @@ -89,8 +89,8 @@ class Array2D : public TwoDimensional { return *this; } - /// Fills the underlying memory range with a given value skipping padding - /// bytes. + // Fills the underlying memory range with a given value skipping padding + // bytes. void fill(ElementType value) { ASSERT_EQ(valid(), true); @@ -104,8 +104,8 @@ class Array2D : public TwoDimensional { } } - /// Fills the underlying memory range with a given generator skipping padding - /// bytes. + // Fills the underlying memory range with a given generator skipping padding + // bytes. void fill(Generator *generator) { ASSERT_NE(generator, nullptr); ASSERT_EQ(valid(), true); @@ -124,7 +124,7 @@ class Array2D : public TwoDimensional { } } - /// Sets values in a row starting at a given column. + // Sets values in a row starting at a given column. void set(size_t row, size_t column, std::initializer_list values) { ASSERT_EQ(valid(), true) << "Array is invalid."; @@ -141,10 +141,10 @@ class Array2D : public TwoDimensional { } } - /// Sets values starting in a given row starting at a given column. - /// - /// The layout of the input TwoDimensional object is not altered, meaning that - /// it must fit as-is at the given row and column position into the array. + // Sets values starting in a given row starting at a given column. + // + // The layout of the input TwoDimensional object is not altered, meaning that + // it must fit as-is at the given row and column position into the array. void set(size_t row, size_t column, const TwoDimensional *elements) { ASSERT_NE(elements, nullptr); @@ -160,8 +160,8 @@ class Array2D : public TwoDimensional { } } - /// Compares two instances for equality considering only element bytes. - /// Returns the location of the first mismatch, if any. + // Compares two instances for equality considering only element bytes. + // Returns the location of the first mismatch, if any. std::optional> compare_to( const Array2D &other) const { for (size_t row = 0; row < height(); ++row) { @@ -177,38 +177,38 @@ class Array2D : public TwoDimensional { return std::nullopt; } - /// Returns a pointer to the first element. + // Returns a pointer to the first element. ElementType *data() { return reinterpret_cast(data_.get()); } - /// Returns a const pointer to the first element. + // Returns a const pointer to the first element. const ElementType *data() const { return reinterpret_cast(data_.get()); } - /// Returns the width of this array. + // Returns the width of this array. size_t width() const override { return width_; } - /// Returns the height of this array. + // Returns the height of this array. size_t height() const override { return height_; } - /// Returns the number of channels. + // Returns the number of channels. size_t channels() const override { return channels_; }; - /// Returns the stride of this array. + // Returns the stride of this array. size_t stride() const { return stride_; } - /// Returns true if this object holds actual memory, otherwise false. + // Returns true if this object holds actual memory, otherwise false. bool valid() const { return data() != nullptr; } - /// Returns a pointer to a data element at a given row and column position, or - /// nullptr if the requested position is invalid. + // Returns a pointer to a data element at a given row and column position, or + // nullptr if the requested position is invalid. ElementType *at(size_t row, size_t column) override { return const_cast( const_cast *>(this)->at(row, column)); } - /// Returns a const pointer to a data element at a given row and column - /// position, or nullptr if the requested position is invalid. + // Returns a const pointer to a data element at a given row and column + // position, or nullptr if the requested position is invalid. const ElementType *at(size_t row, size_t column) const override { if (!check_access(row, column)) { TEST_FAIL_WITH(nullptr, @@ -220,18 +220,18 @@ class Array2D : public TwoDimensional { } private: - /// Returns the offset to the first padding byte within a row. + // Returns the offset to the first padding byte within a row. size_t padding_offset() const { return width() * sizeof(ElementType); } - /// Returns true if a row has padding, otherwise false. + // Returns true if a row has padding, otherwise false. size_t has_padding() const { return padding_offset() != stride(); } - /// Checks that an access is valid or not. + // Checks that an access is valid or not. bool check_access(size_t row, size_t column) const { return valid() && (row < height()) && (column < width()); } - /// Fills padding bytes, if present. + // Fills padding bytes, if present. void fill_padding() { if (!valid() || !has_padding()) { return; @@ -247,7 +247,7 @@ class Array2D : public TwoDimensional { } } - /// Checks for clobbered padding bytes, if present. + // Checks for clobbered padding bytes, if present. void check_padding() const { if (!valid() || !has_padding()) { return; @@ -266,27 +266,27 @@ class Array2D : public TwoDimensional { } } - /// Adds stride to a pointer. + // Adds stride to a pointer. ElementType *add_stride(ElementType *ptr, size_t count) { char *address = reinterpret_cast(ptr); address += count * stride(); return reinterpret_cast(address); } - /// Adds stride to a pointer. + // Adds stride to a pointer. const ElementType *add_stride(const ElementType *ptr, size_t count) const { const char *address = reinterpret_cast(ptr); address += count * stride(); return reinterpret_cast(address); } - /// Resets the instance to the default instance. + // Resets the instance to the default instance. void reset() { width_ = height_ = channels_ = stride_ = 0; data_.reset(); } - /// Tries to allocate backing memory. + // Tries to allocate backing memory. void try_allocate() { size_t allocation_size = height_ * stride_; @@ -299,22 +299,22 @@ class Array2D : public TwoDimensional { } } - /// Constant value of row padding bytes. + // Constant value of row padding bytes. static constexpr uint8_t kPaddingValue = std::numeric_limits::max(); - /// Smart pointer to the managed memory. + // Smart pointer to the managed memory. std::unique_ptr data_; - /// Width a row in the array. + // Width a row in the array. size_t width_{0}; - /// Number of rows in the array. + // Number of rows in the array. size_t height_{0}; - /// Number of channels. + // Number of channels. size_t channels_{0}; - /// Stride in bytes between the first elements of two consecutive rows. + // Stride in bytes between the first elements of two consecutive rows. size_t stride_{0}; }; // end of class Array2D -/// Compares two \ref Array2D objects for equality. +// Compares two \ref Array2D objects for equality. #define EXPECT_EQ_ARRAY2D(lhs, rhs) \ do { \ ASSERT_EQ((lhs).width(), (rhs).width()) \ @@ -334,7 +334,7 @@ class Array2D : public TwoDimensional { } \ } while (0 != 0) -/// Compares two \ref Array2D objects for inequality. +// Compares two \ref Array2D objects for inequality. #define EXPECT_NE_ARRAY2D(lhs, rhs) \ do { \ ASSERT_EQ((lhs).width(), (rhs).width()) \ diff --git a/test/framework/border.cpp b/test/framework/border.cpp index a30e1737f4afa8d1a58c85ae68b0890a718cd8c8..ed49fa07be38aa8afce4b587bb2a7219b5572a62 100644 --- a/test/framework/border.cpp +++ b/test/framework/border.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -10,12 +10,12 @@ namespace test { -/// Creates replicated border elements. -/// -/// Replicating means that the elements at the edges are copied to bordering -/// element positions. For example: -/// | left border | elements | right border | -/// | A A | A B C D E | E E | +// Creates replicated border elements. +// +// Replicating means that the elements at the edges are copied to bordering +// element positions. For example: +// | left border | elements | right border | +// | A A | A B C D E | E E | template static void replicate(const Bordered *bordered, TwoDimensional *elements) { diff --git a/test/framework/border.h b/test/framework/border.h index 4ed31ab5822892e3b66c90d532bf10cd4da7240e..803d5546e4f5ce61fe927960b4d271bbb9b326a4 100644 --- a/test/framework/border.h +++ b/test/framework/border.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -11,7 +11,7 @@ namespace test { -/// Prepares bordering elements given a border type and bordering requirements. +// Prepares bordering elements given a border type and bordering requirements. template void prepare_borders(intrinsiccv_border_type_t border_type, const Bordered *bordered, diff --git a/test/framework/generator.h b/test/framework/generator.h index 42eb5c9df1e07ac77566755f646dc8dcb9d11de7..23126630f97f016b5f5551c62b02704444263c1f 100644 --- a/test/framework/generator.h +++ b/test/framework/generator.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -12,16 +12,16 @@ namespace test { -/// Generates pseudo-random numbers of a given type. +// Generates pseudo-random numbers of a given type. template class PseudoRandomNumberGenerator : public Generator { public: PseudoRandomNumberGenerator() : seed_{Options::seed()}, rng_{seed_} {} - /// Resets the generator to the initial state. + // Resets the generator to the initial state. void reset() override { rng_.seed(seed_); } - /// Yields the next value or std::nullopt. + // Yields the next value or std::nullopt. std::optional next() override { return static_cast(rng_()); } @@ -31,7 +31,7 @@ class PseudoRandomNumberGenerator : public Generator { std::mt19937_64 rng_; }; // end of class PseudoRandomNumberGenerator -/// Generator which yields values of an iterable container. +// Generator which yields values of an iterable container. template class SequenceGenerator : public Generator { public: @@ -40,10 +40,10 @@ class SequenceGenerator : public Generator { current_{container.begin()}, end_{container.end()} {} - /// Resets the generator to its initial state. + // Resets the generator to its initial state. void reset() override { current_ = begin_; } - /// Yields the next value or std::nullopt. + // Yields the next value or std::nullopt. std::optional next() override { if (current_ == end_) { return std::nullopt; diff --git a/test/framework/kernel.h b/test/framework/kernel.h index d88e6305389c1a3f01d2803043b07d9dff4dc2c5..f11b8b38c4e4133fdfe5170340355aca387c65e5 100644 --- a/test/framework/kernel.h +++ b/test/framework/kernel.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -19,7 +19,7 @@ namespace test { -/// Represents a kernel operator. +// Represents a kernel operator. template class Kernel : protected Array2D, public Bordered { public: @@ -33,37 +33,37 @@ class Kernel : protected Array2D, public Bordered { : Array2D(mask), anchor_{mask.width() / 2, mask.height() / 2} {} - /// Returns the anchor point of the kernel. + // Returns the anchor point of the kernel. Point anchor() const { return anchor_; } - /// Returns the number of elements to the left of the anchor point. + // Returns the number of elements to the left of the anchor point. size_t left() const override { return anchor().x; } - /// Returns the number of elements above the anchor point. + // Returns the number of elements above the anchor point. size_t top() const override { return anchor().y; } - /// Returns the number of elements to the right of the anchor point. + // Returns the number of elements to the right of the anchor point. size_t right() const override { return (width() > 0) ? width() - anchor().x - 1 : 0; } - /// Returns the number of elements above the anchor point. + // Returns the number of elements above the anchor point. size_t bottom() const override { return (height() > 0) ? height() - anchor().y - 1 : 0; } private: - /// The anchor point of the kernel. + // The anchor point of the kernel. Point anchor_; }; // end of class Kernel -/// Abstract class to help implement a kernel operation. -/// -/// Required: -/// - KernelTestParams::InputType: Input type to the operation. -/// - KernelTestParams::IntermediateType: Type which is used during element -/// calculations. -/// - KernelTestParams::OutputType: Output type of the operation. +// Abstract class to help implement a kernel operation. +// +// Required: +// - KernelTestParams::InputType: Input type to the operation. +// - KernelTestParams::IntermediateType: Type which is used during element +// calculations. +// - KernelTestParams::OutputType: Output type of the operation. template class KernelTest { public: @@ -73,7 +73,7 @@ class KernelTest { KernelTest() : debug_{false} {} - /// Enables debug mode. + // Enables debug mode. KernelTest &with_debug() { debug_ = true; return *this; @@ -137,14 +137,14 @@ class KernelTest { } protected: - /// Calls the API-under-test in the appropriate way. - /// - /// The arguments are never nullptr. + // Calls the API-under-test in the appropriate way. + // + // The arguments are never nullptr. virtual void call_api(const Array2D *input, Array2D *output, intrinsiccv_border_type_t border_type) = 0; - /// Calculates the expected output. + // Calculates the expected output. virtual void calculate_expected(const Kernel &kernel, const TwoDimensional &source) { for (size_t row = 0; row < expected_.height(); ++row) { @@ -156,7 +156,7 @@ class KernelTest { } } - /// Calculates the expected element at a given position. + // Calculates the expected element at a given position. virtual IntermediateType calculate_expected_at( const Kernel &kernel, const TwoDimensional &source, size_t row, size_t column) { @@ -173,7 +173,7 @@ class KernelTest { return result; } - /// Creates arrays for a given layout. + // Creates arrays for a given layout. void create_arrays(const Kernel &kernel, const ArrayLayout &array_layout) { input_ = Array2D{array_layout}; @@ -193,7 +193,7 @@ class KernelTest { ASSERT_TRUE(input_with_borders_.valid()); } - /// Prepares input to the kernel-based operation. + // Prepares input to the kernel-based operation. void prepare_source(Generator *element_generator) { ASSERT_NE(element_generator, nullptr); element_generator->reset(); @@ -205,7 +205,7 @@ class KernelTest { } } - /// Computes expected output of the kernel-based operation. + // Computes expected output of the kernel-based operation. void prepare_expected(const Kernel &kernel, const ArrayLayout &array_layout, intrinsiccv_border_type_t border_type) { @@ -232,10 +232,10 @@ class KernelTest { } } - /// Prepares the actual output of the kernel-based operation. + // Prepares the actual output of the kernel-based operation. void prepare_actual() { actual_.fill(42); } - /// Checks that the actual output matches the expectations. + // Checks that the actual output matches the expectations. void check_results() { if (debug_) { std::cout << "[actual]" << std::endl; @@ -246,15 +246,15 @@ class KernelTest { EXPECT_EQ_ARRAY2D(expected_, actual_); } - /// Input operand for the operation. + // Input operand for the operation. Array2D input_; - /// Input operand with borders, used to calculate expeected values. + // Input operand with borders, used to calculate expeected values. Array2D input_with_borders_; - /// Expected result of the operation. + // Expected result of the operation. Array2D expected_; - /// Actual result of the operation. + // Actual result of the operation. Array2D actual_; - /// Enables debug mode. + // Enables debug mode. bool debug_; }; // end of class KernelTest diff --git a/test/framework/operation.h b/test/framework/operation.h index 91dcedf21547f26f4e1de09ce3dbee23e3bd3be9..1dd888982964565e840c070c87c6ca8156580aac 100644 --- a/test/framework/operation.h +++ b/test/framework/operation.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -12,21 +12,21 @@ #include "framework/array.h" #include "framework/utils.h" -/// Abstract base class for operations with InputsSize number of inputs and -/// OutputsSize number of outputs. +// Abstract base class for operations with InputsSize number of inputs and +// OutputsSize number of outputs. template class OperationTest { public: - /// Shorthand for internal data layout representation. + // Shorthand for internal data layout representation. using ArrayType = test::Array2D; - /// Shorthand for elements. + // Shorthand for elements. struct Elements { ElementType values[InputsSize + OutputsSize]; }; // end of struct Elements virtual ~OperationTest() = default; - /// Sets the number of padding bytes at the end of rows. + // Sets the number of padding bytes at the end of rows. OperationTest& with_padding( size_t padding) { padding_ = padding; @@ -55,10 +55,10 @@ class OperationTest { } protected: - /// Returns test data. + // Returns test data. virtual const std::vector& test_elements() = 0; - /// Prepares inputs and expected outputs for the operation. + // Prepares inputs and expected outputs for the operation. void setup() { auto elements_list = test_elements(); // Check that the number of elements fit into the buffers. @@ -84,45 +84,45 @@ class OperationTest { } } - /// Calls the API-under-test in the appropriate way. + // Calls the API-under-test in the appropriate way. virtual void call_api() = 0; - /// Checks that the result meets the expectations. + // Checks that the result meets the expectations. virtual void check() { for (size_t index = 0; index < expected_.size(); ++index) { EXPECT_EQ_ARRAY2D(expected_[index], actual_[index]); } } - /// Tested number of rows. + // Tested number of rows. virtual size_t height() { return test_elements().size(); } - /// Tested number of elements in a row. + // Tested number of elements in a row. size_t width() const { // Sufficient number of elements to exercise both vector and scalar paths. return 3 * test::Options::vector_lanes() - 1; } - /// Returns the number of padding bytes at the end of rows. + // Returns the number of padding bytes at the end of rows. size_t padding() const { return padding_; } - /// Returns the minimum value for ElementType. + // Returns the minimum value for ElementType. static constexpr ElementType min() { return std::numeric_limits::min(); } - /// Returns the maximum value for ElementType. + // Returns the maximum value for ElementType. static constexpr ElementType max() { return std::numeric_limits::max(); } - /// Input operand(s) for the operation. + // Input operand(s) for the operation. std::array inputs_; - /// Expected result of the operation. + // Expected result of the operation. std::array expected_; - /// Actual result of the operation. + // Actual result of the operation. std::array actual_; - /// Number of padding bytes at the end of rows. + // Number of padding bytes at the end of rows. size_t padding_{0}; }; // end of class OperationTest diff --git a/test/framework/test_array2d.cpp b/test/framework/test_array2d.cpp index 84a83350e2e8fece5a40d1f4d701f410995a31ce..b52cfbd26a1b673205831c49fd2185440e29c5b6 100644 --- a/test/framework/test_array2d.cpp +++ b/test/framework/test_array2d.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -12,8 +12,8 @@ #include "framework/generator.h" #include "framework/utils.h" -/// Tests that the default constructor of test::Array2D default constructor -/// always creates an empty object. +// Tests that the default constructor of test::Array2D default constructor +// always creates an empty object. TEST(Array2D, DefaultConstructor) { test::Array2D array; EXPECT_EQ(array.width(), 0); @@ -23,8 +23,8 @@ TEST(Array2D, DefaultConstructor) { EXPECT_FALSE(array.valid()); } -/// Tests that test::Array2D constructor always creates an object with the -/// same contents. +// Tests that test::Array2D constructor always creates an object with the +// same contents. TEST(Array2D, Constructor) { size_t width = 5, height = 5; test::Array2D array_1{width, height}; @@ -38,7 +38,7 @@ TEST(Array2D, Constructor) { EXPECT_EQ_ARRAY2D(array_1, array_2); } -/// Tests that test::Array2D is constructible with test::ArrayLayout. +// Tests that test::Array2D is constructible with test::ArrayLayout. TEST(Array2D, ConstructFromArrayLayout) { using ElementType = uint32_t; @@ -52,7 +52,7 @@ TEST(Array2D, ConstructFromArrayLayout) { EXPECT_TRUE(array.valid()); } -/// Tests that the copy assignment operator of test::Array2D works. +// Tests that the copy assignment operator of test::Array2D works. TEST(Array2D, CopyAssignment) { size_t width = 5, height = 5; test::Array2D array_1{width, height}; @@ -62,7 +62,7 @@ TEST(Array2D, CopyAssignment) { EXPECT_NE(array_1.data(), array_2.data()); } -/// Tests that the move assignment operator of test::Array2D works. +// Tests that the move assignment operator of test::Array2D works. TEST(Array2D, MoveAssignment) { size_t width = 5, height = 5, channels = 3; test::Array2D array_1{width, height, 0, channels}; @@ -88,7 +88,7 @@ TEST(Array2D, MoveAssignment) { // hicpp-invalid-access-moved) } -/// Tests that test::Array2D.at() works for set/get. +// Tests that test::Array2D.at() works for set/get. TEST(Array2D, At) { size_t width = 1, height = 1; test::Array2D array{width, height}; @@ -103,7 +103,7 @@ TEST(Array2D, At) { EXPECT_EQ(const_array.at(0, 0)[0], 0); } -/// Tests that test::Array2D.set() works. +// Tests that test::Array2D.set() works. TEST(Array2D, Set) { size_t width = 5, height = 2; test::Array2D array_1{width, height}; @@ -122,7 +122,7 @@ TEST(Array2D, Set) { EXPECT_EQ(array_1.at(1, 0)[0], 11); } -/// Tests that test::Array2D.set() works for TwoDimensional instances. +// Tests that test::Array2D.set() works for TwoDimensional instances. TEST(Array2D, SetWithTwoDimensional) { using ElementType = uint32_t; @@ -183,7 +183,7 @@ TEST(Array2D, SetWithTwoDimensional) { EXPECT_EQ(array_2.at(4, 4)[0], 9); } -/// Tests that test::Array2D.fill() works. +// Tests that test::Array2D.fill() works. TEST(Array2D, Fill) { size_t width = 5, height = 2; test::Array2D array_1{width, height}; @@ -204,7 +204,7 @@ TEST(Array2D, Fill) { } } -/// Tests that test::Array2D.fill(Generator *) works. +// Tests that test::Array2D.fill(Generator *) works. TEST(Array2D, FillWithGenerator) { using ElementType = uint32_t; @@ -223,7 +223,7 @@ TEST(Array2D, FillWithGenerator) { EXPECT_EQ(array.at(1, 2)[0], 16); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for fully-equal objects. +// Tests that EXPECT_EQ_ARRAY2D() macro works for fully-equal objects. TEST(Array2D, ExpectEq_Equal) { size_t width = 5, height = 2; test::Array2D array_1{width, height}; @@ -231,8 +231,8 @@ TEST(Array2D, ExpectEq_Equal) { EXPECT_EQ_ARRAY2D(array_1, array_2); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for equal objects where stride is -/// different. +// Tests that EXPECT_EQ_ARRAY2D() macro works for equal objects where stride is +// different. TEST(Array2D, ExpectEq_Equal_StrideInvariant) { size_t width = 5, height = 2; test::Array2D array_1{width, height}; @@ -240,8 +240,8 @@ TEST(Array2D, ExpectEq_Equal_StrideInvariant) { EXPECT_EQ_ARRAY2D(array_1, array_2); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where width -/// is different. +// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where width +// is different. TEST(Array2D, ExpectEq_NotEqual_Width) { struct Test { static void test() { @@ -255,8 +255,8 @@ TEST(Array2D, ExpectEq_NotEqual_Width) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in width."); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where -/// height is different. +// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where +// height is different. TEST(Array2D, ExpectEq_NotEqual_Height) { struct Test { static void test() { @@ -270,8 +270,8 @@ TEST(Array2D, ExpectEq_NotEqual_Height) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in height."); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where -/// channels is different. +// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where +// channels is different. TEST(Array2D, ExpectEq_NotEqual_Channels) { struct Test { static void test() { @@ -285,8 +285,8 @@ TEST(Array2D, ExpectEq_NotEqual_Channels) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in channels."); } -/// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where data -/// is different. +// Tests that EXPECT_EQ_ARRAY2D() macro works for non-equal objects where data +// is different. TEST(Array2D, ExpectEq_NotEqual_Data) { struct Test { static void test() { @@ -301,7 +301,7 @@ TEST(Array2D, ExpectEq_NotEqual_Data) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch at (row=0, col=0): 0 vs 0x2a."); } -/// Tests that EXPECT_NE_ARRAY2D() macro works for equal objects. +// Tests that EXPECT_NE_ARRAY2D() macro works for equal objects. TEST(Array2D, ExpectNe_Equal) { struct Test { static void test() { @@ -316,8 +316,8 @@ TEST(Array2D, ExpectNe_Equal) { "Objects are equal, but expected to differ."); } -/// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where width -/// is different. +// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where width +// is different. TEST(Array2D, ExpectNe_NotEqual_Width) { struct Test { static void test() { @@ -331,8 +331,8 @@ TEST(Array2D, ExpectNe_NotEqual_Width) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in width."); } -/// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where -/// height is different. +// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where +// height is different. TEST(Array2D, ExpectNe_NotEqual_Height) { struct Test { static void test() { @@ -346,8 +346,8 @@ TEST(Array2D, ExpectNe_NotEqual_Height) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in height."); } -/// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where -/// channels is different. +// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where +// channels is different. TEST(Array2D, ExpectNe_NotEqual_Channels) { struct Test { static void test() { @@ -361,8 +361,8 @@ TEST(Array2D, ExpectNe_NotEqual_Channels) { EXPECT_FATAL_FAILURE(Test::test(), "Mismatch in channels."); } -/// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where there -/// is a difference in data. +// Tests that EXPECT_NE_ARRAY2D() macro works for non-equal objects where there +// is a difference in data. TEST(Array2D, ExpectNe_NotEqual_Data) { size_t width = 5, height = 2; test::Array2D array_1{width, height}; @@ -382,25 +382,25 @@ static void PaddingClobbered(size_t row, size_t offset) { ptr[row * stride + width * sizeof(ElementType) + offset] = 1; } -/// Tests that clobbering the first padding byte in the first row is caught. +// Tests that clobbering the first padding byte in the first row is caught. TEST(Array2D, PaddingClobbered_FirstRow_FirstByte) { EXPECT_FATAL_FAILURE(PaddingClobbered(0, 0), "Padding byte was overwritten at (row=0, offset=20)"); } -/// Tests that clobbering the last padding byte in the first row is caught. +// Tests that clobbering the last padding byte in the first row is caught. TEST(Array2D, PaddingClobbered_FirstRow_LastByte) { EXPECT_FATAL_FAILURE(PaddingClobbered(0, 9), "Padding byte was overwritten at (row=0, offset=29)"); } -/// Tests that clobbering the first padding byte in the last row is caught. +// Tests that clobbering the first padding byte in the last row is caught. TEST(Array2D, PaddingClobbered_LastRow_FirstByte) { EXPECT_FATAL_FAILURE(PaddingClobbered(1, 0), "Padding byte was overwritten at (row=1, offset=20)"); } -/// Tests that clobbering the last padding byte in the last row is caught. +// Tests that clobbering the last padding byte in the last row is caught. TEST(Array2D, PaddingClobbered_LastRow_LastByte) { EXPECT_FATAL_FAILURE(PaddingClobbered(1, 9), "Padding byte was overwritten at (row=1, offset=29)"); @@ -421,7 +421,7 @@ static void Array2DCoverageAtInvalidArray() { array.at(0, 0); } -/// Additional tests for coverage purposes. +// Additional tests for coverage purposes. TEST(Array2D, Coverage) { EXPECT_FATAL_FAILURE(Array2DCoverageBadAlloc(), "Failed to allocate memory of"); diff --git a/test/framework/test_border.cpp b/test/framework/test_border.cpp index ebbf03fc1e9e2e335525c1119649946cf4e0e9d2..ebdf2231e9a830ab9c224fbd010e57b08b2b40d6 100644 --- a/test/framework/test_border.cpp +++ b/test/framework/test_border.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -26,8 +26,8 @@ class ImplementsBorder : public test::Bordered { size_t bottom_; }; // end of class ImplementsBorder -/// Tests that replicate border strategy works for one channel and one bordering -/// element in every direction. +// Tests that replicate border strategy works for one channel and one bordering +// element in every direction. TEST(Border, Replicate_1Ch_1Element) { using ElementType = uint8_t; @@ -53,8 +53,8 @@ TEST(Border, Replicate_1Ch_1Element) { EXPECT_EQ_ARRAY2D(expected, actual); } -/// Tests that replicate border strategy works for one channel and two bordering -/// elements in every direction. +// Tests that replicate border strategy works for one channel and two bordering +// elements in every direction. TEST(Border, Replicate_1Ch_2Elements) { using ElementType = uint8_t; @@ -82,8 +82,8 @@ TEST(Border, Replicate_1Ch_2Elements) { EXPECT_EQ_ARRAY2D(expected, actual); } -/// Tests that replicate border strategy works for two channels and one -/// bordering element in every direction. +// Tests that replicate border strategy works for two channels and one +// bordering element in every direction. TEST(Border, Replicate_2Ch_1Element) { using ElementType = uint8_t; @@ -109,8 +109,8 @@ TEST(Border, Replicate_2Ch_1Element) { EXPECT_EQ_ARRAY2D(expected, actual); } -/// Tests that replicate border strategy works for two channels and two -/// bordering elements in every direction. +// Tests that replicate border strategy works for two channels and two +// bordering elements in every direction. TEST(Border, Replicate_2Ch_2Elements) { using ElementType = uint8_t; diff --git a/test/framework/test_generator.cpp b/test/framework/test_generator.cpp index fba3ac2a30e3b9a2ebdddf840749a94f2a30de9f..df977d9f4eb799e9fb153402f92d9b4fce4f688f 100644 --- a/test/framework/test_generator.cpp +++ b/test/framework/test_generator.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -9,7 +9,7 @@ #include "framework/generator.h" -/// Tests test::PseudoRandomNumberGenerator::reset() works. +// Tests test::PseudoRandomNumberGenerator::reset() works. TEST(PseudoRandomNumberGenerator, Reset) { using ElementType = uint8_t; @@ -21,7 +21,7 @@ TEST(PseudoRandomNumberGenerator, Reset) { EXPECT_EQ(initial_value, value); } -/// Tests test::SequenceGenerator::reset() works. +// Tests test::SequenceGenerator::reset() works. TEST(SequenceGenerator, Reset) { using ElementType = uint8_t; diff --git a/test/framework/test_kernel.cpp b/test/framework/test_kernel.cpp index 30b5f5018a2f8bd7df4756af4b3f40c25f02f54a..0d7709b2e7eeb5467491636bfc150c3a2907b467 100644 --- a/test/framework/test_kernel.cpp +++ b/test/framework/test_kernel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -10,8 +10,8 @@ #include "framework/kernel.h" #include "framework/types.h" -/// Tests that the constructor of test::Kernel works for odd width and -/// height. +// Tests that the constructor of test::Kernel works for odd width and +// height. TEST(Kernel, ConstructOdd) { using ElementType = uint8_t; @@ -42,8 +42,8 @@ TEST(Kernel, ConstructOdd) { EXPECT_EQ(kernel.at(2, 2)[0], 6); } -/// Tests that the constructor of test::Kernel works for even width and -/// height. +// Tests that the constructor of test::Kernel works for even width and +// height. TEST(Kernel, ConstructEven) { using ElementType = uint8_t; @@ -61,8 +61,8 @@ TEST(Kernel, ConstructEven) { EXPECT_EQ(kernel.right(), 1); } -/// Tests that the default constructor of test::Kernel works with all -/// zero arguments. +// Tests that the default constructor of test::Kernel works with all +// zero arguments. TEST(Kernel, ConstructEmpty) { using ElementType = uint8_t; @@ -163,7 +163,7 @@ const std::array, 2> }; // NOLINTEND(cert-err58-cpp) -/// Tests that KernelTest::test() works. +// Tests that KernelTest::test() works. TEST(KernelTest, Test) { test::SequenceGenerator tested_kernels{ ExampleKernelTest::kKernels}; diff --git a/test/framework/test_main.cpp b/test/framework/test_main.cpp index 6c515a33d4e2998589becce3a33c30f07663b0ce..a4d962e0204713273e927aa302115b08010114c7 100644 --- a/test/framework/test_main.cpp +++ b/test/framework/test_main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -16,7 +16,7 @@ namespace test { size_t Options::vector_length_{16}; uint64_t Options::seed_{0}; -/// Parses command line arguments. +// Parses command line arguments. static void parse_arguments(int argc, char **argv) { // clang-format off static struct option long_options[] = { diff --git a/test/framework/types.h b/test/framework/types.h index 10813a7aa9b464bb04e94fcedb32015d9491b216..a192b7285c1de12ed0b1d507b40e854a0b583413 100644 --- a/test/framework/types.h +++ b/test/framework/types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -9,14 +9,14 @@ namespace test { -/// Represents a point with two non-negative coordinates where 'x' is the -/// horizontal and 'y' is the vertical component. +// Represents a point with two non-negative coordinates where 'x' is the +// horizontal and 'y' is the vertical component. struct Point { size_t x; size_t y; }; // end of struct Point -/// Describes the layout of a two-dimensional array. +// Describes the layout of a two-dimensional array. struct ArrayLayout { size_t width; size_t height; diff --git a/test/framework/utils.h b/test/framework/utils.h index a24f0602fdcfe151367775cc8210dd67e8521650..a9ed38cb08379ffddbe52b349752f50dd2ba1873 100644 --- a/test/framework/utils.h +++ b/test/framework/utils.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2023 - 2024 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -41,20 +41,20 @@ namespace test { class Options { public: - /// Returns the vector length being tested. This is in bytes. + // Returns the vector length being tested. This is in bytes. static size_t vector_length() { return vector_length_; } - /// Returns seed to use. + // Returns seed to use. static uint64_t seed() { return seed_; } - /// Returns the number of lanes in a vector for a given integral type. + // Returns the number of lanes in a vector for a given integral type. template , bool> = true> static size_t vector_lanes() { return vector_length_ / sizeof(ElementType); } - /// Sets the vector length in bytes. + // Sets the vector length in bytes. static void set_vector_length(size_t value) { // Check for power of two. if ((value == 0) || ((value & (value - 1)) != 0)) { @@ -66,21 +66,21 @@ class Options { vector_length_ = value; } - /// Sets the seed. + // Sets the seed. static void set_seed(uint64_t value) { seed_ = value; } private: - /// Vector length being tested. + // Vector length being tested. static size_t vector_length_; - /// Seed to use. + // Seed to use. static uint64_t seed_; }; // end of class Options -/// Prints all the elements in a two-dimensional space. +// Prints all the elements in a two-dimensional space. template void dump(const TwoDimensional *elements); -/// Returns an array of default tested layouts. +// Returns an array of default tested layouts. std::array default_array_layouts(size_t min_width, size_t min_height);