| 892 | } |
| 893 | |
| 894 | void ClGemm::prepare(ITensorPack &constants) |
| 895 | { |
| 896 | if (!_is_prepared) |
| 897 | { |
| 898 | const ITensor *src1 = constants.get_const_tensor(ACL_SRC_1); |
| 899 | ICLTensor *rhs_aux = |
| 900 | utils::cast::polymorphic_downcast<ICLTensor *>(constants.get_tensor(offset_int_vec(RhsReshape))); |
| 901 | |
| 902 | // If memory for RHS is persistent and src1 is provided re-transform else assume that RHS is transformed |
| 903 | if ((_aux_mem[AuxTensorIdx::RhsReshape].lifetime == MemoryLifetime::Persistent) && |
| 904 | (src1 != nullptr && rhs_aux != nullptr) && rhs_aux) |
| 905 | { |
| 906 | ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL("Transforming RHS Matrix!"); |
| 907 | |
| 908 | CLAuxTensorHandler rhs_reshaped(_tmp_b, *rhs_aux); |
| 909 | ARM_COMPUTE_ERROR_ON(rhs_reshaped.get()->cl_buffer().get() == nullptr); |
| 910 | |
| 911 | ITensorPack reshape_rhs_pack{{ACL_SRC, src1}, {ACL_DST, rhs_reshaped.get()}}; |
| 912 | CLScheduler::get().enqueue_op(*_reshape_rhs_kernel, reshape_rhs_pack, true); |
| 913 | } |
| 914 | _is_prepared = true; |
| 915 | } |
| 916 | } |
| 917 | |
| 918 | experimental::MemoryRequirements ClGemm::workspace() const |
| 919 | { |
nothing calls this directly
no test coverage detected