MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / run

Method run

src/cpu/operators/CpuAddMulAdd.cpp:107–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void CpuAddMulAdd::run(ITensorPack &tensors)
108{
109 ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuAddMulAdd::run");
110 const DataType data_type = tensors.get_const_tensor(TensorType::ACL_SRC_0)->info()->data_type();
111
112 if (is_data_type_quantized(data_type))
113 {
114 const ITensor *bn_mul = tensors.get_const_tensor(TensorType::ACL_SRC_2);
115 const ITensor *bn_add = tensors.get_const_tensor(TensorType::ACL_SRC_3);
116
117 CpuAuxTensorHandler dequantized_bn_mul_handler(offset_int_vec(DequantizedBnMul), _dequantized_bn_mul, tensors,
118 true);
119 CpuAuxTensorHandler dequantized_bn_add_handler(offset_int_vec(DequantizedBnAdd), _dequantized_bn_add, tensors,
120 true);
121
122 ITensorPack dequantize_mul_pack = {{TensorType::ACL_SRC_0, bn_mul},
123 {TensorType::ACL_DST_0, dequantized_bn_mul_handler.get()}};
124
125 ITensorPack dequantize_add_pack = {{TensorType::ACL_SRC_0, bn_add},
126 {TensorType::ACL_DST_0, dequantized_bn_add_handler.get()}};
127
128 _dequantize_bn_mul.run(dequantize_mul_pack);
129 _dequantize_bn_add.run(dequantize_add_pack);
130
131 ITensorPack add_mul_add_pack = {
132 {TensorType::ACL_SRC_0, tensors.get_const_tensor(TensorType::ACL_SRC_0)},
133 {TensorType::ACL_SRC_1, tensors.get_const_tensor(TensorType::ACL_SRC_1)},
134 {TensorType::ACL_SRC_2, dequantized_bn_mul_handler.get()},
135 {TensorType::ACL_SRC_3, dequantized_bn_add_handler.get()},
136 {TensorType::ACL_DST_0, tensors.get_tensor(TensorType::ACL_DST_0)},
137 {TensorType::ACL_DST_1, tensors.get_tensor(TensorType::ACL_DST_1)},
138 };
139
140 NEScheduler::get().schedule_op(_kernel.get(), Window::DimY, _kernel->window(), add_mul_add_pack);
141 }
142 else
143 {
144 NEScheduler::get().schedule_op(_kernel.get(), Window::DimY, _kernel->window(), tensors);
145 }
146}
147
148experimental::MemoryRequirements CpuAddMulAdd::workspace() const
149{

Callers

nothing calls this directly

Calls 8

is_data_type_quantizedFunction · 0.85
offset_int_vecFunction · 0.85
get_const_tensorMethod · 0.80
data_typeMethod · 0.45
infoMethod · 0.45
getMethod · 0.45
get_tensorMethod · 0.45
schedule_opMethod · 0.45

Tested by

no test coverage detected