| 180 | } |
| 181 | |
| 182 | size_t ConvBiasImpl::AlgoNaive::get_workspace(const NCBKernSizeParam& p) const { |
| 183 | MIDOUT_BEGIN(megdnn_fallback_naive, 1) { |
| 184 | auto layouts = get_layouts(p); |
| 185 | //! When group>1 or n>1, this algo will parallel by group and n |
| 186 | size_t nr_threads = p.nr_threads; |
| 187 | auto conv_opr = inplace_cpu_handle()->create_operator<ConvolutionForward>(); |
| 188 | conv_opr->param() = get_param_convolution(p); |
| 189 | if (p.dst_type.enumv() == DTypeEnum::QuantizedS8 || |
| 190 | p.dst_type.enumv() == DTypeEnum::Quantized8Asymm) { |
| 191 | TensorLayout conv_dst_layout; |
| 192 | conv_opr->deduce_layout(layouts[0], layouts[1], conv_dst_layout); |
| 193 | WorkspaceBundle bundle(nullptr, {conv_dst_layout.span().dist_byte()}); |
| 194 | return bundle.total_size_in_bytes() * nr_threads; |
| 195 | } |
| 196 | return 0; |
| 197 | } |
| 198 | MIDOUT_END(); |
| 199 | return 0; |
| 200 | } |
| 201 | |
| 202 | SmallVector<ConvBiasImpl::NCBKern> ConvBiasImpl::AlgoNaive::dispatch_kerns( |
| 203 | const NCBKernSizeParam& p) const { |
no test coverage detected