COMPMID-3392: Collapse TensorMaps into a single TensorPack
Collapse InputTensorMap and OutputTensorMap to a single TensorPack
mechanism.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ie2fdfc6b07d84ad589169ec99ca64fcf45a00bec
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/253783
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3641
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: SiCong Li <sicong.li@arm.com>
Reviewed-by: Sheri Zhang <sheri.zhang@arm.com>
diff --git a/src/runtime/CL/functions/CLActivationLayer.cpp b/src/runtime/CL/functions/CLActivationLayer.cpp
index 784473d..5ddf227 100644
--- a/src/runtime/CL/functions/CLActivationLayer.cpp
+++ b/src/runtime/CL/functions/CLActivationLayer.cpp
@@ -89,9 +89,9 @@
void CLActivationLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLConcatenateLayer.cpp b/src/runtime/CL/functions/CLConcatenateLayer.cpp
index 1ddda02..4214813 100644
--- a/src/runtime/CL/functions/CLConcatenateLayer.cpp
+++ b/src/runtime/CL/functions/CLConcatenateLayer.cpp
@@ -220,16 +220,14 @@
return Status{};
}
-void CLConcatenation::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLConcatenation::run(ITensorPack &tensors)
{
- ARM_COMPUTE_UNUSED(workspace);
-
- if(inputs.empty() || outputs.empty())
+ if(tensors.empty())
{
ARM_COMPUTE_ERROR("No inputs provided");
}
- if(inputs.size() != _num_inputs)
+ if(static_cast<int>(tensors.size()) - 1 != static_cast<int>(_num_inputs))
{
ARM_COMPUTE_ERROR("Configured with different number of inputs");
}
@@ -237,15 +235,17 @@
if(_axis == Window::DimX && (_num_inputs == 2 || _num_inputs == 4))
{
ARM_COMPUTE_ERROR_ON(_concat_kernels.empty());
- CLScheduler::get().enqueue_op(*_concat_kernels.at(0), inputs, outputs, true);
+ CLScheduler::get().enqueue_op(*_concat_kernels.at(0), tensors, true);
}
else
{
int i = 0;
for(auto &k : _concat_kernels)
{
- const InputTensorMap input = { { TensorType::ACL_SRC, inputs.at(ACL_SRC_VEC + i) } };
- CLScheduler::get().enqueue_op(*k, input, outputs, true);
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(ACL_SRC_VEC + i));
+ pack.add_tensor(TensorType::ACL_DST, tensors.get_tensor(ACL_DST));
+ CLScheduler::get().enqueue_op(*k, pack, true);
++i;
}
}
@@ -303,13 +303,13 @@
void CLConcatenateLayer::run()
{
- InputTensorMap srcs;
+ ITensorPack pack;
for(unsigned i = 0; i < _impl->num_inputs; ++i)
{
- srcs.insert(std::make_pair(TensorType::ACL_SRC_VEC + i, _impl->srcs.at(i)));
+ pack.add_tensor(TensorType::ACL_SRC_VEC + i, _impl->srcs.at(i));
}
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(srcs, dst, {});
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
index f8e9694..de94255 100644
--- a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
+++ b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
@@ -153,10 +153,10 @@
void CLRsqrtLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLExpLayer::Impl
@@ -195,10 +195,10 @@
void CLExpLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLNegLayer::Impl
@@ -236,10 +236,10 @@
void CLNegLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLSinLayer::Impl
@@ -277,10 +277,10 @@
void CLSinLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLAbsLayer::Impl
@@ -318,10 +318,10 @@
void CLAbsLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLLogLayer::Impl
@@ -359,10 +359,10 @@
void CLLogLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
struct CLRoundLayer::Impl
@@ -400,9 +400,9 @@
void CLRoundLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLElementwiseOperations.cpp b/src/runtime/CL/functions/CLElementwiseOperations.cpp
index e66e4bf..6f66472 100644
--- a/src/runtime/CL/functions/CLElementwiseOperations.cpp
+++ b/src/runtime/CL/functions/CLElementwiseOperations.cpp
@@ -47,19 +47,21 @@
}
}
-void select_border_input(InputTensorMap &tensor_map, InputTensorMap &inputs, OutputTensorMap &outputs)
+ITensorPack select_border_input(ITensorPack &tensors)
{
- if(outputs.at(TensorType::ACL_DST)->info()->dimension(0) > 1)
+ ITensorPack pack;
+ if(tensors.get_tensor(TensorType::ACL_DST)->info()->dimension(0) > 1)
{
- if(inputs.at(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
+ if(tensors.get_const_tensor(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_1);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_1));
}
else
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_0);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_0));
}
}
+ return pack;
}
} // namespace
@@ -83,12 +85,11 @@
return CLSaturatedArithmeticOperationKernel::validate(ArithmeticOperation::ADD, input1, input2, output, policy, act_info);
}
-void CLArithmeticAddition::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLArithmeticAddition::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLArithmeticSubtraction::CLArithmeticSubtraction()
@@ -110,12 +111,11 @@
return CLSaturatedArithmeticOperationKernel::validate(ArithmeticOperation::SUB, input1, input2, output, policy, act_info);
}
-void CLArithmeticSubtraction::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLArithmeticSubtraction::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLArithmeticDivision::CLArithmeticDivision()
@@ -136,12 +136,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::DIV, input1, input2, output, act_info);
}
-void CLArithmeticDivision::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLArithmeticDivision::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLElementwiseMax::CLElementwiseMax()
@@ -162,12 +161,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::MAX, input1, input2, output, act_info);
}
-void CLElementwiseMax::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLElementwiseMax::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLElementwiseMin::CLElementwiseMin()
@@ -188,12 +186,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::MIN, input1, input2, output, act_info);
}
-void CLElementwiseMin::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLElementwiseMin::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLElementwiseSquaredDiff::CLElementwiseSquaredDiff()
@@ -214,12 +211,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::SQUARED_DIFF, input1, input2, output, act_info);
}
-void CLElementwiseSquaredDiff::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLElementwiseSquaredDiff::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLElementwisePower::CLElementwisePower()
@@ -240,12 +236,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::POWER, input1, input2, output, act_info);
}
-void CLElementwisePower::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLElementwisePower::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
} // namespace experimental
@@ -287,10 +282,12 @@
void CLArithmeticAddition::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLArithmeticSubtraction::Impl
@@ -331,10 +328,12 @@
void CLArithmeticSubtraction::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLArithmeticDivision::Impl
@@ -374,10 +373,12 @@
void CLArithmeticDivision::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLElementwiseMax::Impl
@@ -417,10 +418,12 @@
void CLElementwiseMax::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLElementwiseMin::Impl
@@ -460,10 +463,12 @@
void CLElementwiseMin::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLElementwiseSquaredDiff::Impl
@@ -504,10 +509,12 @@
void CLElementwiseSquaredDiff::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLElementwisePower::Impl
@@ -547,9 +554,11 @@
void CLElementwisePower::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLPReluLayer.cpp b/src/runtime/CL/functions/CLPReluLayer.cpp
index fbb466a..e03bd13 100644
--- a/src/runtime/CL/functions/CLPReluLayer.cpp
+++ b/src/runtime/CL/functions/CLPReluLayer.cpp
@@ -44,19 +44,22 @@
}
}
}
-void select_border_input(InputTensorMap &tensor_map, InputTensorMap &inputs, OutputTensorMap &outputs)
+
+ITensorPack select_border_input(ITensorPack &tensors)
{
- if(outputs.at(TensorType::ACL_DST)->info()->dimension(0) > 1)
+ ITensorPack pack;
+ if(tensors.get_tensor(TensorType::ACL_DST)->info()->dimension(0) > 1)
{
- if(inputs.at(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
+ if(tensors.get_const_tensor(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_1);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_1));
}
else
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_0);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_0));
}
}
+ return pack;
}
} // namespace
@@ -80,12 +83,11 @@
return CLArithmeticOperationKernel::validate(ArithmeticOperation::PRELU, input, alpha, output);
}
-void CLPReluLayer::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLPReluLayer::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
} // namespace experimental
@@ -126,9 +128,11 @@
void CLPReluLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp b/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp
index 34e06a3..883ce68 100644
--- a/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp
+++ b/src/runtime/CL/functions/CLPixelWiseMultiplication.cpp
@@ -34,19 +34,21 @@
{
namespace
{
-void select_border_input(InputTensorMap &tensor_map, InputTensorMap &inputs, OutputTensorMap &outputs)
+ITensorPack select_border_input(ITensorPack &tensors)
{
- if(outputs.at(TensorType::ACL_DST)->info()->dimension(0) > 1)
+ ITensorPack pack;
+ if(tensors.get_tensor(TensorType::ACL_DST)->info()->dimension(0) > 1)
{
- if(inputs.at(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
+ if(tensors.get_const_tensor(TensorType::ACL_SRC_1)->info()->dimension(0) == 1)
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_1);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_1));
}
else
{
- tensor_map[TensorType::ACL_SRC] = inputs.at(TensorType::ACL_SRC_0);
+ pack.add_tensor(TensorType::ACL_SRC, tensors.get_const_tensor(TensorType::ACL_SRC_0));
}
}
+ return pack;
}
} // namespace
@@ -81,12 +83,11 @@
return CLPixelWiseMultiplicationKernel::validate(input1, input2, output, scale, overflow_policy, rounding_policy, act_info);
}
-void CLPixelWiseMultiplication::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLPixelWiseMultiplication::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
CLComplexPixelWiseMultiplication::CLComplexPixelWiseMultiplication()
@@ -116,12 +117,11 @@
return CLComplexPixelWiseMultiplicationKernel::validate(input1, input2, output, act_info);
}
-void CLComplexPixelWiseMultiplication::run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace)
+void CLComplexPixelWiseMultiplication::run(ITensorPack &tensors)
{
- InputTensorMap src;
- select_border_input(src, inputs, outputs);
- CLScheduler::get().enqueue_op(_border_handler, src, {});
- ICLOperator::run(inputs, outputs, workspace);
+ auto border_pack = select_border_input(tensors);
+ CLScheduler::get().enqueue_op(_border_handler, border_pack);
+ ICLOperator::run(tensors);
}
} // namespace experimental
@@ -165,10 +165,12 @@
void CLPixelWiseMultiplication::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
struct CLComplexPixelWiseMultiplication::Impl
@@ -208,9 +210,11 @@
void CLComplexPixelWiseMultiplication::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC_0, _impl->src_0 }, { TensorType::ACL_SRC_1, _impl->src_1 } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC_0, _impl->src_0);
+ pack.add_tensor(TensorType::ACL_SRC_1, _impl->src_1);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
- _impl->op->run(src, dst, {});
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLReshapeLayer.cpp b/src/runtime/CL/functions/CLReshapeLayer.cpp
index ac8b176..273a761 100644
--- a/src/runtime/CL/functions/CLReshapeLayer.cpp
+++ b/src/runtime/CL/functions/CLReshapeLayer.cpp
@@ -84,10 +84,10 @@
void CLReshapeLayer::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute
/** [CLReshapeLayer snippet] **/
diff --git a/src/runtime/CL/functions/CLSlice.cpp b/src/runtime/CL/functions/CLSlice.cpp
index 3689707..f36550b 100644
--- a/src/runtime/CL/functions/CLSlice.cpp
+++ b/src/runtime/CL/functions/CLSlice.cpp
@@ -97,8 +97,9 @@
void CLSlice::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute
diff --git a/src/runtime/CL/functions/CLStridedSlice.cpp b/src/runtime/CL/functions/CLStridedSlice.cpp
index bdef078..b78073d 100644
--- a/src/runtime/CL/functions/CLStridedSlice.cpp
+++ b/src/runtime/CL/functions/CLStridedSlice.cpp
@@ -96,9 +96,9 @@
void CLStridedSlice::run()
{
- const InputTensorMap src{ { TensorType::ACL_SRC, _impl->src } };
- const OutputTensorMap dst{ { TensorType::ACL_DST, _impl->dst } };
-
- _impl->op->run(src, dst, {});
+ ITensorPack pack;
+ pack.add_tensor(TensorType::ACL_SRC, _impl->src);
+ pack.add_tensor(TensorType::ACL_DST, _impl->dst);
+ _impl->op->run(pack);
}
} // namespace arm_compute