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

Method allocate

src/runtime/CL/CLTensorAllocator.cpp:131–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void CLTensorAllocator::allocate()
132{
133 // Allocate tensor backing memory
134 if (_associated_memory_group == nullptr)
135 {
136 // Perform memory allocation
137 if (static_global_cl_allocator != nullptr)
138 {
139 _memory.set_owned_region(static_global_cl_allocator->make_region(info().total_size(), 0));
140 }
141 else
142 {
143 _memory.set_owned_region(allocate_region(info().total_size(), 0));
144 }
145 }
146 else
147 {
148 // Finalize memory management instead
149 _associated_memory_group->finalize_memory(_owner, _memory, info().total_size(), alignment());
150 }
151
152 // Allocate and fill the quantization parameter arrays
153 if (is_data_type_quantized_per_channel(info().data_type()))
154 {
155 const size_t pad_size = 0;
156 populate_quantization_info(_scale, _offset, info().quantization_info(), pad_size);
157 }
158
159 // Lock allocator
160 info().set_is_resizable(false);
161}
162
163void CLTensorAllocator::free()
164{

Callers

nothing calls this directly

Calls 10

infoClass · 0.85
allocate_regionFunction · 0.85
finalize_memoryMethod · 0.80
set_owned_regionMethod · 0.45
make_regionMethod · 0.45
total_sizeMethod · 0.45
data_typeMethod · 0.45
quantization_infoMethod · 0.45

Tested by

no test coverage detected