ONE - On-device Neural Engine
Loading...
Searching...
No Matches
CircleExporter.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 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 __LUCI_CIRCLEEXPORTER_H__
18#define __LUCI_CIRCLEEXPORTER_H__
19
20#include <luci/IR/Module.h>
21
22#include <loco.h>
23
24#include <memory>
25
26namespace luci
27{
28
30{
31public:
32 // This contract class describes the interaction between a exporter and its client.
33 struct Contract
34 {
35 public:
36 virtual ~Contract() = default;
37
38 public: // Client -> Exporter
39 // Input Module (to be exported)
40 // Exporter expects a luci module that consists of loco graphs
41 virtual luci::Module *module(void) const = 0;
42
43 public: // Exporter -> Client
44 // Exporter calls store for export data
45 // Notice: Please DO NOT STORE ptr and size when implementing this in Client
46 virtual bool store(const char *ptr, const size_t size) const = 0;
47 };
48
49public:
50 explicit CircleExporter();
51
52public:
53 // invoke(...) returns false on failure.
54 bool invoke(Contract *) const;
55};
56
57} // namespace luci
58
59#endif // __LUCI_CIRCLEEXPORTER_H__
bool invoke(Contract *) const
Collection of 'loco::Graph's.
Definition Module.h:33
int32_t size[5]
Definition Slice.cpp:35
virtual bool store(const char *ptr, const size_t size) const =0
virtual luci::Module * module(void) const =0