| 93 | }; |
| 94 | |
| 95 | void run_conv2d(std::shared_ptr<IMemoryManager> mm, IAllocator &mm_allocator) |
| 96 | { |
| 97 | // Create tensors |
| 98 | CLTensor src, weights, bias, dst; |
| 99 | src.allocator()->init(TensorInfo(TensorShape(16U, 32U, 32U, 2U), 1, DataType::F32, DataLayout::NHWC)); |
| 100 | weights.allocator()->init(TensorInfo(TensorShape(16U, 3U, 3U, 32U), 1, DataType::F32, DataLayout::NHWC)); |
| 101 | bias.allocator()->init(TensorInfo(TensorShape(32U), 1, DataType::F32, DataLayout::NHWC)); |
| 102 | dst.allocator()->init(TensorInfo(TensorShape(32U, 32U, 32U, 2U), 1, DataType::F32, DataLayout::NHWC)); |
| 103 | |
| 104 | // Create and configure function |
| 105 | CLGEMMConvolutionLayer conv(mm); |
| 106 | conv.configure(&src, &weights, &bias, &dst, PadStrideInfo(1U, 1U, 1U, 1U)); |
| 107 | |
| 108 | // Allocate tensors |
| 109 | src.allocator()->allocate(); |
| 110 | weights.allocator()->allocate(); |
| 111 | bias.allocator()->allocate(); |
| 112 | dst.allocator()->allocate(); |
| 113 | |
| 114 | // Finalize memory manager |
| 115 | if (mm != nullptr) |
| 116 | { |
| 117 | mm->populate(mm_allocator, 1 /* num_pools */); |
| 118 | ARM_COMPUTE_EXPECT(mm->lifetime_manager()->are_all_finalized(), framework::LogLevel::ERRORS); |
| 119 | ARM_COMPUTE_EXPECT(mm->pool_manager()->num_pools() == 1, framework::LogLevel::ERRORS); |
| 120 | } |
| 121 | |
| 122 | conv.run(); |
| 123 | } |
| 124 | } // namespace |
| 125 | |
| 126 | TEST_SUITE(CL) |
no test coverage detected