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

Method prepare

src/gpu/cl/operators/ClGemm.cpp:894–916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894void 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
918experimental::MemoryRequirements ClGemm::workspace() const
919{

Callers

nothing calls this directly

Calls 5

offset_int_vecFunction · 0.85
get_const_tensorMethod · 0.80
enqueue_opMethod · 0.80
get_tensorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected