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

Function TEST_CASE

tests/validation/CL/Pooling3dLayer.cpp:90–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88TEST_SUITE(Pooling3dLayer)
89
90TEST_CASE(RoundToNearestInteger, framework::DatasetMode::ALL)
91{
92 const auto pool_info =
93 Pooling3dLayerInfo(PoolingType::AVG, Size3D(3, 1, 1), Size3D(1, 1, 1), Padding3D(), true /* exclude padding */);
94
95 const auto shape = TensorShape(1U, 3U, 1U, 1U);
96 const auto output_shape = TensorShape(1U, 1U, 1U, 1U);
97
98 const auto dtype = DataType::QASYMM8_SIGNED;
99 const auto layout = DataLayout::NDHWC;
100 const auto qinfo = QuantizationInfo(1.f, 0);
101
102 CLTensor input = create_tensor<CLTensor>(shape, dtype, 1, qinfo, layout);
103 CLTensor output = create_tensor<CLTensor>(output_shape, dtype, 1, qinfo, layout);
104
105 CLPooling3dLayer pool;
106 pool.configure(&input, &output, pool_info);
107
108 input.allocator()->allocate();
109 output.allocator()->allocate();
110
111 std::vector<int8_t> values = {-10, -10, -9};
112 std::vector<int8_t> refs = {-10};
113
114 ARM_COMPUTE_EXPECT(values.size() == shape.total_size(), framework::LogLevel::ERRORS);
115
116 library->fill_static_values(CLAccessor(input), values);
117
118 pool.run();
119
120 output.map(true);
121 for (unsigned int i = 0; i < refs.size(); ++i)
122 {
123 const int8_t ref = refs[i];
124 const int8_t target = reinterpret_cast<int8_t *>(output.buffer())[i];
125
126 ARM_COMPUTE_EXPECT(ref == target, framework::LogLevel::ERRORS);
127 }
128
129 output.unmap();
130}
131
132// *INDENT-OFF*
133// clang-format off

Callers

nothing calls this directly

Calls 15

Pooling3dLayerInfoClass · 0.85
Size3DClass · 0.85
Padding3DClass · 0.85
CLAccessorClass · 0.85
fill_static_valuesMethod · 0.80
TensorShapeClass · 0.50
QuantizationInfoClass · 0.50
configureMethod · 0.45
allocateMethod · 0.45
allocatorMethod · 0.45
sizeMethod · 0.45
total_sizeMethod · 0.45

Tested by

no test coverage detected