| 88 | TEST_SUITE(Pooling3dLayer) |
| 89 | |
| 90 | TEST_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 |
nothing calls this directly
no test coverage detected