ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Overlay.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef __NNCC_CORE_ADT_TENSOR_OVERLAY_H__
18
#define __NNCC_CORE_ADT_TENSOR_OVERLAY_H__
19
20
#include "
nncc/core/ADT/tensor/View.h
"
21
22
namespace
nncc
23
{
24
namespace
core
25
{
26
namespace
ADT
27
{
28
namespace
tensor
29
{
30
31
template
<
typename
T>
class
Overlay
final :
public
View
<T>
32
{
33
public
:
34
explicit
Overlay
(
const
Shape
&
shape
,
const
Layout
&layout, T *
base
)
35
:
View
<T>{
shape
, layout}, _base{
base
}
36
{
37
// DO NOTHING
38
}
39
40
public
:
41
T *
base
(
void
)
override
{
return
_base; }
42
const
T *
base
(
void
)
const override
{
return
_base; }
43
44
private
:
45
T *
const
_base;
46
};
47
48
template
<
typename
T,
typename
LayoutImpl>
Overlay<T>
make_overlay
(
const
Shape
&shape, T *base)
49
{
50
return
Overlay<T>
{shape, LayoutImpl{}, base};
51
}
52
53
}
// namespace tensor
54
}
// namespace ADT
55
}
// namespace core
56
}
// namespace nncc
57
58
#endif
// __NNCC_CORE_ADT_TENSOR_OVERLAY_H__
nncc::core::ADT::tensor::Layout
Definition
Layout.h:33
nncc::core::ADT::tensor::Overlay
Definition
Overlay.h:32
nncc::core::ADT::tensor::Overlay::base
const T * base(void) const override
Definition
Overlay.h:42
nncc::core::ADT::tensor::Overlay::base
T * base(void) override
Definition
Overlay.h:41
nncc::core::ADT::tensor::Overlay::Overlay
Overlay(const Shape &shape, const Layout &layout, T *base)
Definition
Overlay.h:34
nncc::core::ADT::tensor::Shape
Definition
Shape.h:34
nncc::core::ADT::tensor::View
Definition
View.h:36
nncc::core::ADT::tensor::View::shape
const Shape & shape(void) const
Definition
View.h:58
View.h
GenH5RandomInputs.tensor
tensor
Definition
GenH5RandomInputs.py:61
nncc::core::ADT::tensor::make_overlay
Overlay< T > make_overlay(const Shape &shape, T *base)
Definition
Overlay.h:48
nncc
Definition
Accessor.h:23
compiler
angkor
include
nncc
core
ADT
tensor
Overlay.h
Generated by
1.9.8