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

Method import_memory

src/runtime/CL/CLTensorAllocator.cpp:176–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176Status CLTensorAllocator::import_memory(cl::Buffer buffer)
177{
178 ARM_COMPUTE_RETURN_ERROR_ON(buffer.get() == nullptr);
179 ARM_COMPUTE_RETURN_ERROR_ON(buffer.getInfo<CL_MEM_SIZE>() < info().total_size());
180 ARM_COMPUTE_RETURN_ERROR_ON(buffer.getInfo<CL_MEM_CONTEXT>().get() != CLScheduler::get().context().get());
181 ARM_COMPUTE_RETURN_ERROR_ON(_associated_memory_group != nullptr);
182
183 _memory.set_owned_region(std::make_unique<CLBufferMemoryRegion>(buffer));
184
185 info().set_is_resizable(false);
186 return Status{};
187}
188
189void CLTensorAllocator::set_associated_memory_group(IMemoryGroup *associated_memory_group)
190{

Callers 2

runMethod · 0.45
runMethod · 0.45

Calls 5

infoClass · 0.85
contextMethod · 0.80
getMethod · 0.45
total_sizeMethod · 0.45
set_owned_regionMethod · 0.45

Tested by

no test coverage detected