| 102 | } |
| 103 | |
| 104 | void ConvBiasForwardImpl::AlgoMatmul::exec(const ExecArgs& args) const { |
| 105 | auto bundle = get_workspace_bundle(args.workspace.raw_ptr, args); |
| 106 | TensorND conv_dst_tensor = *args.dst_tensor; |
| 107 | if (args.dst_layout->dtype.enumv() != args.bias_layout->dtype.enumv()) { |
| 108 | conv_dst_tensor = TensorND{ |
| 109 | bundle.get(bundle.nr_workspace() - 1), args.dst_tensor->layout}; |
| 110 | conv_dst_tensor.layout.dtype = DType(); |
| 111 | args.opr->check_or_deduce_dtype_fwd( |
| 112 | args.src_layout->dtype, args.filter_layout->dtype, |
| 113 | conv_dst_tensor.layout.dtype); |
| 114 | } |
| 115 | |
| 116 | ExecArgs conv_args = args; |
| 117 | conv_args.dst_tensor = &conv_dst_tensor; |
| 118 | { |
| 119 | switch (conv_args.src_layout->dtype.enumv()) { |
| 120 | #define cb(dt) \ |
| 121 | case DTypeTrait<dt>::enumv: { \ |
| 122 | using ctype = typename DTypeTrait<dt>::ctype; \ |
| 123 | exec_internal<ctype>(conv_args, bundle); \ |
| 124 | break; \ |
| 125 | } |
| 126 | MEGDNN_FOREACH_COMPUTING_DTYPE_FLOAT(cb); |
| 127 | #undef cb |
| 128 | default: |
| 129 | megdnn_assert_internal(0); |
| 130 | } |
| 131 | } |
| 132 | handle_bias_and_nonlinear( |
| 133 | args.handle, args.nonlinear_mode, &conv_dst_tensor, args.dst_tensor, |
| 134 | args.bias_tensor); |
| 135 | } |
| 136 | |
| 137 | template <typename T> |
| 138 | void ConvBiasForwardImpl::AlgoMatmul::exec_internal( |
no test coverage detected