| 255 | } |
| 256 | |
| 257 | void ClWinogradConv2d::run(ITensorPack &tensors) |
| 258 | { |
| 259 | const bool is_gemm_reshaped = _aux_mem[3].lifetime == MemoryLifetime::Prepare; |
| 260 | |
| 261 | auto src = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_0)); |
| 262 | auto biases = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC_2)); |
| 263 | auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST)); |
| 264 | |
| 265 | CLAuxTensorHandler input0(offset_int_vec(2), _input0, tensors, true); |
| 266 | CLAuxTensorHandler input1(offset_int_vec(3), _input1, tensors, true, is_gemm_reshaped); |
| 267 | CLAuxTensorHandler batched_mm_output(offset_int_vec(4), _batched_mm_output, tensors, true); |
| 268 | |
| 269 | prepare(tensors); |
| 270 | |
| 271 | // Run input transform |
| 272 | ITensorPack pack_it{ |
| 273 | {TensorType::ACL_SRC, src}, |
| 274 | {TensorType::ACL_DST, input0.get()}, |
| 275 | }; |
| 276 | CLScheduler::get().enqueue_op(_border_handler, pack_it, false); |
| 277 | CLScheduler::get().enqueue_op(*_input_transform, pack_it, false); |
| 278 | |
| 279 | // Run batched matrix multiplication |
| 280 | ITensorPack pack_mm = tensors; |
| 281 | pack_mm.add_const_tensor(TensorType::ACL_SRC_0, input0.get()); |
| 282 | pack_mm.add_tensor(TensorType::ACL_DST, batched_mm_output.get()); |
| 283 | is_gemm_reshaped ? pack_mm.remove_tensor(TensorType::ACL_SRC_1) |
| 284 | : pack_mm.add_const_tensor(TensorType::ACL_SRC_1, input1.get()); |
| 285 | _batched_mm.run(pack_mm); |
| 286 | |
| 287 | // Run output transform |
| 288 | ITensorPack pack_ot{ |
| 289 | {TensorType::ACL_SRC_0, batched_mm_output.get()}, |
| 290 | {TensorType::ACL_SRC_1, biases}, |
| 291 | {TensorType::ACL_DST, dst}, |
| 292 | }; |
| 293 | CLScheduler::get().enqueue_op(*_output_transform, pack_ot); |
| 294 | } |
| 295 | |
| 296 | void ClWinogradConv2d::prepare(ITensorPack &tensors) |
| 297 | { |
nothing calls this directly
no test coverage detected