diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2021-02-08 16:31:10 +0000 |
---|---|---|
committer | Giorgio Arena <giorgio.arena@arm.com> | 2021-03-02 09:03:00 +0000 |
commit | 68e29dab4ada6e3457f066c3cf45acf51a204dd9 (patch) | |
tree | a920ebfb51ba39f7b015c919d4e65d71ffbf94be /tests/validation/Validation.h | |
parent | c1b9b098518211d6f356650a0ce5022a36c623e9 (diff) | |
download | ComputeLibrary-68e29dab4ada6e3457f066c3cf45acf51a204dd9.tar.gz |
Set up configure-only flag for validation. First trial with DepthwiseConvoltion
This is needed in order to validate OpenCL kernel run-time compilation, without necessarily running or validating the kernels' execution
- Add a run-time option for our validation suite to only configure one target function, without allocating, running or validating
- Avoid to map/unmap tensors in CLAccessor if no allocation/validation is required
- Create a new Fixture macro that accepts fixtures split into configure/allocate_and_run/reference, and do the last two only if required
- Adjust fixture and validation files for the first trial function(s) (DepthwiseConvolutionLayer)
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Change-Id: I56fa1ce5ef4ac0c86bcabda686cc277ef5ec69c8
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5048
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Diffstat (limited to 'tests/validation/Validation.h')
-rw-r--r-- | tests/validation/Validation.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/validation/Validation.h b/tests/validation/Validation.h index 2d8d5b3c1f..d356f05b70 100644 --- a/tests/validation/Validation.h +++ b/tests/validation/Validation.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -380,6 +380,11 @@ void validate_wrap(const IAccessor &tensor, const SimpleTensor<T> &reference, U template <typename T, typename U> void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value, float tolerance_number, float absolute_tolerance_value) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + uint64_t num_mismatches = 0; uint64_t num_elements = 0; @@ -455,6 +460,11 @@ void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const V template <typename T, typename U, typename = typename std::enable_if<std::is_integral<T>::value>::type> void validate_wrap(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value, float tolerance_number) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + uint64_t num_mismatches = 0; uint64_t num_elements = 0; @@ -543,6 +553,11 @@ void validate_wrap(const IAccessor &tensor, const SimpleTensor<T> &reference, co template <typename T, typename U> void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const SimpleTensor<T> &valid_mask, U tolerance_value, float tolerance_number, float absolute_tolerance_value) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + uint64_t num_mismatches = 0; uint64_t num_elements = 0; @@ -622,6 +637,11 @@ void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const S template <typename T, typename U> bool validate(T target, T reference, U tolerance) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return true; + } + ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << framework::make_printable(reference)); ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << framework::make_printable(target)); ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << framework::make_printable(static_cast<typename U::value_type>(tolerance))); @@ -636,6 +656,11 @@ bool validate(T target, T reference, U tolerance) template <typename T, typename U> void validate_min_max_loc(const MinMaxLocationValues<T> &target, const MinMaxLocationValues<U> &reference) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + ARM_COMPUTE_EXPECT_EQUAL(target.min, reference.min, framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT_EQUAL(target.max, reference.max, framework::LogLevel::ERRORS); @@ -745,6 +770,11 @@ std::pair<int64_t, int64_t> compare_keypoints(T first1, T last1, U first2, U las template <typename T, typename U, typename V> void validate_keypoints(T target_first, T target_last, U reference_first, U reference_last, V tolerance, float allowed_missing_percentage, float allowed_mismatch_percentage) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + const int64_t num_elements_target = std::distance(target_first, target_last); const int64_t num_elements_reference = std::distance(reference_first, reference_last); @@ -825,6 +855,11 @@ template <typename T, typename U, typename V> void validate_detection_windows(T target_first, T target_last, U reference_first, U reference_last, V tolerance, float allowed_missing_percentage, float allowed_mismatch_percentage) { + if(framework::Framework::get().configure_only() && framework::Framework::get().new_fixture_call()) + { + return; + } + const int64_t num_elements_target = std::distance(target_first, target_last); const int64_t num_elements_reference = std::distance(reference_first, reference_last); |