| 110 | TEST_SUITE(Pooling3dLayer) |
| 111 | |
| 112 | TEST_CASE(SimpleIntegerAvgPooling, framework::DatasetMode::ALL) |
| 113 | { |
| 114 | const auto pool_info = |
| 115 | Pooling3dLayerInfo(PoolingType::AVG, Size3D(1, 1, 1), Size3D(1, 1, 1), Padding3D(), true /* exclude padding */); |
| 116 | const auto shape = TensorShape(18U, 1U, 1U, 1U); // > 16 for channel dim. to stress vector and leftover loops |
| 117 | const auto dtype = DataType::QASYMM8_SIGNED; |
| 118 | const auto layout = DataLayout::NDHWC; |
| 119 | const auto qinfo = QuantizationInfo(1.f, 0); |
| 120 | |
| 121 | Tensor input = create_tensor<Tensor>(shape, dtype, 1, qinfo, layout); |
| 122 | Tensor output = create_tensor<Tensor>(shape, dtype, 1, qinfo, layout); |
| 123 | |
| 124 | NEPooling3dLayer pool; |
| 125 | pool.configure(&input, &output, pool_info); |
| 126 | |
| 127 | input.allocator()->allocate(); |
| 128 | output.allocator()->allocate(); |
| 129 | |
| 130 | std::vector<int8_t> values = {-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8}; |
| 131 | |
| 132 | ARM_COMPUTE_EXPECT(values.size() == shape.x(), framework::LogLevel::ERRORS); |
| 133 | |
| 134 | library->fill_static_values(Accessor(input), values); |
| 135 | |
| 136 | pool.run(); |
| 137 | for (unsigned int i = 0; i < values.size(); ++i) |
| 138 | { |
| 139 | const int8_t ref = values[i]; |
| 140 | const int8_t target = reinterpret_cast<int8_t *>(output.buffer())[i]; |
| 141 | ARM_COMPUTE_EXPECT(ref == target, framework::LogLevel::ERRORS); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | // *INDENT-OFF* |
| 146 | // clang-format off |
nothing calls this directly
no test coverage detected