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

Function run_conv2d

tests/validation/CL/UNIT/TensorAllocator.cpp:95–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93};
94
95void 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
126TEST_SUITE(CL)

Callers 1

TEST_CASEFunction · 0.85

Calls 13

PadStrideInfoClass · 0.85
are_all_finalizedMethod · 0.80
lifetime_managerMethod · 0.80
num_poolsMethod · 0.80
pool_managerMethod · 0.80
TensorInfoClass · 0.50
TensorShapeClass · 0.50
initMethod · 0.45
allocatorMethod · 0.45
configureMethod · 0.45
allocateMethod · 0.45
populateMethod · 0.45

Tested by

no test coverage detected