Georgios Pinitas | ff421f2 | 2017-10-04 16:53:58 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 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 | */ |
| 24 | #ifndef __ARM_COMPUTE_GRAPH_CONTEXT_H__ |
| 25 | #define __ARM_COMPUTE_GRAPH_CONTEXT_H__ |
| 26 | |
| 27 | #include "arm_compute/graph/Types.h" |
| 28 | |
| 29 | namespace arm_compute |
| 30 | { |
| 31 | namespace graph |
| 32 | { |
| 33 | /** Hints that can be passed to the graph to expose parameterization */ |
| 34 | class GraphHints |
| 35 | { |
| 36 | public: |
| 37 | /** Default Constructor */ |
| 38 | GraphHints(TargetHint target_hint = TargetHint::DONT_CARE, |
| 39 | ConvolutionMethodHint conv_method_hint = ConvolutionMethodHint::GEMM); |
| 40 | /** Sets target execution hint |
| 41 | * |
| 42 | * @param target_hint Target execution hint |
| 43 | */ |
| 44 | void set_target_hint(TargetHint target_hint); |
| 45 | /** Sets convolution method to use |
| 46 | * |
| 47 | * @param convolution_method Convolution method to use |
| 48 | */ |
| 49 | void set_convolution_method_hint(ConvolutionMethodHint convolution_method); |
| 50 | /** Returns target execution hint |
| 51 | * |
| 52 | * @return target execution hint |
| 53 | */ |
| 54 | TargetHint target_hint() const; |
| 55 | /** Returns convolution method hint |
| 56 | * |
| 57 | * @return convolution method hint |
| 58 | */ |
| 59 | ConvolutionMethodHint convolution_method_hint() const; |
| 60 | |
| 61 | private: |
| 62 | TargetHint _target_hint; /**< Target execution hint */ |
| 63 | ConvolutionMethodHint _convolution_method_hint; /**< Convolution method hint */ |
| 64 | }; |
| 65 | |
| 66 | /** Graph context */ |
| 67 | class GraphContext |
| 68 | { |
| 69 | public: |
| 70 | /** Default Constuctor */ |
| 71 | GraphContext(); |
| 72 | /** Returns graph hints |
| 73 | * |
| 74 | * @return Graph hints |
| 75 | */ |
| 76 | GraphHints &hints(); |
| 77 | /** Returns graph hints |
| 78 | * |
| 79 | * @return Graph hints |
| 80 | */ |
| 81 | const GraphHints &hints() const; |
| 82 | |
| 83 | private: |
| 84 | GraphHints _hints; /**< Graph hints */ |
| 85 | }; |
| 86 | } // namespace graph |
| 87 | } // namespace arm_compute |
| 88 | #endif /* __ARM_COMPUTE_GRAPH_CONTEXT_H__ */ |