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

Method flip_filter

dnn/src/rocm/convolution/helper.cpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void convolution::flip_filter(
77 const ForwardSizeArgs& args, const Workspace& workspace, RefPtr& ref_ptr) {
78 auto&& fm = args.filter_meta;
79 megdnn_assert(fm.group == 1 && fm.spatial_ndim == 2);
80 auto OC = fm.ocpg, IC = fm.icpg, FH = fm.spatial[0], FW = fm.spatial[1];
81 auto dtype = fm.dtype;
82 megdnn_assert(workspace.size >= dtype.size() * OC * IC * FH * FW);
83
84 TensorND src{{{OC, IC, FH, FW}, dtype}, ref_ptr},
85 dst{workspace.raw_ptr + (FH * FW - 1) * dtype.size(), src.layout};
86 dst.layout.stride[2] = -dst.layout.stride[2];
87 dst.layout.stride[3] = -dst.layout.stride[3];
88 args.handle->relayout_opr()->exec(src, dst);
89 ref_ptr.reset(workspace.raw_ptr);
90}
91
92// 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