summaryrefslogtreecommitdiff
path: root/compiler/angkor/README.md
blob: f761b874060dcb3ade96e0e7dd43bf4b533ba86f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# angkor

## Purpose

_angkor_ is a `nncc` core library

## How to use

_angkor_ implements abstract data type(ADT) for feature, kernel, tensor.
There are layout, shape information and enumerator and so on.

To use some of these things, just insert `include`!
```cpp
#include <nncc/core/ADT/feature/WHAT_YOU_WANT>
#include <nncc/core/ADT/kernel/WHAT_YOU_WANT>
#include <nncc/core/ADT/tensor/WHAT_YOU_WANT>
```

## Example

- `compiler/coco/core/CMakeLists.txt`

```cmake
target_link_libraries(coco_core PUBLIC angkor)
```

- `compiler/coco/core/src/IR/Arg.cpp`

```cpp
#include "coco/IR/Arg.h"

#include <nncc/core/ADT/tensor/LexicalLayout.h>
#include <nncc/core/ADT/tensor/IndexEnumerator.h>

namespace
{
const nncc::core::ADT::tensor::LexicalLayout l;
}

namespace coco
{

Arg::Arg(const nncc::core::ADT::tensor::Shape &shape) : _shape{shape}, _bag{nullptr}
{
  _map.resize(nncc::core::ADT::tensor::num_elements(shape));
}

// ....

}
```