| 74 | } |
| 75 | |
| 76 | void 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 |
nothing calls this directly
no test coverage detected