From 13bab71a76096985752a9e12711507021e25858d Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Fri, 13 Jan 2023 15:29:39 +0000 Subject: Fix ClGemm crashes on unsupported data types Resolves COMPMID-5814 Change-Id: I09b206374cf3844c09aebd3c664daec9c2335e6d Signed-off-by: SiCong Li Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8953 Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- src/gpu/cl/operators/ClGemm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gpu/cl/operators') diff --git a/src/gpu/cl/operators/ClGemm.cpp b/src/gpu/cl/operators/ClGemm.cpp index 4db39a635d..8db6dabe58 100644 --- a/src/gpu/cl/operators/ClGemm.cpp +++ b/src/gpu/cl/operators/ClGemm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022 Arm Limited. + * Copyright (c) 2017-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -618,6 +618,9 @@ Status ClGemm::validate(const ITensorInfo *a, const ITensorInfo *b, const ITenso const unsigned int k = a->dimension(0); const unsigned int batch_size = reinterpret_input_as_3d ? a->dimension(3) : a->dimension(2); + // Check data type early because the auto_select_gemm_kernel has assertions on supported data types + ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(a, 1, DataType::F32, DataType::F16); + // Select GEMMType CLGEMMKernelType gemm_kernel_type = auto_select_gemm_kernel(auto_heuristics::CommonQuery { -- cgit v1.2.1