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

Method flip_filter

dnn/src/cuda/convolution3d/helper.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void convolution3d::flip_filter(
27 const ForwardSizeArgs& args, const Workspace& workspace, RefPtr& ref_ptr) {
28 auto&& fm = args.filter_meta;
29 megdnn_assert(fm.group == 1 && fm.spatial_ndim == 3);
30 auto OC = fm.ocpg, IC = fm.icpg, FD = fm.spatial[0], FH = fm.spatial[1],
31 FW = fm.spatial[2];
32 auto dtype = DType::from_enum(fm.dtype_enum);
33 megdnn_assert(workspace.size >= dtype.size() * OC * IC * FD * FH * FW);
34 TensorND src{{{OC, IC, FD, FH, FW}, dtype}, ref_ptr},
35 dst{workspace.raw_ptr + (FD * FH * FW - 1) * dtype.size(), src.layout};
36 dst.layout.stride[2] = -dst.layout.stride[2];
37 dst.layout.stride[3] = -dst.layout.stride[3];
38 dst.layout.stride[4] = -dst.layout.stride[4];
39 args.handle->relayout_opr()->exec(src, dst);
40 ref_ptr.reset(workspace.raw_ptr);
41}
42
43// vim: syntax=cpp.doxygen

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
execMethod · 0.45
relayout_oprMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected