17#include "../KernelGenerator.h"
18#include "../Validator.h"
25void Validator::visit(
const ir::operation::ElementwiseBinary &) {
_supported =
true; }
27void KernelGenerator::visit(
const ir::operation::ElementwiseBinary &node)
29 const auto output_index{node.getOutputs().at(0)};
34 auto lhs_tensor = _tensor_reg->getAclTensor(lhs_index);
35 auto rhs_tensor = _tensor_reg->getAclTensor(rhs_index);
37 std::unique_ptr<arm_compute::IFunction> fn;
38 switch (node.param().op_type)
42 fn = acl_common::generateLayer<arm_compute::CLLogicalAnd>(
43 lhs_tensor->handle(), rhs_tensor->handle(),
output_tensor->handle());
48 fn = acl_common::generateLayer<arm_compute::CLLogicalOr>(
49 lhs_tensor->handle(), rhs_tensor->handle(),
output_tensor->handle());
54 fn = acl_common::generateLayer<arm_compute::CLElementwiseMax>(
55 lhs_tensor->handle(), rhs_tensor->handle(),
output_tensor->handle());
60 fn = acl_common::generateLayer<arm_compute::CLElementwiseMin>(
61 lhs_tensor->handle(), rhs_tensor->handle(),
output_tensor->handle());
66 std::string err_msg(
"acl_cl KernelGenerator : " + node.name() +
67 "is not elementwise-binary operations");
68 assert(
false && err_msg.c_str());
std::unique_ptr< exec::IFunction > _return_fn
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)