| 157 | } |
| 158 | |
| 159 | Status TensorAllocator::import_memory(void *memory) |
| 160 | { |
| 161 | ARM_COMPUTE_RETURN_ERROR_ON(memory == nullptr); |
| 162 | ARM_COMPUTE_RETURN_ERROR_ON(_associated_memory_group != nullptr); |
| 163 | ARM_COMPUTE_RETURN_ERROR_ON(alignment() != 0 && !arm_compute::utility::check_aligned(memory, alignment())); |
| 164 | |
| 165 | _memory.set_owned_region(std::make_unique<MemoryRegion>(memory, info().total_size())); |
| 166 | info().set_is_resizable(false); |
| 167 | |
| 168 | return Status{}; |
| 169 | } |
| 170 | |
| 171 | void TensorAllocator::set_associated_memory_group(IMemoryGroup *associated_memory_group) |
| 172 | { |
no test coverage detected