aboutsummaryrefslogtreecommitdiff
path: root/src/gpu/cl/operators/ClConv2d.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-12-07 13:49:10 +0000
committerSheri Zhang <sheri.zhang@arm.com>2021-12-10 14:48:54 +0000
commit8d07127f5c8f0e189ee0db4feb88c0c0b47608d5 (patch)
treebca9b835e5f171d973e9bf2ca076f86cd71670ec /src/gpu/cl/operators/ClConv2d.cpp
parentb75d62430e9871fcc6f19cf82879f65d2e7fb201 (diff)
downloadComputeLibrary-8d07127f5c8f0e189ee0db4feb88c0c0b47608d5.tar.gz
Use #if directive instead of regular condition in CLDirectConv2D
Resolve COMPMID-5004 Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Change-Id: Ib3e1b5a891234316c411ea9825ec10c68c4ab5a3 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6788 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Sheri Zhang <sheri.zhang@arm.com>
Diffstat (limited to 'src/gpu/cl/operators/ClConv2d.cpp')
-rw-r--r--src/gpu/cl/operators/ClConv2d.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gpu/cl/operators/ClConv2d.cpp b/src/gpu/cl/operators/ClConv2d.cpp
index 92b22e758d..2b9a51df22 100644
--- a/src/gpu/cl/operators/ClConv2d.cpp
+++ b/src/gpu/cl/operators/ClConv2d.cpp
@@ -258,20 +258,15 @@ ConvolutionMethod ClConv2d::get_convolution_method(const ITensorInfo *src, const
const bool is_large_kernel_sz = (weights->dimension(idx_w) >= kernel_sz_direct_conv_thr) && (weights->dimension(idx_h) >= kernel_sz_direct_conv_thr);
const bool is_ifm_ge_16 = src->dimension(idx_c) >= 16;
const bool is_ifm_gt_ofm = weights->dimension(0U) * weights->dimension(1U) * weights->dimension(2U) > weights->dimension(3U);
- const bool is_ofm_le_4 = weights->dimension(3U) <= 4;
// Run Winograd if valid and IFM >= 16
if(is_wino_valid && is_ifm_ge_16)
{
return ConvolutionMethod::WINOGRAD;
}
- // Run Direct for Large kernel size
- if(is_large_kernel_sz && is_ifm_gt_ofm && is_direct_valid)
- {
- return ConvolutionMethod::DIRECT;
- }
- if(is_ofm_le_4 && is_ifm_gt_ofm && is_direct_valid)
+ // Run Direct for Large kernel size
+ if(is_large_kernel_sz && is_ifm_ge_16 && is_direct_valid && is_ifm_gt_ofm)
{
return ConvolutionMethod::DIRECT;
}