From 323ce0f0b06bca785959913e75e1f51d383c351a Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 30 Nov 2018 16:30:43 +0000 Subject: COMPMID-1819 Add option to build library with -fno-exceptions Change-Id: I3de6bb33746d52f8d8c337ab7776eccee8c205fb Reviewed-on: https://review.mlplatform.org/328 Reviewed-by: Georgios Pinitas Reviewed-by: Pablo Marquez Tested-by: Arm Jenkins --- src/runtime/CPP/CPPScheduler.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/runtime/CPP') diff --git a/src/runtime/CPP/CPPScheduler.cpp b/src/runtime/CPP/CPPScheduler.cpp index 2b179fd5ff..5916bb46fd 100644 --- a/src/runtime/CPP/CPPScheduler.cpp +++ b/src/runtime/CPP/CPPScheduler.cpp @@ -190,15 +190,19 @@ void CPPScheduler::Thread::worker_thread() return; } +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_ENABLED */ process_workloads(*_workloads, *_feeder, _info); + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(...) { _current_exception = std::current_exception(); } - +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ _job_complete = true; lock.unlock(); _cv.notify_one(); @@ -250,18 +254,21 @@ void CPPScheduler::run_workloads(std::vector &workloads) info.thread_id = t; process_workloads(workloads, feeder, info); - +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ for(auto &thread : _threads) { thread.wait(); } +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(const std::system_error &e) { std::cerr << "Caught system_error with code " << e.code() << " meaning " << e.what() << '\n'; } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } #endif /* DOXYGEN_SKIP_THIS */ -- cgit v1.2.1