Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 ARM Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 24 | #include "arm_compute/graph/backends/CL/CLNodeValidator.h" |
Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 25 | |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 26 | #include "arm_compute/graph/backends/ValidateHelpers.h" |
| 27 | #include "arm_compute/graph/nodes/Nodes.h" |
Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 28 | |
| 29 | #include "arm_compute/core/utils/misc/Cast.h" |
| 30 | #include "arm_compute/runtime/CL/CLFunctions.h" |
| 31 | |
| 32 | using namespace arm_compute::utils::cast; |
| 33 | |
| 34 | namespace arm_compute |
| 35 | { |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 36 | namespace graph |
Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 37 | { |
| 38 | namespace backends |
| 39 | { |
| 40 | Status CLNodeValidator::validate(INode *node) |
| 41 | { |
| 42 | if(node == nullptr) |
| 43 | { |
| 44 | return Status{}; |
| 45 | } |
| 46 | |
| 47 | NodeType type = node->type(); |
| 48 | switch(type) |
| 49 | { |
| 50 | case NodeType::ConvolutionLayer: |
| 51 | return detail::validate_convolution_layer<CLConvolutionLayer, |
| 52 | CLDirectConvolutionLayer, |
| 53 | CLGEMMConvolutionLayer, |
| 54 | CLWinogradConvolutionLayer>(*polymorphic_downcast<ConvolutionLayerNode *>(node)); |
| 55 | case NodeType::DepthwiseConvolutionLayer: |
| 56 | return detail::validate_depthwise_convolution_layer<CLDepthwiseConvolutionLayer, |
| 57 | CLDepthwiseConvolutionLayer3x3>(*polymorphic_downcast<DepthwiseConvolutionLayerNode *>(node)); |
| 58 | default: |
| 59 | return Status{}; |
| 60 | } |
| 61 | } |
| 62 | } // namespace backends |
Georgios Pinitas | d9eb275 | 2018-04-03 13:44:29 +0100 | [diff] [blame] | 63 | } // namespace graph |
Georgios Pinitas | 2870516 | 2018-03-21 20:10:53 +0000 | [diff] [blame] | 64 | } // namespace arm_compute |