| 17 | ConvolutionBackwardDataImpl::AlgoMIOpen::sm_miopen_ws_cache; |
| 18 | |
| 19 | bool ConvolutionBackwardDataImpl::AlgoMIOpen::is_available(const SizeArgs& args) const { |
| 20 | MIOpenBwdDataDescs D; |
| 21 | if (!is_miopen_supported(args.as_fwd_args())) |
| 22 | return false; |
| 23 | auto got = sm_miopen_ws_cache.get(args); |
| 24 | if (got.first) |
| 25 | return true; |
| 26 | args.init_desc(D); |
| 27 | size_t workspace_size; |
| 28 | auto status = miopenConvolutionBackwardDataGetWorkSpaceSize( |
| 29 | args.handle->miopen_handle(), D.diff_desc.desc, D.filter_desc.desc, |
| 30 | D.conv_desc.desc, D.grad_desc.desc, &workspace_size); |
| 31 | if (status == miopenStatusSuccess) { |
| 32 | sm_miopen_ws_cache.set(args, workspace_size); |
| 33 | return true; |
| 34 | } |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | size_t ConvolutionBackwardDataImpl::AlgoMIOpen::get_workspace_in_bytes( |
| 39 | const SizeArgs& args) const { |
nothing calls this directly
no test coverage detected