| 57 | } |
| 58 | |
| 59 | void convolution::flip_filter( |
| 60 | const ForwardSizeArgs& args, const Workspace& workspace, RefPtr& ref_ptr) { |
| 61 | auto&& fm = args.filter_meta; |
| 62 | megdnn_assert(fm.group == 1 && fm.spatial_ndim == 2); |
| 63 | auto OC = fm.ocpg, IC = fm.icpg, FH = fm.spatial[0], FW = fm.spatial[1]; |
| 64 | auto dtype = fm.dtype; |
| 65 | megdnn_assert(workspace.size >= dtype.size() * OC * IC * FH * FW); |
| 66 | |
| 67 | TensorND src{{{OC, IC, FH, FW}, dtype}, ref_ptr}, |
| 68 | dst{workspace.raw_ptr + (FH * FW - 1) * dtype.size(), src.layout}; |
| 69 | dst.layout.stride[2] = -dst.layout.stride[2]; |
| 70 | dst.layout.stride[3] = -dst.layout.stride[3]; |
| 71 | args.handle->relayout_opr()->exec(src, dst); |
| 72 | ref_ptr.reset(workspace.raw_ptr); |
| 73 | } |
| 74 | |
| 75 | // vim: syntax=cpp.doxygen |
nothing calls this directly
no test coverage detected