diff options
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/CPP/CPPScheduler.cpp | 11 | ||||
-rw-r--r-- | src/runtime/MEMUtils.cpp | 4 |
2 files changed, 13 insertions, 2 deletions
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<IScheduler::Workload> &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 */ diff --git a/src/runtime/MEMUtils.cpp b/src/runtime/MEMUtils.cpp index a45f9c80c1..be6a3b690d 100644 --- a/src/runtime/MEMUtils.cpp +++ b/src/runtime/MEMUtils.cpp @@ -48,8 +48,10 @@ void parse_mem_info(size_t &total, size_t &free, size_t &buffer) std::stringstream str_stream; str_stream << meminfo_f.rdbuf(); const std::string str = str_stream.str(); +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ std::smatch match; if(std::regex_search(str, match, std::regex("MemTotal: (.*)kB")) && match.size() > 1) { @@ -72,12 +74,14 @@ void parse_mem_info(size_t &total, size_t &free, size_t &buffer) memcache = arm_compute::support::cpp11::stoul(result, nullptr); } free = memfree + (buffer + memcache); +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(std::regex_error &e) { // failed parsing /proc/meminfo // return 0s on all fields } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } #endif // ifndef BARE_METAL } |