diff options
author | John Kesapides <john.kesapides@arm.com> | 2019-01-21 14:13:27 +0000 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-03-04 09:12:47 +0000 |
commit | fb68ca1f087833ae04de5700ad6ed88b51a1d17b (patch) | |
tree | d00bfa5ab72d0f9217a9e9dfb9b8a15dcd5c4c29 /src/graph | |
parent | ba3682521398f228d6db6fb1bfbe464536b8d002 (diff) | |
download | ComputeLibrary-fb68ca1f087833ae04de5700ad6ed88b51a1d17b.tar.gz |
COMPMID-1490 Create graph_convolution.cpp
Create a standalone graph_convolution example
Change-Id: I6026bd74373d47c1eb0ffe6b66a1464a3656a0b4
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Reviewed-on: https://review.mlplatform.org/c/585
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'src/graph')
-rw-r--r-- | src/graph/TypeLoader.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/graph/TypeLoader.cpp b/src/graph/TypeLoader.cpp index e0ba7e2d50..0c1ce25b92 100644 --- a/src/graph/TypeLoader.cpp +++ b/src/graph/TypeLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -17,7 +17,7 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWNISE, ARISING FROM, + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ @@ -100,5 +100,30 @@ Target target_from_name(const std::string &name) } #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } + +ConvolutionMethod Convolution_method_from_name(const std::string &name) +{ + static const std::map<std::string, ConvolutionMethod> methods = + { + { "default", ConvolutionMethod::Default }, + { "direct", ConvolutionMethod::Direct }, + { "gemm", ConvolutionMethod::GEMM }, + { "winograd", ConvolutionMethod::Winograd }, + }; + +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED + try + { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ + return methods.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 |