X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=documentation%2F_mean_std_dev_fixture_8h_source.xhtml;h=57ff459aebbaa4fe53b164e6ec10f55171d770e0;hb=c3f34a43ffb5d52ee4a4e9f7b1bf4c6c002aeebb;hp=15afae6114c59a315251c2396b70b23f32b2b661;hpb=06ea048f062a50404b1b3998a61a45449c2d1f0f;p=platform%2Fupstream%2Farmcl.git diff --git a/documentation/_mean_std_dev_fixture_8h_source.xhtml b/documentation/_mean_std_dev_fixture_8h_source.xhtml index 15afae6..57ff459 100644 --- a/documentation/_mean_std_dev_fixture_8h_source.xhtml +++ b/documentation/_mean_std_dev_fixture_8h_source.xhtml @@ -40,7 +40,7 @@
Compute Library -  18.02 +  18.03
@@ -119,9 +119,9 @@ $(document).ready(function(){initNavTree('_mean_std_dev_fixture_8h_source.xhtml'
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 ARM Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef ARM_COMPUTE_TEST_MEAN_STD_DEV_FIXTURE
25 #define ARM_COMPUTE_TEST_MEAN_STD_DEV_FIXTURE
26 
27 #include "tests/Globals.h"
31 
32 namespace arm_compute
33 {
34 namespace test
35 {
36 namespace validation
37 {
38 template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
40 {
41 public:
42  template <typename...>
44  {
45  _target = compute_target(shape, data_type);
46  _reference = compute_reference(shape, data_type);
47  }
48 
49 protected:
50  template <typename U>
51  void fill(U &&tensor)
52  {
53  library->fill_tensor_uniform(tensor, 0);
54  }
55 
56  std::pair<float, float> compute_target(const TensorShape &shape, DataType data_type)
57  {
58  // Create tensors
59  TensorType src = create_tensor<TensorType>(shape, data_type);
60 
61  // Create output variables
62  float mean = 0.0f;
63  float std_dev = 0.0f;
64 
65  // Create and configure function
66  FunctionType mean_std_dev;
67  mean_std_dev.configure(&src, &mean, &std_dev);
68 
69  ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
70 
71  // Allocate tensors
72  src.allocator()->allocate();
73  ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
74 
75  // Fill tensors
76  fill(AccessorType(src));
77 
78  // Compute function
79  mean_std_dev.run();
80 
81  return std::make_pair(mean, std_dev);
82  }
83 
84  std::pair<float, float> compute_reference(const TensorShape &shape, DataType data_type)
85  {
86  // Create reference
87  SimpleTensor<T> src{ shape, data_type };
88 
89  // Fill reference
90  fill(src);
91 
92  // Compute reference
93  return reference::mean_and_standard_deviation<T>(src);
94  }
95 
96  std::pair<float, float> _target{};
97  std::pair<float, float> _reference{};
98 };
99 } // namespace validation
100 } // namespace test
101 } // namespace arm_compute
102 #endif /* ARM_COMPUTE_TEST_MEAN_STD_DEV_FIXTURE */
Shape of a tensor.
Definition: TensorShape.h:39
-
This file contains all available output stages for GEMMLowp on OpenCL.
Definition: 01_library.dox:1
+
This file contains all available output stages for GEMMLowp on OpenCL.
Abstract fixture class.
Definition: Fixture.h:37
- +
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:59
@@ -141,7 +141,7 @@ $(document).ready(function(){initNavTree('_mean_std_dev_fixture_8h_source.xhtml'