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

Method is_available

dnn/src/rocm/convolution/backward_data/miopen.cpp:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 ConvolutionBackwardDataImpl::AlgoMIOpen::sm_miopen_ws_cache;
18
19bool 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
38size_t ConvolutionBackwardDataImpl::AlgoMIOpen::get_workspace_in_bytes(
39 const SizeArgs& args) const {

Callers

nothing calls this directly

Calls 5

miopen_handleMethod · 0.80
as_fwd_argsMethod · 0.45
getMethod · 0.45
init_descMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected