diff options
Diffstat (limited to 'src/graph')
-rw-r--r-- | src/graph/TypeLoader.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/graph/TypeLoader.cpp b/src/graph/TypeLoader.cpp index 30a3546821..096188a7f9 100644 --- a/src/graph/TypeLoader.cpp +++ b/src/graph/TypeLoader.cpp @@ -38,14 +38,19 @@ arm_compute::DataType data_type_from_name(const std::string &name) { "qasymm8", DataType::QASYMM8 }, }; +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ return data_types.at(arm_compute::utility::tolower(name)); + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(const std::out_of_range &) { throw std::invalid_argument(name); } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } arm_compute::DataLayout data_layout_from_name(const std::string &name) @@ -56,14 +61,19 @@ arm_compute::DataLayout data_layout_from_name(const std::string &name) { "nchw", DataLayout::NCHW }, }; +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ return data_layouts.at(arm_compute::utility::tolower(name)); + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(const std::out_of_range &) { throw std::invalid_argument(name); } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } namespace graph { @@ -76,14 +86,19 @@ Target target_from_name(const std::string &name) { "gles", Target::GC }, }; +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ return targets.at(arm_compute::utility::tolower(name)); + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(const std::out_of_range &) { throw std::invalid_argument(name); } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } } // namespace graph } // namespace arm_compute |