17#include "../KernelGenerator.h"
18#include "../Validator.h"
25void Validator::visit(
const ir::operation::Concat &) {
_supported =
true; }
27void KernelGenerator::visit(
const ir::operation::Concat &node)
29 const auto ofm_index{node.getOutputs().at(0)};
31 std::vector<ir::OperandIndex> input_indexes;
32 for (
const auto &input : node.getInputs())
33 input_indexes.emplace_back(
input);
35 const auto axis = node.param().axis;
38 bool eliminated = _tensor_builder->areSubTensorsOf(ofm_index, node.getInputs());
42 VERBOSE(acl_neon_KernelGenerator_Concat) <<
"Concat eliminated" << std::endl;
43 _return_fn = std::make_unique<exec::NopFunction>();
48 std::vector<const ::arm_compute::ITensor *> input_tensors;
49 for (
const auto &ifm_ind : input_indexes)
50 input_tensors.emplace_back(_tensor_reg->getAclTensor(ifm_ind)->handle());
52 std::unique_ptr<::arm_compute::IFunction> fn;
53 if (input_indexes.size() < 2)
55 ::arm_compute::ITensor *input_tesor = _tensor_reg->getAclTensor(input_indexes.at(0))->handle();
56 fn = acl_common::generateLayer<arm_compute::NECopy>(input_tesor,
output_tensor->handle());
60 const auto rank = _ctx.
at(ofm_index).shape().rank();
62 fn = acl_common::generateLayer<arm_compute::NEConcatenateLayer>(
uint32_t value(void) const
std::unique_ptr< exec::IFunction > _return_fn
const Object & at(const Index &index) const
Get the object that is associated with the given index.
#define VERBOSE(name, lv)
ARMComputeAxis ToARMComputeAxis(uint32_t rank, uint32_t axis)
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)