1 | /* |
2 | * Licensed to the Apache Software Foundation (ASF) under one |
3 | * or more contributor license agreements. See the NOTICE file |
4 | * distributed with this work for additional information |
5 | * regarding copyright ownership. The ASF licenses this file |
6 | * to you under the Apache License, Version 2.0 (the |
7 | * "License"); you may not use this file except in compliance |
8 | * with the License. You may obtain a copy of the License at |
9 | * |
10 | * http://www.apache.org/licenses/LICENSE-2.0 |
11 | * |
12 | * Unless required by applicable law or agreed to in writing, |
13 | * software distributed under the License is distributed on an |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 | * KIND, either express or implied. See the License for the |
16 | * specific language governing permissions and limitations |
17 | * under the License. |
18 | */ |
19 | |
20 | /*! |
21 | * \file tvm/runtime/container/closure.h |
22 | * \brief Runtime Closure container types. |
23 | */ |
24 | #ifndef TVM_RUNTIME_CONTAINER_CLOSURE_H_ |
25 | #define TVM_RUNTIME_CONTAINER_CLOSURE_H_ |
26 | |
27 | #include "./base.h" |
28 | |
29 | namespace tvm { |
30 | namespace runtime { |
31 | |
32 | /*! |
33 | * \brief An object representing a closure. This object is used by both the |
34 | * Relay VM and interpreter. |
35 | */ |
36 | class ClosureObj : public Object { |
37 | public: |
38 | static constexpr const uint32_t _type_index = TypeIndex::kRuntimeClosure; |
39 | static constexpr const char* _type_key = "runtime.Closure" ; |
40 | TVM_DECLARE_BASE_OBJECT_INFO(ClosureObj, Object); |
41 | }; |
42 | |
43 | /*! \brief reference to closure. */ |
44 | class Closure : public ObjectRef { |
45 | public: |
46 | TVM_DEFINE_OBJECT_REF_METHODS(Closure, ObjectRef, ClosureObj); |
47 | }; |
48 | |
49 | } // namespace runtime |
50 | } // namespace tvm |
51 | |
52 | #endif // TVM_RUNTIME_CONTAINER_CLOSURE_H_ |
53 | |