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

Method is_available

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

Source from the content-addressed store, hash-verified

17 ConvolutionForwardImpl::AlgoMIOpen::sm_miopen_ws_cache;
18
19bool ConvolutionForwardImpl::AlgoMIOpen::is_available(const SizeArgs& args) const {
20 if (!is_miopen_supported(args))
21 return false;
22 auto got = sm_miopen_ws_cache.get(args);
23 if (got.first)
24 return true;
25 MIOpenForwardDescs D;
26 args.init_desc(D);
27 size_t workspace_size;
28 auto status = miopenConvolutionForwardGetWorkSpaceSize(
29 args.handle->miopen_handle(), D.filter_desc.desc, D.src_desc.desc,
30 D.conv_desc.desc, D.dst_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 ConvolutionForwardImpl::AlgoMIOpen::get_workspace_in_bytes(
39 const SizeArgs& args) const {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected