From 63e5041e6ea0f7fb57a1cc349f1325785fa800fa Mon Sep 17 00:00:00 2001 From: John Richardson Date: Fri, 13 Oct 2017 20:51:42 +0100 Subject: COMPMID-576: Port Phase to new validation Change-Id: Ice08031c997cf8162a4358deb059db857ede2382 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93585 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/runtime/NEON/functions/NEPhase.h | 9 +- src/runtime/NEON/functions/NEPhase.cpp | 17 +++- tests/validation/CL/Phase.cpp | 114 +++++++++++++++++++++++++ tests/validation/CPP/Phase.cpp | 91 ++++++++++++++++++++ tests/validation/CPP/Phase.h | 43 ++++++++++ tests/validation/NEON/Phase.cpp | 97 +++++++++++++++++++++ tests/validation/fixtures/PhaseFixture.h | 122 +++++++++++++++++++++++++++ utils/TypePrinter.h | 25 ++++++ 8 files changed, 510 insertions(+), 8 deletions(-) create mode 100644 tests/validation/CL/Phase.cpp create mode 100644 tests/validation/CPP/Phase.cpp create mode 100644 tests/validation/CPP/Phase.h create mode 100644 tests/validation/NEON/Phase.cpp create mode 100644 tests/validation/fixtures/PhaseFixture.h diff --git a/arm_compute/runtime/NEON/functions/NEPhase.h b/arm_compute/runtime/NEON/functions/NEPhase.h index 985ba84c4c..cd62cf98e8 100644 --- a/arm_compute/runtime/NEON/functions/NEPhase.h +++ b/arm_compute/runtime/NEON/functions/NEPhase.h @@ -36,11 +36,12 @@ class NEPhase : public INESimpleFunction public: /** Initialise the kernel's inputs, output. * - * @param[in] input1 First tensor input. Data type supported: S16. - * @param[in] input2 Second tensor input. Data type supported: S16. - * @param[out] output Output tensor. Data type supported: U8. + * @param[in] input1 First tensor input. Data type supported: S16. + * @param[in] input2 Second tensor input. Data type supported: S16. + * @param[out] output Output tensor. Data type supported: U8. + * @param[in] phase_type (Optional) Phase calculation type. Default: SIGNED. */ - void configure(const ITensor *input1, const ITensor *input2, ITensor *output); + void configure(const ITensor *input1, const ITensor *input2, ITensor *output, PhaseType phase_type = PhaseType::SIGNED); }; } #endif /*__ARM_COMPUTE_NEPHASE_H__ */ diff --git a/src/runtime/NEON/functions/NEPhase.cpp b/src/runtime/NEON/functions/NEPhase.cpp index 436d22f3af..63922811d9 100644 --- a/src/runtime/NEON/functions/NEPhase.cpp +++ b/src/runtime/NEON/functions/NEPhase.cpp @@ -30,9 +30,18 @@ using namespace arm_compute; -void NEPhase::configure(const ITensor *input1, const ITensor *input2, ITensor *output) +void NEPhase::configure(const ITensor *input1, const ITensor *input2, ITensor *output, PhaseType phase_type) { - auto k = arm_compute::support::cpp14::make_unique>(); - k->configure(input1, input2, nullptr, output); - _kernel = std::move(k); + if(phase_type == PhaseType::UNSIGNED) + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, nullptr, output); + _kernel = std::move(k); + } + else + { + auto k = arm_compute::support::cpp14::make_unique>(); + k->configure(input1, input2, nullptr, output); + _kernel = std::move(k); + } } diff --git a/tests/validation/CL/Phase.cpp b/tests/validation/CL/Phase.cpp new file mode 100644 index 0000000000..3cb6f68e1a --- /dev/null +++ b/tests/validation/CL/Phase.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/runtime/CL/functions/CLPhase.h" +#include "tests/CL/CLAccessor.h" +#include "tests/PaddingCalculator.h" +#include "tests/datasets/ShapeDatasets.h" +#include "tests/framework/Asserts.h" +#include "tests/framework/Macros.h" +#include "tests/framework/datasets/Datasets.h" +#include "tests/validation/Validation.h" +#include "tests/validation/fixtures/PhaseFixture.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace +{ +constexpr AbsoluteTolerance tolerance_value(1); +} // namespace + +TEST_SUITE(CL) +TEST_SUITE(Phase) + +DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", { DataType::S16, DataType::S32 })), + shape, data_type) +{ + // Create tensors + CLTensor src1 = create_tensor(shape, data_type); + CLTensor src2 = create_tensor(shape, data_type); + CLTensor dst = create_tensor(shape, DataType::U8); + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + CLPhase phase; + phase.configure(&src1, &src2, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(shape); + validate(dst.info()->valid_region(), valid_region); + + // Validate padding + const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); + validate(src1.info()->padding(), padding); + validate(src2.info()->padding(), padding); + validate(dst.info()->padding(), padding); +} + +template +using CLPhaseFixture = PhaseValidationFixture; + +TEST_SUITE(S16) +FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S16)), + framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) +{ + // Validate output + validate_wrap(CLAccessor(_target), _reference, tolerance_value, 0); +} + +FIXTURE_DATA_TEST_CASE(RunLarge, CLPhaseFixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), framework::dataset::make("Format", Format::S16)), + framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) +{ + // Validate output + validate_wrap(CLAccessor(_target), _reference, tolerance_value, 0); +} +TEST_SUITE_END() // S16 + +TEST_SUITE(S32) +FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S32)), + framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) +{ + // Validate output + validate_wrap(CLAccessor(_target), _reference, tolerance_value, 0); +} + +FIXTURE_DATA_TEST_CASE(RunLarge, CLPhaseFixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), framework::dataset::make("Format", Format::S32)), + framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) +{ + // Validate output + validate_wrap(CLAccessor(_target), _reference, tolerance_value, 0); +} +TEST_SUITE_END() // S32 + +TEST_SUITE_END() +TEST_SUITE_END() +} // namespace validation +} // namespace test +} // namespace arm_compute diff --git a/tests/validation/CPP/Phase.cpp b/tests/validation/CPP/Phase.cpp new file mode 100644 index 0000000000..4311ef091e --- /dev/null +++ b/tests/validation/CPP/Phase.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "Phase.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace reference +{ +template +SimpleTensor phase(const SimpleTensor &gx, const SimpleTensor &gy, PhaseType phase_type) +{ + const float pi = std::atan(1) * 4; + const float rad_to_deg = 180.0f / pi; + const float scale_factor = 128.f / 180.f; + const float epsilon = 1e-9f; // used to avoid division by zero + + const float ninety = scale_factor * 90.f; + const float one_eighty = scale_factor * 180.f; + const float two_seventy = scale_factor * 270.f; + + // unsigned: map to [0-255) + // signed: map to [0-180) degrees + const float scale = (phase_type == PhaseType::UNSIGNED) ? rad_to_deg : rad_to_deg * scale_factor; + + SimpleTensor phase(gx.shape(), DataType::U8); + + for(int i = 0; i < gx.num_elements(); ++i) + { + bool quad_two = std::signbit(gx[i]) && !std::signbit(gy[i]); + bool quad_three = std::signbit(gx[i]) && std::signbit(gy[i]); + bool quad_four = !std::signbit(gx[i]) && std::signbit(gy[i]); + + float x = gy[i] / (gx[i] + epsilon); + double arctan = std::atan(x); + + const bool is_negative = std::signbit(arctan); + + // Radians to degrees conversion with applied scale factor + arctan = arctan * scale; + + if(phase_type == PhaseType::UNSIGNED) + { + arctan = is_negative ? arctan + 180.f : arctan; + } + else + { + arctan = is_negative ? arctan + ninety : arctan; + + // Choose correct quandrant + arctan = quad_two ? ninety + arctan : arctan; + arctan = quad_three ? one_eighty + arctan : arctan; + arctan = quad_four ? two_seventy + arctan : arctan; + } + + phase[i] = saturate_cast(arctan + 0.5f); + } + + return phase; +} + +template SimpleTensor phase(const SimpleTensor &gx, const SimpleTensor &gy, PhaseType phase_type); +template SimpleTensor phase(const SimpleTensor &gx, const SimpleTensor &gy, PhaseType phase_type); +} // namespace reference +} // namespace validation +} // namespace test +} // namespace arm_compute diff --git a/tests/validation/CPP/Phase.h b/tests/validation/CPP/Phase.h new file mode 100644 index 0000000000..d322d53e02 --- /dev/null +++ b/tests/validation/CPP/Phase.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_PHASE_H__ +#define __ARM_COMPUTE_TEST_PHASE_H__ + +#include "tests/SimpleTensor.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace reference +{ +template +SimpleTensor phase(const SimpleTensor &gx, const SimpleTensor &gy, PhaseType phase_type); +} // namespace reference +} // namespace validation +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_PHASE_H__ */ diff --git a/tests/validation/NEON/Phase.cpp b/tests/validation/NEON/Phase.cpp new file mode 100644 index 0000000000..8e2ef23ccc --- /dev/null +++ b/tests/validation/NEON/Phase.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#include "arm_compute/runtime/NEON/functions/NEPhase.h" +#include "tests/NEON/Accessor.h" +#include "tests/PaddingCalculator.h" +#include "tests/datasets/ShapeDatasets.h" +#include "tests/framework/Asserts.h" +#include "tests/framework/Macros.h" +#include "tests/framework/datasets/Datasets.h" +#include "tests/validation/Validation.h" +#include "tests/validation/fixtures/PhaseFixture.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace +{ +constexpr AbsoluteTolerance tolerance_value(1); +} // namespace + +TEST_SUITE(NEON) +TEST_SUITE(Phase) + +DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::S16)), shape, data_type) +{ + // Create tensors + Tensor src1 = create_tensor(shape, data_type); + Tensor src2 = create_tensor(shape, data_type); + Tensor dst = create_tensor(shape, DataType::U8); + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + NEPhase phase; + phase.configure(&src1, &src2, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(shape); + validate(dst.info()->valid_region(), valid_region); + + // Validate padding + const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); + validate(src1.info()->padding(), padding); + validate(src2.info()->padding(), padding); + validate(dst.info()->padding(), padding); +} + +template +using NEPhaseFixture = PhaseValidationFixture; + +TEST_SUITE(S16) +FIXTURE_DATA_TEST_CASE(RunSmall, NEPhaseFixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S16)), + framework::dataset::make("PhaseType", { PhaseType::UNSIGNED, PhaseType::SIGNED }))) +{ + // Validate output + validate_wrap(Accessor(_target), _reference, tolerance_value, 0); +} + +FIXTURE_DATA_TEST_CASE(RunLarge, NEPhaseFixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), framework::dataset::make("Format", Format::S16)), + framework::dataset::make("PhaseType", { PhaseType::UNSIGNED, PhaseType::SIGNED }))) +{ + // Validate output + validate_wrap(Accessor(_target), _reference, tolerance_value, 0); +} +TEST_SUITE_END() // S16 + +TEST_SUITE_END() +TEST_SUITE_END() +} // namespace validation +} // namespace test +} // namespace arm_compute diff --git a/tests/validation/fixtures/PhaseFixture.h b/tests/validation/fixtures/PhaseFixture.h new file mode 100644 index 0000000000..693a61ed1a --- /dev/null +++ b/tests/validation/fixtures/PhaseFixture.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_PHASE_FIXTURE +#define ARM_COMPUTE_TEST_PHASE_FIXTURE + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" +#include "tests/Globals.h" +#include "tests/IAccessor.h" +#include "tests/framework/Asserts.h" +#include "tests/framework/Fixture.h" +#include "tests/validation/CPP/Phase.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +template +class PhaseValidationFixture : public framework::Fixture +{ +public: + template + void setup(TensorShape shape, Format format, PhaseType phase_type) + { + _target = compute_target(shape, format, phase_type); + _reference = compute_reference(shape, format, phase_type); + } + +protected: + template + void fill(U &&tensor, std::random_device::result_type seed_offset) + { + library->fill_tensor_uniform(tensor, seed_offset); + } + + TensorType compute_target(const TensorShape &shape, Format format, PhaseType phase_type) + { + DataType data_type = data_type_from_format(format); + + // Create tensors + TensorType src1 = create_tensor(shape, data_type); + src1.info()->set_format(format); + + TensorType src2 = create_tensor(shape, data_type); + src2.info()->set_format(format); + + TensorType dst = create_tensor(shape, DataType::U8); + dst.info()->set_format(Format::U8); + + // Create and configure function + FunctionType phase; + + phase.configure(&src1, &src2, &dst, phase_type); + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Allocate tensors + src1.allocator()->allocate(); + src2.allocator()->allocate(); + dst.allocator()->allocate(); + + ARM_COMPUTE_EXPECT(!src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(!src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Fill tensors + fill(AccessorType(src1), 0); + fill(AccessorType(src2), 1); + + // Compute function + phase.run(); + + return dst; + } + + SimpleTensor compute_reference(const TensorShape &shape, Format format, PhaseType phase_type) + { + DataType data_type = data_type_from_format(format); + + // Create reference + SimpleTensor src1{ shape, data_type }; + SimpleTensor src2{ shape, data_type }; + + // Fill reference + fill(src1, 0); + fill(src2, 1); + + return reference::phase(src1, src2, phase_type); + } + + TensorType _target{}; + SimpleTensor _reference{}; +}; +} // namespace validation +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_PHASE_FIXTURE */ diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index de7eaf8b3d..ec373742ea 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -714,5 +714,30 @@ inline ::std::ostream &operator<<(::std::ostream &os, const KeyPoint &point) return os; } + +/** Formatted output of the PhaseType type. */ +inline ::std::ostream &operator<<(::std::ostream &os, const PhaseType &phase_type) +{ + switch(phase_type) + { + case PhaseType::SIGNED: + os << "SIGNED"; + break; + case PhaseType::UNSIGNED: + os << "UNSIGNED"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + + return os; +} + +inline std::string to_string(const arm_compute::PhaseType &type) +{ + std::stringstream str; + str << type; + return str.str(); +} } // namespace arm_compute #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */ -- cgit v1.2.1