blob: 47575d9d055de88b74808a91bd2a8c483f61174d [file] [log] [blame]
Georgios Pinitas28705162018-03-21 20:10:53 +00001/*
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 Pinitasd9eb2752018-04-03 13:44:29 +010024#include "arm_compute/graph/backends/NEON/NENodeValidator.h"
Georgios Pinitas28705162018-03-21 20:10:53 +000025
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010026#include "arm_compute/graph/backends/ValidateHelpers.h"
27#include "arm_compute/graph/nodes/Nodes.h"
Georgios Pinitas28705162018-03-21 20:10:53 +000028
29#include "arm_compute/core/utils/misc/Cast.h"
30#include "arm_compute/runtime/NEON/NEFunctions.h"
31
32using namespace arm_compute::utils::cast;
33
34namespace arm_compute
35{
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010036namespace graph
Georgios Pinitas28705162018-03-21 20:10:53 +000037{
38namespace backends
39{
40Status NENodeValidator::validate(INode *node)
41{
42 if(node == nullptr)
43 {
44 return Status{};
45 }
46
47 NodeType type = node->type();
48 switch(type)
49 {
Georgios Pinitas087eaf62018-05-16 15:52:35 +010050 case NodeType::ChannelShuffleLayer:
Georgios Pinitasdce7bef2018-07-02 18:20:40 +010051 return ARM_COMPUTE_CREATE_ERROR(arm_compute::ErrorCode::RUNTIME_ERROR, "Unsupported operation : ChannelShuffleLayer");
Georgios Pinitas28705162018-03-21 20:10:53 +000052 case NodeType::ConvolutionLayer:
53 return detail::validate_convolution_layer<NEConvolutionLayer,
54 NEDirectConvolutionLayer,
55 NEGEMMConvolutionLayer,
Georgios Pinitas9fb11592018-04-26 20:34:58 +010056 NEWinogradConvolutionLayer>(*polymorphic_downcast<ConvolutionLayerNode *>(node));
Georgios Pinitas28705162018-03-21 20:10:53 +000057 case NodeType::DepthwiseConvolutionLayer:
58 return detail::validate_depthwise_convolution_layer<NEDepthwiseConvolutionLayer,
59 NEDepthwiseConvolutionLayer3x3>(*polymorphic_downcast<DepthwiseConvolutionLayerNode *>(node));
Georgios Pinitas57c48242018-08-02 13:41:49 +010060 case NodeType::PermuteLayer:
61 return detail::validate_permute_layer<NEPermute>(*polymorphic_downcast<PermuteLayerNode *>(node));
Gian Marco Iodice23e24792018-09-07 15:32:14 +010062 case NodeType::ReorgLayer:
63 return detail::validate_reorg_layer<NEReorgLayer>(*polymorphic_downcast<ReorgLayerNode *>(node));
Michalis Spyrou96f67692018-09-13 11:39:28 +010064 case NodeType::YOLOLayer:
65 return ARM_COMPUTE_CREATE_ERROR(arm_compute::ErrorCode::RUNTIME_ERROR, "Unsupported operation : YOLOLayer");
Georgios Pinitas28705162018-03-21 20:10:53 +000066 default:
67 return Status{};
68 }
69}
70} // namespace backends
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010071} // namespace graph
Georgios Pinitas28705162018-03-21 20:10:53 +000072} // namespace arm_compute