| 24 | } |
| 25 | |
| 26 | void 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 |
nothing calls this directly
no test coverage detected