Skip to content

Commit

Permalink
[onert] Update basic backend namespace (Samsung#6323)
Browse files Browse the repository at this point in the history
This commit updates namespace onert::backend::cpu_common to onert::backend::basic.

Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Mar 24, 2021
1 parent 3d3f88f commit 255903b
Show file tree
Hide file tree
Showing 57 changed files with 116 additions and 116 deletions.
2 changes: 1 addition & 1 deletion runtime/onert/backend/acl_cl/KernelGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using ActivationBuilder = ::onert::backend::acl_common::AclActivationBuilder<
KernelGenerator::KernelGenerator(
const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<acl_common::AclTensorRegistry<TensorManager>> &tensor_reg)
: cpu_common::KernelGeneratorBase{graph}, _ctx(graph.operands()),
: basic::KernelGeneratorBase{graph}, _ctx(graph.operands()),
_operations_ctx(graph.operations()), _current_layout{graph.layout()},
_tensor_builder(tensor_builder), _tensor_reg(tensor_reg)
{
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/acl_cl/KernelGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace backend
namespace acl_cl
{

class KernelGenerator : public cpu_common::KernelGeneratorBase
class KernelGenerator : public basic::KernelGeneratorBase
{
public:
KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/acl_neon/KernelGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using ActivationBuilder = ::onert::backend::acl_common::AclActivationBuilder<
KernelGenerator::KernelGenerator(
const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<acl_common::AclTensorRegistry<TensorManager>> &tensor_reg)
: cpu_common::KernelGeneratorBase{graph}, _ctx(graph.operands()),
: basic::KernelGeneratorBase{graph}, _ctx(graph.operands()),
_operations_ctx(graph.operations()), _current_layout{graph.layout()},
_tensor_builder(tensor_builder), _tensor_reg(tensor_reg)
{
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/acl_neon/KernelGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace backend
namespace acl_neon
{

class KernelGenerator : public cpu_common::KernelGeneratorBase
class KernelGenerator : public basic::KernelGeneratorBase
{
public:
KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/cpu/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Backend : public ::onert::backend::Backend
auto custom_kernel_builder = data.custom_kernel_builder;
auto &graph = *data.graph;
auto context = std::make_unique<BackendContext>(this, std::move(data));
auto tr = std::make_shared<cpu_common::TensorRegistry>();
auto tr = std::make_shared<basic::TensorRegistry>();
auto tb = std::make_shared<TensorBuilder>(tr);
context->tensor_registry = tr;
context->tensor_builder = tb;
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/cpu/BackendContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace backend
namespace cpu
{

ITensorRegistry *BackendContext::genTensors() { return cpu_common::genTensors(*this); }
ITensorRegistry *BackendContext::genTensors() { return basic::genTensors(*this); }

FunctionMap BackendContext::genKernels()
{
Expand All @@ -43,7 +43,7 @@ FunctionMap BackendContext::genKernels()
ret.emplace_back(op_ind, std::move(fn_seq));
}

cpu_common::initConsts(*this);
basic::initConsts(*this);

// NOTE For memory optimization, we want to free some operand data
const_cast<ir::Graph &>(*_data.graph)
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/cpu/KernelGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ ops::ReduceType convertReduceType(ir::operation::Reduce::ReduceType reduce_type_

KernelGenerator::KernelGenerator(
const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<backend::custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context)
: cpu_common::KernelGeneratorBase{graph},
: basic::KernelGeneratorBase{graph},
_ctx(graph.operands()), _operations_ctx{graph.operations()}, _current_layout{graph.layout()},
_tensor_builder(tensor_builder), _tensor_reg{tensor_reg}, _kernel_builder(kernel_builder),
_external_context(external_context)
Expand Down
6 changes: 3 additions & 3 deletions runtime/onert/backend/cpu/KernelGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ namespace backend
namespace cpu
{

class KernelGenerator : public cpu_common::KernelGeneratorBase
class KernelGenerator : public basic::KernelGeneratorBase
{
public:
KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context);

Expand Down Expand Up @@ -101,7 +101,7 @@ class KernelGenerator : public cpu_common::KernelGeneratorBase
const ir::Operations &_operations_ctx;
ir::Layout _current_layout;
std::shared_ptr<TensorBuilder> _tensor_builder;
std::shared_ptr<cpu_common::TensorRegistry> _tensor_reg;
std::shared_ptr<basic::TensorRegistry> _tensor_reg;
std::shared_ptr<backend::custom::IKernelBuilder> _kernel_builder;
const std::shared_ptr<ExternalContext> _external_context;
};
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/cpu/StaticTensorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace cpu
{

using StaticTensorManager = cpu_common::StaticTensorManager;
using StaticTensorManager = basic::StaticTensorManager;

} // namespace cpu
} // namespace backend
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/cpu/Tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace backend
namespace cpu
{

using Tensor = cpu_common::Tensor;
using ExternalTensor = cpu_common::ExternalTensor;
using Tensor = basic::Tensor;
using ExternalTensor = basic::ExternalTensor;

} // namespace cpu
} // namespace backend
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/cpu/TensorBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace cpu
{

using TensorBuilder = cpu_common::TensorBuilder;
using TensorBuilder = basic::TensorBuilder;

} // namespace cpu
} // namespace backend
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/ruy/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Backend : public ::onert::backend::Backend
auto custom_kernel_builder = data.custom_kernel_builder;
auto &graph = *data.graph;
auto context = std::make_unique<BackendContext>(this, std::move(data));
auto tr = std::make_shared<cpu_common::TensorRegistry>();
auto tr = std::make_shared<basic::TensorRegistry>();
auto tb = std::make_shared<TensorBuilder>(tr);
context->tensor_registry = tr;
context->tensor_builder = tb;
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/ruy/BackendContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace backend
namespace ruy
{

ITensorRegistry *BackendContext::genTensors() { return cpu_common::genTensors(*this); }
ITensorRegistry *BackendContext::genTensors() { return basic::genTensors(*this); }

FunctionMap BackendContext::genKernels()
{
Expand All @@ -43,7 +43,7 @@ FunctionMap BackendContext::genKernels()
ret.emplace_back(op_ind, std::move(fn_seq));
}

cpu_common::initConsts(*this);
basic::initConsts(*this);

// NOTE For memory optimization, we want to free some operand data
const_cast<ir::Graph &>(*_data.graph)
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/ruy/KernelGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ std::unique_ptr<exec::FunctionSequence> KernelGenerator::generate(ir::OperationI

KernelGenerator::KernelGenerator(
const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<backend::custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context)
: cpu_common::KernelGeneratorBase{graph},
: basic::KernelGeneratorBase{graph},
_ctx(graph.operands()), _operations_ctx{graph.operations()}, _current_layout{graph.layout()},
_tensor_builder(tensor_builder), _tensor_reg{tensor_reg}, _kernel_builder(kernel_builder),
_external_context(external_context)
Expand Down
6 changes: 3 additions & 3 deletions runtime/onert/backend/ruy/KernelGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ namespace backend
namespace ruy
{

class KernelGenerator : public cpu_common::KernelGeneratorBase
class KernelGenerator : public basic::KernelGeneratorBase
{
public:
KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context);

Expand All @@ -53,7 +53,7 @@ class KernelGenerator : public cpu_common::KernelGeneratorBase
const ir::Operations &_operations_ctx;
const ir::Layout _current_layout;
std::shared_ptr<TensorBuilder> _tensor_builder;
std::shared_ptr<cpu_common::TensorRegistry> _tensor_reg;
std::shared_ptr<basic::TensorRegistry> _tensor_reg;
std::shared_ptr<backend::custom::IKernelBuilder> _kernel_builder;
const std::shared_ptr<ExternalContext> _external_context;
};
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/ruy/StaticTensorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace ruy
{

using StaticTensorManager = cpu_common::StaticTensorManager;
using StaticTensorManager = basic::StaticTensorManager;

} // namespace ruy
} // namespace backend
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/ruy/Tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace backend
namespace ruy
{

using Tensor = cpu_common::Tensor;
using ExternalTensor = cpu_common::ExternalTensor;
using Tensor = basic::Tensor;
using ExternalTensor = basic::ExternalTensor;

} // namespace ruy
} // namespace backend
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/ruy/TensorBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace ruy
{

using TensorBuilder = cpu_common::TensorBuilder;
using TensorBuilder = basic::TensorBuilder;

} // namespace ruy
} // namespace backend
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/xnnpack/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Backend : public ::onert::backend::Backend
auto custom_kernel_builder = data.custom_kernel_builder;
auto &graph = *data.graph;
auto context = std::make_unique<BackendContext>(this, std::move(data));
auto tr = std::make_shared<cpu_common::TensorRegistry>();
auto tr = std::make_shared<basic::TensorRegistry>();
auto tb = std::make_shared<TensorBuilder>(tr);
context->tensor_registry = tr;
context->tensor_builder = tb;
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/xnnpack/BackendContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace backend
namespace xnnpack
{

ITensorRegistry *BackendContext::genTensors() { return cpu_common::genTensors(*this); }
ITensorRegistry *BackendContext::genTensors() { return basic::genTensors(*this); }

FunctionMap BackendContext::genKernels()
{
Expand All @@ -43,7 +43,7 @@ FunctionMap BackendContext::genKernels()
ret.emplace_back(op_ind, std::move(fn_seq));
}

cpu_common::initConsts(*this);
basic::initConsts(*this);

// NOTE For memory optimization, we want to free some operand data
const_cast<ir::Graph &>(*_data.graph)
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/xnnpack/KernelGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ namespace xnnpack

KernelGenerator::KernelGenerator(
const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<backend::custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context)
: cpu_common::KernelGeneratorBase{graph},
: basic::KernelGeneratorBase{graph},
_ctx(graph.operands()), _operations_ctx{graph.operations()}, _current_layout{graph.layout()},
_tensor_builder(tensor_builder), _tensor_reg{tensor_reg}, _kernel_builder(kernel_builder),
_external_context(external_context)
Expand Down
6 changes: 3 additions & 3 deletions runtime/onert/backend/xnnpack/KernelGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ namespace backend
namespace xnnpack
{

class KernelGenerator : public cpu_common::KernelGeneratorBase
class KernelGenerator : public basic::KernelGeneratorBase
{
public:
KernelGenerator(const ir::Graph &graph, const std::shared_ptr<TensorBuilder> &tensor_builder,
const std::shared_ptr<cpu_common::TensorRegistry> &tensor_reg,
const std::shared_ptr<basic::TensorRegistry> &tensor_reg,
const std::shared_ptr<custom::IKernelBuilder> &kernel_builder,
const std::shared_ptr<ExternalContext> &external_context);

Expand All @@ -54,7 +54,7 @@ class KernelGenerator : public cpu_common::KernelGeneratorBase
const ir::Operations &_operations_ctx;
ir::Layout _current_layout;
std::shared_ptr<TensorBuilder> _tensor_builder;
std::shared_ptr<cpu_common::TensorRegistry> _tensor_reg;
std::shared_ptr<basic::TensorRegistry> _tensor_reg;
std::shared_ptr<backend::custom::IKernelBuilder> _kernel_builder;
const std::shared_ptr<ExternalContext> _external_context;
};
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/xnnpack/StaticTensorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace xnnpack
{

using StaticTensorManager = cpu_common::StaticTensorManager;
using StaticTensorManager = basic::StaticTensorManager;

} // namespace xnnpack
} // namespace backend
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/backend/xnnpack/Tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace backend
namespace xnnpack
{

using Tensor = cpu_common::Tensor;
using ExternalTensor = cpu_common::ExternalTensor;
using Tensor = basic::Tensor;
using ExternalTensor = basic::ExternalTensor;

} // namespace xnnpack
} // namespace backend
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/backend/xnnpack/TensorBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace backend
namespace xnnpack
{

using TensorBuilder = cpu_common::TensorBuilder;
using TensorBuilder = basic::TensorBuilder;

} // namespace xnnpack
} // namespace backend
Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/core/include/backend/basic/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace onert
{
namespace backend
{
namespace cpu_common
namespace basic
{

/**
Expand All @@ -49,7 +49,7 @@ class Allocator
std::unique_ptr<uint8_t[]> _base;
};

} // namespace cpu_common
} // namespace basic
} // namespace backend
} // namespace onert

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace onert
{
namespace backend
{
namespace cpu_common
namespace basic
{

// TODO Remove the template param BackendContext once unification of cpu backend context is done
Expand Down Expand Up @@ -205,7 +205,7 @@ template <typename T_BackendContext> ITensorRegistry *genTensors(T_BackendContex
// TODO Get compiler options from compiler, and use it rather than getting it from Env
if (util::getConfigString(util::config::EXECUTOR) == "Linear")
{
cpu_common::planTensors(ctx);
basic::planTensors(ctx);
}
else
{
Expand Down Expand Up @@ -244,7 +244,7 @@ inline void initConsts(BackendContext &ctx)
});
}

} // namespace cpu_common
} // namespace basic
} // namespace backend
} // namespace onert

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace onert
{
namespace backend
{
namespace cpu_common
namespace basic
{

// TODO Find optimized algorithm to manage memory.
Expand Down Expand Up @@ -65,7 +65,7 @@ class DynamicTensorManager
_dealloc_tensor_map;
};

} // namespace cpu_common
} // namespace basic
} // namespace backend
} // namespace onert

Expand Down
4 changes: 2 additions & 2 deletions runtime/onert/core/include/backend/basic/IMemoryPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace onert
{
namespace backend
{
namespace cpu_common
namespace basic
{

/**
Expand Down Expand Up @@ -67,7 +67,7 @@ struct IMemoryPlanner
virtual ~IMemoryPlanner() = default;
};

} // namespace cpu_common
} // namespace basic
} // namespace backend
} // namespace onert

Expand Down
Loading

0 comments on commit 255903b

Please sign in to comment.