| 229 | } |
| 230 | |
| 231 | size_t MatrixMulImpl::get_workspace_in_bytes( |
| 232 | const TensorLayout& A, const TensorLayout& B, const TensorLayout& C) { |
| 233 | TensorLayoutArray layouts{A, B, C}; |
| 234 | AlgorithmCache::Key key{this->handle(), this->get_opr_type(), |
| 235 | layouts.data(), layouts.size(), |
| 236 | &this->param(), sizeof(this->param())}; |
| 237 | auto rst = AlgorithmCache::instance().get(key); |
| 238 | if (rst.policy.algo.valid()) { |
| 239 | return rst.workspace; |
| 240 | } |
| 241 | |
| 242 | if (auto algo = get_algorithm_heuristic( |
| 243 | A, B, C, std::numeric_limits<size_t>::max(), AlgoAttribute::DEFAULT, |
| 244 | AlgoAttribute::DEFAULT)) { |
| 245 | auto kern_size_param = make_kern_size_param(A, B, C); |
| 246 | return static_cast<AlgoBase*>(algo)->get_workspace(kern_size_param); |
| 247 | } |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | void MatrixMulImpl::exec( |
| 252 | _megdnn_tensor_in A, _megdnn_tensor_in B, _megdnn_tensor_out C, |
nothing calls this directly
no test coverage detected