| 152 | } |
| 153 | |
| 154 | void CpuDepthwiseConv2d::CpuDepthwiseConv2dOptimizedInternal::run(ITensorPack &tensors) |
| 155 | { |
| 156 | ARM_COMPUTE_ERROR_ON_MSG(tensors.empty(), "No inputs provided"); |
| 157 | prepare(tensors); |
| 158 | |
| 159 | auto bias = tensors.get_const_tensor(TensorType::ACL_SRC_2); |
| 160 | auto dst = tensors.get_tensor(TensorType::ACL_DST_0); |
| 161 | auto workspace = tensors.get_tensor(TensorType::ACL_INT_3); |
| 162 | auto packed_weights = tensors.get_tensor(TensorType::ACL_INT_4); |
| 163 | |
| 164 | // Permute input |
| 165 | if (_permute) |
| 166 | { |
| 167 | ITensorPack pack; |
| 168 | auto src = tensors.get_const_tensor(TensorType::ACL_SRC_0); |
| 169 | auto src_perm = tensors.get_tensor(TensorType::ACL_INT_0); |
| 170 | pack.add_tensor(TensorType::ACL_SRC, src); |
| 171 | pack.add_tensor(TensorType::ACL_DST, src_perm); |
| 172 | _permute_input->run(pack); |
| 173 | } |
| 174 | |
| 175 | // Run assembly function |
| 176 | if (_is_nchw) |
| 177 | { |
| 178 | auto src_perm = tensors.get_tensor(TensorType::ACL_INT_0); |
| 179 | auto weights_perm = tensors.get_tensor(TensorType::ACL_INT_1); |
| 180 | auto dst_perm = tensors.get_tensor(TensorType::ACL_INT_2); |
| 181 | |
| 182 | ITensorPack pack; |
| 183 | pack.add_tensor(TensorType::ACL_SRC_0, src_perm); |
| 184 | pack.add_tensor(TensorType::ACL_SRC_1, weights_perm); |
| 185 | pack.add_tensor(TensorType::ACL_SRC_2, bias); |
| 186 | pack.add_tensor(TensorType::ACL_INT_0, workspace); |
| 187 | pack.add_tensor(TensorType::ACL_INT_1, packed_weights); |
| 188 | pack.add_tensor(TensorType::ACL_DST, dst_perm); |
| 189 | _dwc_optimized_func->run(pack); |
| 190 | } |
| 191 | else |
| 192 | { |
| 193 | auto src = tensors.get_tensor(TensorType::ACL_SRC_0); |
| 194 | auto weights = tensors.get_tensor(TensorType::ACL_SRC_1); |
| 195 | auto dst = tensors.get_tensor(TensorType::ACL_DST); |
| 196 | |
| 197 | ITensorPack pack; |
| 198 | pack.add_tensor(TensorType::ACL_SRC_0, src); |
| 199 | pack.add_tensor(TensorType::ACL_SRC_1, weights); |
| 200 | pack.add_tensor(TensorType::ACL_SRC_2, bias); |
| 201 | pack.add_tensor(TensorType::ACL_INT_0, workspace); |
| 202 | pack.add_tensor(TensorType::ACL_INT_1, packed_weights); |
| 203 | pack.add_tensor(TensorType::ACL_DST, dst); |
| 204 | _dwc_optimized_func->run(pack); |
| 205 | } |
| 206 | |
| 207 | // Permute output |
| 208 | if (_is_nchw) |
| 209 | { |
| 210 | ITensorPack pack; |
| 211 | auto dst_perm = tensors.get_tensor(TensorType::ACL_INT_2); |
no test coverage detected