diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2018-10-19 16:46:15 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-22 16:57:54 +0100 |
commit | a8e06ed540a934f966679e1ef1cf7acf295211b3 (patch) | |
tree | 247035d1bce6ddb8543081a88294a85e34968035 /src/backends/MakeWorkloadHelper.hpp | |
parent | f0b4845c1c6f24f59d4c88473b852cf69a3c7ae9 (diff) | |
download | armnn-a8e06ed540a934f966679e1ef1cf7acf295211b3.tar.gz |
IVGCVSW-1955: Unify backend exceptions (wrap cl::Error)
* Added wrapper function around arm_compute::IFunction::run() that catches
cl::Error and wraps it into an armnn::RuntimeException
* Added MakeWorkload template inside ClWorkloadFactory that catches
cl::Error and wraps it into an armnn::RuntimeException
* Replaced cl::Error with armnn::RuntimeException in catch statements inside
LoadedNetwork
Change-Id: I2340f41ae02b8db1d7ef5157824a50e7410854e3
Diffstat (limited to 'src/backends/MakeWorkloadHelper.hpp')
-rw-r--r-- | src/backends/MakeWorkloadHelper.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backends/MakeWorkloadHelper.hpp b/src/backends/MakeWorkloadHelper.hpp index 281a65a21e..78a9669530 100644 --- a/src/backends/MakeWorkloadHelper.hpp +++ b/src/backends/MakeWorkloadHelper.hpp @@ -39,7 +39,9 @@ struct MakeWorkloadForType<NullWorkload> // Specify type void as the WorkloadType for unsupported DataType/WorkloadType combos. template <typename Float16Workload, typename Float32Workload, typename Uint8Workload, typename QueueDescriptorType, typename... Args> -std::unique_ptr<IWorkload> MakeWorkload(const QueueDescriptorType& descriptor, const WorkloadInfo& info, Args&&... args) +std::unique_ptr<IWorkload> MakeWorkloadHelper(const QueueDescriptorType& descriptor, + const WorkloadInfo& info, + Args&&... args) { const DataType dataType = !info.m_InputTensorInfos.empty() ? info.m_InputTensorInfos[0].GetDataType() @@ -67,9 +69,11 @@ std::unique_ptr<IWorkload> MakeWorkload(const QueueDescriptorType& descriptor, c // FloatWorkload, Uint8Workload>. // Specify type void as the WorkloadType for unsupported DataType/WorkloadType combos. template <typename FloatWorkload, typename Uint8Workload, typename QueueDescriptorType, typename... Args> -std::unique_ptr<IWorkload> MakeWorkload(const QueueDescriptorType& descriptor, const WorkloadInfo& info, Args&&... args) +std::unique_ptr<IWorkload> MakeWorkloadHelper(const QueueDescriptorType& descriptor, + const WorkloadInfo& info, + Args&&... args) { - return MakeWorkload<FloatWorkload, FloatWorkload, Uint8Workload>(descriptor, info, + return MakeWorkloadHelper<FloatWorkload, FloatWorkload, Uint8Workload>(descriptor, info, std::forward<Args>(args)...); } |