| 36 | } |
| 37 | |
| 38 | ConvolutionForwardImpl::Algorithm* ConvolutionForwardImpl::get_algorithm_heuristic( |
| 39 | const TensorLayout& src, const TensorLayout& filter, const TensorLayout& dst, |
| 40 | size_t workspace_limit_in_bytes, const AlgoAttribute& positive_attr, |
| 41 | const AlgoAttribute& negative_attr) { |
| 42 | auto fm = check_layout_fwd(src, filter, dst); |
| 43 | AlgoBase::SizeArgs args{this, src, filter, fm, dst}; |
| 44 | auto&& all_algos = algo_pack().all_algos; |
| 45 | for (auto algo : all_algos) { |
| 46 | if (algo->get_workspace_in_bytes(args) <= workspace_limit_in_bytes && |
| 47 | algo->is_available(args)) |
| 48 | return algo; |
| 49 | } |
| 50 | megdnn_assert( |
| 51 | false, "No Suitable algo with src->{%s}, filter->{%s}\n", |
| 52 | src.to_string().c_str(), filter.to_string().c_str()); |
| 53 | return nullptr; |
| 54 | } |
| 55 | |
| 56 | size_t ConvolutionForwardImpl::get_workspace_in_bytes( |
| 57 | const TensorLayout& src, const TensorLayout& filter, const TensorLayout& dst, |
nothing calls this directly
no test coverage detected