blob: a922dd53fe1e4be06a141fea056a0ae71896ea3d [file] [log] [blame]
Georgios Pinitase2c82fe2017-10-02 18:51:47 +01001/*
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_ITENSOROBJECT_H__
25#define __ARM_COMPUTE_GRAPH_ITENSOROBJECT_H__
26
27#include "arm_compute/graph/ITensorAccessor.h"
28#include "arm_compute/graph/Types.h"
29#include "support/ToolchainSupport.h"
30
31#include <memory>
32
33namespace arm_compute
34{
35namespace graph
36{
37/** Tensor object interface */
38class ITensorObject
39{
40public:
41 /** Default Destructor */
42 virtual ~ITensorObject() = default;
43 /** Calls accessor on tensor
44 *
45 * @return True if succeeds else false
46 */
47 virtual bool call_accessor() = 0;
48 /** Checks if tensor has an accessor set.
49 *
50 * @return True if an accessor has been set else false
51 */
52 virtual bool has_accessor() const = 0;
53 /** Sets target of the tensor
54 *
55 * @param[in] target Target where the tensor should be pinned in
56 *
57 * @return Backend tensor
58 */
59 virtual ITensor *set_target(TargetHint target) = 0;
60 /** Returns a pointer to the internal tensor
61 *
62 * @return Tensor
63 */
Michalis Spyroued194b12017-10-31 15:04:34 +000064 virtual ITensor *tensor() = 0;
65 virtual const ITensor *tensor() const = 0;
Georgios Pinitase2c82fe2017-10-02 18:51:47 +010066 /** Return the target that this tensor is pinned on
67 *
68 * @return Target of the tensor
69 */
70 virtual TargetHint target() const = 0;
71 /** Allocates the tensor */
72 virtual void allocate() = 0;
73};
74} // namespace graph
75} // namespace arm_compute
76#endif /* __ARM_COMPUTE_GRAPH_ITENSOROBJECT_H__ */