| 640 | } |
| 641 | |
| 642 | void ClGemmConv2d::prepare(ITensorPack &tensors) |
| 643 | { |
| 644 | if (!_is_prepared) |
| 645 | { |
| 646 | // Run weights reshaping and mark original weights tensor as unused |
| 647 | ICLTensor *weights_reshaped_p = |
| 648 | utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(offset_int_vec(WeightsReshaped))); |
| 649 | CLAuxTensorHandler weights_reshaped(_weights_reshaped, *weights_reshaped_p); |
| 650 | auto weights = tensors.get_const_tensor(TensorType::ACL_SRC_1); |
| 651 | ITensorPack pack = {{TensorType::ACL_SRC, weights}, {TensorType::ACL_DST, weights_reshaped.get()}}; |
| 652 | |
| 653 | if (_append_bias) |
| 654 | { |
| 655 | const auto biases = tensors.get_const_tensor(TensorType::ACL_SRC_2); |
| 656 | pack.add_const_tensor(TensorType::ACL_BIAS, biases); |
| 657 | } |
| 658 | CLScheduler::get().enqueue_op(*_weights_reshape_kernel.get(), pack, true); |
| 659 | tensors.add_const_tensor(TensorType::ACL_SRC_1, weights_reshaped.get()); |
| 660 | |
| 661 | // Prepare GEMM |
| 662 | _is_quantized ? _mm_gemmlowp->prepare(tensors) : _mm_gemm->prepare(tensors); |
| 663 | _is_prepared = true; |
| 664 | } |
| 665 | } |
| 666 | experimental::MemoryRequirements ClGemmConv2d::workspace() const |
| 667 | { |
| 668 | return _aux_mem; |
nothing calls this directly
no test coverage detected