#include "backend/cpu_common/StaticTensorManager.h"
+#include "backend/cpu_common/DynamicTensorManager.h"
#include <util/logging.h>
namespace onert
void StaticTensorManager::allocateConsts(void)
{
- for (auto &pair : _tensors->managed_tensors())
+ for (auto &pair : _tensors->native_tensors())
{
const auto &ind = pair.first;
auto tensor = pair.second;
auto mem_alloc = _const_mgr->allocate(ind, tensor->total_size());
tensor->setBuffer(mem_alloc);
auto buffer = mem_alloc->base();
- VERBOSE(CPU_StaticTensorManager) << "CONSTANT TENSOR(#" << ind.value()
- << "): " << static_cast<void *>(buffer)
- << "size : " << tensor->total_size() << std::endl;
+ VERBOSE(CPU_COMMON_StaticTensorManager) << "CONSTANT TENSOR(#" << ind.value()
+ << "): " << static_cast<void *>(buffer)
+ << "size : " << tensor->total_size() << std::endl;
}
}
}
{
_nonconst_mgr->allocate();
- for (auto &pair : _tensors->managed_tensors())
+ for (auto &pair : _tensors->native_tensors())
{
const auto &ind = pair.first;
auto tensor = pair.second;
auto *buffer = _nonconst_mgr->getBuffer(ind);
tensor->setBuffer(buffer);
- VERBOSE(CPU_StaticTensorManager) << "TENSOR(#" << ind.value()
- << "): " << static_cast<void *>(buffer) << std::endl;
+ VERBOSE(CPU_COMMON_StaticTensorManager) << "TENSOR(#" << ind.value()
+ << "): " << static_cast<void *>(buffer) << std::endl;
}
}
}
const ir::OperandInfo &tensor_info, ir::Layout backend_layout,
bool as_const)
{
- assert(!_tensors->getManagedTensor(ind));
- auto tensor = std::make_shared<Tensor>(tensor_info, backend_layout);
- _tensors->setManagedTensor(ind, tensor);
+ assert(!_tensors->getNativeTensor(ind));
+ auto tensor = std::make_shared<Tensor>(tensor_info, backend_layout, nullptr);
+ _tensors->setNativeTensor(ind, tensor);
_as_constants[ind] = as_const;
}
void StaticTensorManager::claimPlan(const ir::OperandIndex &ind, uint32_t size)
{
- assert(_tensors->getManagedTensor(ind));
+ assert(_tensors->getNativeTensor(ind));
// This method is called only when a tensor has proper shape
- assert(!_tensors->getManagedTensor(ind)->is_dynamic());
+ assert(!_tensors->getNativeTensor(ind)->is_dynamic());
if (!_as_constants[ind])
_nonconst_mgr->claimPlan(ind, size);
void StaticTensorManager::releasePlan(const ir::OperandIndex &ind)
{
- assert(_tensors->getManagedTensor(ind));
+ assert(_tensors->getNativeTensor(ind));
// This method is called only when a tensor has proper shape
- assert(!_tensors->getManagedTensor(ind)->is_dynamic());
+ assert(!_tensors->getNativeTensor(ind)->is_dynamic());
if (!_as_constants[ind])
_nonconst_mgr->releasePlan(ind);
void StaticTensorManager::iterate(const std::function<void(const ir::OperandIndex &)> &fn)
{
- for (const auto &it : _tensors->managed_tensors())
+ for (const auto &it : _tensors->native_tensors())
fn(it.first);
}