MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / get_algorithm_heuristic

Method get_algorithm_heuristic

dnn/src/cuda/local_share/opr_impl.cpp:72–94  ·  view source on GitHub ↗

============== LocalShareBackwardDataImpl ============== */

Source from the content-addressed store, hash-verified

70
71/* ============== LocalShareBackwardDataImpl ============== */
72LocalShareBackwardDataImpl::Algorithm* LocalShareBackwardDataImpl::
73 get_algorithm_heuristic(
74 const TensorLayout& filter, const TensorLayout& diff,
75 const TensorLayout& grad, size_t workspace_limit_in_bytes,
76 const AlgoAttribute& positive_attr,
77 const AlgoAttribute& negative_attr) {
78 AlgoBase::SizeArgs args(this, filter, diff, grad);
79 if (sm_algo_pack.implicit_gemm.is_available_attribute(
80 args, positive_attr, negative_attr, workspace_limit_in_bytes)) {
81 return &sm_algo_pack.implicit_gemm;
82 }
83 if (sm_algo_pack.batched_matmul.is_available_attribute(
84 args, positive_attr, negative_attr, workspace_limit_in_bytes)) {
85 return &sm_algo_pack.batched_matmul;
86 }
87 megdnn_throw(ssprintf(
88 "no local share bwd data algorithm without attribute(%s) "
89 "with attribute(%s) args(%s) and "
90 "workspace limit (%zu bytes)",
91 Algorithm::attribute_str(negative_attr).c_str(),
92 Algorithm::attribute_str(positive_attr).c_str(), args.to_string().c_str(),
93 workspace_limit_in_bytes));
94}
95
96std::vector<LocalShareBackwardDataImpl::Algorithm*> LocalShareBackwardDataImpl::
97 get_all_algorithms(

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.45

Tested by

no test coverage detected