From 47752c9fbbeec34ef7f9996f01ef9f9b2ccb8336 Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Tue, 18 Jul 2017 13:38:47 +0100 Subject: COMPMID-415: Catch cl::Error Change-Id: Ic32d871e2dcf889b02dd9cf462a1a4920dc2d0cb Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80907 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- framework/Framework.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'framework/Framework.cpp') diff --git a/framework/Framework.cpp b/framework/Framework.cpp index 1f09550830..7708537fd6 100644 --- a/framework/Framework.cpp +++ b/framework/Framework.cpp @@ -26,6 +26,10 @@ #include "Exceptions.h" #include "support/ToolchainSupport.h" +#ifdef ARM_COMPUTE_CL +#include "arm_compute/core/CL/OpenCL.h" +#endif /* ARM_COMPUTE_CL */ + #include #include #include @@ -237,6 +241,18 @@ void Framework::run_test(TestCaseFactory &test_factory) throw; } } +#ifdef ARM_COMPUTE_CL + catch(const ::cl::Error &error) + { + std::cerr << "FATAL CL ERROR: " << error.what() << " with code " << error.err() << "\n"; + result.status = TestResult::Status::FAILED; + + if(_throw_errors) + { + throw; + } + } +#endif /* ARM_COMPUTE_CL */ catch(const std::exception &error) { std::cerr << "FATAL ERROR: Received unhandled error: '" << error.what() << "'\n"; -- cgit v1.2.1