MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / validate_min_max_loc

Function validate_min_max_loc

tests/validation/Validation.h:732–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730
731template <typename T, typename U>
732void validate_min_max_loc(const MinMaxLocationValues<T> &target, const MinMaxLocationValues<U> &reference)
733{
734 if (framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call())
735 {
736 return;
737 }
738
739 ARM_COMPUTE_EXPECT_EQUAL(target.min, reference.min, framework::LogLevel::ERRORS);
740 ARM_COMPUTE_EXPECT_EQUAL(target.max, reference.max, framework::LogLevel::ERRORS);
741
742 ARM_COMPUTE_EXPECT_EQUAL(target.min_loc.size(), reference.min_loc.size(), framework::LogLevel::ERRORS);
743 ARM_COMPUTE_EXPECT_EQUAL(target.max_loc.size(), reference.max_loc.size(), framework::LogLevel::ERRORS);
744
745 for (uint32_t i = 0; i < target.min_loc.size(); ++i)
746 {
747 const auto same_coords =
748 std::find_if(reference.min_loc.begin(), reference.min_loc.end(),
749 [&target, i](Coordinates2D coord)
750 { return coord.x == target.min_loc.at(i).x && coord.y == target.min_loc.at(i).y; });
751
752 ARM_COMPUTE_EXPECT(same_coords != reference.min_loc.end(), framework::LogLevel::ERRORS);
753 }
754
755 for (uint32_t i = 0; i < target.max_loc.size(); ++i)
756 {
757 const auto same_coords =
758 std::find_if(reference.max_loc.begin(), reference.max_loc.end(),
759 [&target, i](Coordinates2D coord)
760 { return coord.x == target.max_loc.at(i).x && coord.y == target.max_loc.at(i).y; });
761
762 ARM_COMPUTE_EXPECT(same_coords != reference.max_loc.end(), framework::LogLevel::ERRORS);
763 }
764}
765} // namespace validation
766} // namespace test
767} // namespace arm_compute

Callers

nothing calls this directly

Calls 5

configure_onlyMethod · 0.80
new_fixture_callMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected