17#ifdef USE_STATIC_ALLOC
19#include "StaticMemoryManager.h"
26 assert(_buffer_ptr !=
nullptr);
27 return _buffer_ptr +
offset;
30uint8_t *StaticMemoryManager::allocate_memory_for_input(int32_t
offset)
32 assert(_input_buffer_ptr !=
nullptr);
33 return _input_buffer_ptr +
offset;
36uint8_t *StaticMemoryManager::allocate_memory_for_output(int32_t
offset)
38 assert(_output_buffer_ptr !=
nullptr);
39 return _output_buffer_ptr +
offset;
42void StaticMemoryManager::allocate_input_buf()
44 assert(_input_req_size > 0);
45 if (_input_buffer_ptr ==
nullptr)
46 _input_buffer_ptr =
new uint8_t[_input_req_size];
49void StaticMemoryManager::allocate_output_buf()
51 assert(_output_req_size > 0);
52 if (_output_buffer_ptr ==
nullptr)
53 _output_buffer_ptr =
new uint8_t[_output_req_size];
56void StaticMemoryManager::allocate_computing_buf()
58 assert(_buffer_req_size > 0);
59 if (_buffer_ptr ==
nullptr)
60 _buffer_ptr =
new uint8_t[_buffer_req_size];
63void StaticMemoryManager::release_computing_buf()
66 _buffer_ptr =
nullptr;
69void StaticMemoryManager::release_input_buf()
71 delete[] _input_buffer_ptr;
72 _input_buffer_ptr =
nullptr;
75void StaticMemoryManager::release_output_buf()
77 delete[] _output_buffer_ptr;
78 _output_buffer_ptr =
nullptr;
void allocate_memory(luci_interpreter::Tensor &tensor) final
__global uchar * offset(const Image *img, int x, int y)