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

Method get_workspace_bundle

dnn/src/cambricon/group_norm/opr_impl.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20WorkspaceBundle GroupNormForwardImpl::get_workspace_bundle(
21 const TensorLayout& data, void* raw_ptr) {
22 auto handle = concrete_handle(this->handle());
23 int group_num = static_cast<int>(param().group);
24 size_t channel = data.shape[1];
25 size_t workspace_size = 0;
26 CnnlTensorDescriptor x_desc;
27 x_desc.set(data, CNNL_LAYOUT_NCHW);
28 cnnl_check(cnnlGetGroupNormForwardWorkspaceSize(
29 handle->cnnl_handle(), group_num, x_desc.desc(), &workspace_size));
30 SmallVector<size_t> sizes_in_bytes;
31 sizes_in_bytes.push_back(workspace_size);
32 return {raw_ptr, sizes_in_bytes, handle->alignment_requirement()};
33}
34
35void GroupNormForwardImpl::exec(
36 _megdnn_tensor_in data, _megdnn_tensor_in weight, _megdnn_tensor_in bias,

Callers

nothing calls this directly

Calls 8

cnnl_handleMethod · 0.80
concrete_handleFunction · 0.50
paramFunction · 0.50
handleMethod · 0.45
setMethod · 0.45
descMethod · 0.45
push_backMethod · 0.45
alignment_requirementMethod · 0.45

Tested by

no test coverage detected