| 174 | } |
| 175 | |
| 176 | Status 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 | |
| 189 | void CLTensorAllocator::set_associated_memory_group(IMemoryGroup *associated_memory_group) |
| 190 | { |
no test coverage detected