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

Method exec

dnn/src/cuda/convolution3d/forward/group_conv.cpp:91–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void Convolution3DForwardImpl::AlgoGroupConvGeneral::exec(const ExecArgs& args) const {
92 auto bundle = get_workspace_bundle(args.workspace.raw_ptr, args);
93 {
94 auto config = prepare_sub_opr(args);
95 TensorND tsrc{args.src_tensor->raw_ptr(), config.first[0]};
96 TensorND tfilter{args.filter_tensor->raw_ptr(), config.first[1]};
97 TensorND tdst{args.dst_tensor->raw_ptr(), config.first[2]};
98
99 size_t c_pos;
100 if (args.filter_meta.format == Param::Format::NCDHW) {
101 c_pos = 1;
102 } else {
103 megdnn_assert(
104 args.filter_meta.format == Param::Format::NDHWC,
105 "invalid conv format");
106 c_pos = 4;
107 }
108
109 auto grp = args.filter_meta.group;
110
111 auto&& fm = args.filter_meta;
112 auto strd_src = tsrc.layout.stride[c_pos] * fm.icpg * tsrc.layout.dtype.size(),
113 strd_dst = tdst.layout.stride[c_pos] * fm.ocpg * tdst.layout.dtype.size(),
114 strd_flt = fm.icpg * fm.ocpg * fm.spatial[0] * fm.spatial[1] *
115 fm.spatial[2] * tfilter.layout.dtype.size();
116
117 for (uint32_t g = 0; g < grp; ++g) {
118 config.second->exec(tsrc, tfilter, tdst, bundle.get_workspace(0));
119 incr_refp(tsrc.get_ref_ptr(), strd_src);
120 incr_refp(tdst.get_ref_ptr(), strd_dst);
121 incr_refp(tfilter.get_ref_ptr(), strd_flt);
122 }
123 }
124}
125
126// vim: syntax=cpp.doxygen

Callers

nothing calls this directly

Calls 7

incr_refpFunction · 0.85
prepare_sub_oprFunction · 0.70
get_workspace_bundleFunction · 0.50
raw_ptrMethod · 0.45
sizeMethod · 0.45
get_workspaceMethod · 0.45
get_ref_ptrMethod · 0.45

Tested by

no test coverage detected