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

Method get_workspace_in_bytes

dnn/src/fallback/convolution/opr_impl.cpp:129–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129size_t ConvolutionImpl::get_workspace_in_bytes(
130 const TensorLayout& src, const TensorLayout& filter, const TensorLayout& dst,
131 const PreprocessedFilter* preprocessed_filter) {
132 TensorLayoutArray layouts{src, filter, dst};
133 AlgorithmCache::Key key{this->handle(), this->get_opr_type(),
134 layouts.data(), layouts.size(),
135 &this->param(), sizeof(this->param())};
136 auto rst = AlgorithmCache::instance().get(key);
137 if (rst.policy.algo.valid()) {
138 return rst.workspace;
139 }
140
141 auto fparam = make_ncb_kern_size_param(src, filter, dst, preprocessed_filter);
142 auto&& algo = get_algorithm(fparam);
143 if (is_naive_algo(algo)) {
144 return naive::ConvolutionForwardImpl::get_workspace_in_bytes(
145 src, filter, dst, preprocessed_filter);
146 } else {
147 return NCB_ALGO_FUNC(get_workspace, algo, fparam);
148 }
149}
150
151size_t ConvolutionImpl::get_preprocess_workspace_in_bytes(
152 const TensorLayout& src, const TensorLayout& filter, const TensorLayout& dst) {

Callers 1

get_bundleFunction · 0.45

Calls 11

get_algorithmFunction · 0.85
get_workspace_in_bytesFunction · 0.50
paramFunction · 0.50
handleMethod · 0.45
get_opr_typeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
paramMethod · 0.45
getMethod · 0.45
validMethod · 0.45
enumvMethod · 0.45

Tested by

no test coverage detected