From 0b271330cf12b029148a75af75fa38582848b4f6 Mon Sep 17 00:00:00 2001 From: Pablo Marquez Tello Date: Mon, 12 Jul 2021 12:51:22 +0100 Subject: Disabled DirectConv method for NCHW and kernel > 15 * We prefer GEMM method for kernel size > 15 when data layout is NCHW because direct convolution does not support this. * Resolves COMPMID-4581 Change-Id: Ie18cc96bc6b446fd59e8c8ebb10c3af5ca02c3bb Signed-off-by: Pablo Marquez Tello Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5935 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: Michele Di Giorgio --- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/runtime/NEON/functions/NEConvolutionLayer.cpp') diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index e43d976944..1022e397d0 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -180,9 +180,10 @@ ConvolutionMethod NEConvolutionLayer::get_convolution_method(const ITensorInfo * } else { + const auto input_layout = input->data_layout(); // SRGAN // Output might not be initialized when it is an internal tensor of the layer using the convolution - if(input->total_size() > 1e7 && (weights->dimension(idx_h) > 7) + if(input_layout == DataLayout::NHWC && input->total_size() > 1e7 && (weights->dimension(idx_h) > 7) && (NEDirectConvolutionLayer::validate(input, weights, nullptr, output, conv_info, act_info))) { return ConvolutionMethod::DIRECT; -- cgit v1.2.1