| 28 | } |
| 29 | |
| 30 | void ConvBiasForwardImpl::AlgoInplaceMatmul::exec(const ExecArgs& args) const { |
| 31 | WorkspaceBundle bundle{args.workspace.raw_ptr, {get_workspace_in_bytes(args)}}; |
| 32 | TensorND conv_dst_tensor = *args.dst_tensor; |
| 33 | if (args.dst_layout->dtype.enumv() != args.bias_layout->dtype.enumv()) { |
| 34 | conv_dst_tensor = TensorND{bundle.get(0), args.dst_tensor->layout}; |
| 35 | conv_dst_tensor.layout.dtype = DType(); |
| 36 | args.opr->check_or_deduce_dtype_fwd( |
| 37 | args.src_layout->dtype, args.filter_layout->dtype, |
| 38 | conv_dst_tensor.layout.dtype); |
| 39 | } |
| 40 | |
| 41 | { |
| 42 | auto&& fm = args.filter_meta; |
| 43 | size_t N = args.src_layout->shape[0], IC = fm.icpg, |
| 44 | IH = args.src_layout->shape[2], IW = args.src_layout->shape[3], |
| 45 | OC = fm.ocpg, OH = conv_dst_tensor.layout.shape[2], |
| 46 | OW = conv_dst_tensor.layout.shape[3], FH = fm.spatial[0], |
| 47 | FW = fm.spatial[1]; |
| 48 | auto stream = args.handle->stream(); |
| 49 | conv_bias::exec_inplace_matmul_fwd( |
| 50 | args.src_tensor->ptr<dt_float32>(), |
| 51 | args.filter_tensor->ptr<dt_float32>(), |
| 52 | conv_dst_tensor.ptr<dt_float32>(), N, args.src_layout->stride[0], |
| 53 | conv_dst_tensor.layout.stride[0], IC, IH, IW, OC, OH, OW, FH, FW, |
| 54 | fm.padding[0], fm.padding[1], fm.stride[0], fm.stride[1], |
| 55 | !fm.should_flip, stream); |
| 56 | } |
| 57 | handle_bias_and_nonlinear( |
| 58 | args.handle, args.nonlinear_mode, &conv_dst_tensor, args.dst_tensor, |
| 59 | args.bias_tensor); |
| 60 | } |
| 61 | |
| 62 | // vim: syntax=cpp.doxygen |
nothing calls this directly
no test coverage detected