diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2022-08-02 19:42:29 +0100 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2022-08-02 19:42:29 +0100 |
commit | c347b1727e6afb415241c77f997e311954021651 (patch) | |
tree | b2f1f3236741985a0e8e675e4f114e14b8268173 /src | |
parent | 2f2e0be2f5389c24ac74099a3300aa983bc4adcb (diff) | |
download | armnn-c347b1727e6afb415241c77f997e311954021651.tar.gz |
IVGCVSW-6889 Seg fault running ExeNet with --bf16-turbo-mode on fpga
* Added case for Bf16 to switch and changed Assertion to Exception
so it shows up in Release build.
Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Change-Id: I817260dc7b7667386c4aa734bea649383866a785
Diffstat (limited to 'src')
-rw-r--r-- | src/backends/cl/workloads/ClWorkloadUtils.hpp | 9 | ||||
-rw-r--r-- | src/backends/neon/workloads/NeonWorkloadUtils.hpp | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/backends/cl/workloads/ClWorkloadUtils.hpp b/src/backends/cl/workloads/ClWorkloadUtils.hpp index ebdd504a97..8f2fb48238 100644 --- a/src/backends/cl/workloads/ClWorkloadUtils.hpp +++ b/src/backends/cl/workloads/ClWorkloadUtils.hpp @@ -1,9 +1,10 @@ // -// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once +#include <BFloat16.hpp> #include <Half.hpp> #include <aclCommon/ArmComputeTensorUtils.hpp> @@ -139,8 +140,12 @@ inline void InitializeArmComputeClTensorData(arm_compute::CLTensor& clTensor, case DataType::Signed32: CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<int32_t>()); break; + case DataType::BFloat16: + CopyArmComputeClTensorData(clTensor, handle->GetConstTensor<armnn::BFloat16>()); + break; default: - ARMNN_ASSERT_MSG(false, "Unexpected tensor type."); + // Throw exception; assertion not called in release build. + throw Exception("Unexpected tensor type during InitializeArmComputeClTensorData()."); } }; diff --git a/src/backends/neon/workloads/NeonWorkloadUtils.hpp b/src/backends/neon/workloads/NeonWorkloadUtils.hpp index af32104399..f9c3718e14 100644 --- a/src/backends/neon/workloads/NeonWorkloadUtils.hpp +++ b/src/backends/neon/workloads/NeonWorkloadUtils.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -83,8 +83,12 @@ inline void InitializeArmComputeTensorData(arm_compute::Tensor& tensor, case DataType::QSymmS16: CopyArmComputeTensorData(tensor, handle->GetConstTensor<int16_t>()); break; + case DataType::BFloat16: + CopyArmComputeTensorData(tensor, handle->GetConstTensor<armnn::BFloat16>()); + break; default: - ARMNN_ASSERT_MSG(false, "Unexpected tensor type."); + // Throw exception; assertion not called in release build. + throw Exception("Unexpected tensor type during InitializeArmComputeTensorData()."); } }; |