Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / runtime / onert / core / src / exec / Job.h
1 /*
2  * Copyright (c) 2019 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 __ONERT_EXEC_JOB_H__
18 #define __ONERT_EXEC_JOB_H__
19
20 #include <unordered_set>
21
22 #include "exec/FunctionSequence.h"
23 #include "ir/Index.h"
24 #include "ir/OperandIndexSequence.h"
25 #include "backend/Backend.h"
26
27 namespace onert
28 {
29 namespace exec
30 {
31
32 class Job
33 {
34 public:
35   /**
36    * @brief Constructs a Job object
37    *
38    * @param index Operation index for this job
39    * @param fn_seq compiled code to run this job
40    * @param inputs Input operand list
41    * @param outputs Output operand list
42    */
43   Job(uint32_t index, FunctionSequence *fn_seq);
44   /**
45    * @brief Execute the compiled code
46    */
47   void run();
48   /**
49    * @brief Return job index
50    *
51    * @return Job index
52    */
53   uint32_t index() const { return _index; }
54   /**
55    * @brief Return the function to be executed
56    *
57    * @return Pointer of the function
58    */
59   FunctionSequence *fn_seq() { return _fn_seq; }
60
61 private:
62   uint32_t _index;
63   FunctionSequence *_fn_seq;
64 };
65
66 } // namespace exec
67 } // namespace onert
68
69 #endif // __ONERT_EXEC_JOB_H__