tvm
op.h
Go to the documentation of this file.
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 
24 #ifndef TVM_RELAX_ATTRS_OP_H_
25 #define TVM_RELAX_ATTRS_OP_H_
26 
27 #include <tvm/ir/global_info.h>
28 #include <tvm/relax/expr.h>
29 
30 namespace tvm {
31 namespace relax {
32 
34 struct CallTIRWithGradAttrs : public tvm::AttrsNode<CallTIRWithGradAttrs> {
37 
38  TVM_DECLARE_ATTRS(CallTIRWithGradAttrs, "relax.attrs.CallTIRWithGradAttrs") {
40  .describe(
41  "The name of the te gradient function associated with this call_tir_with_grad node.");
43  .describe("The keyword arguments passed to the te gradient function.");
44  }
45 }; // struct CallTIRAttrs
46 
48 struct CallTIRInplaceAttrs : public tvm::AttrsNode<CallTIRInplaceAttrs> {
50 
51  TVM_DECLARE_ATTRS(CallTIRInplaceAttrs, "relax.attrs.CallTIRInplaceAttrs") {
53  .describe(
54  "Indices that describe which input corresponds to which output. If the `i`th member "
55  "has the value `k` >= 0, then that means that input `k` should be used to store the "
56  "`i`th output. If an element has the value -1, that means a new tensor should be "
57  "allocated for that output.");
58  }
59 }; // struct CallTIRInplaceAttrs
60 
62 struct CallInplacePackedAttrs : public tvm::AttrsNode<CallInplacePackedAttrs> {
64 
65  TVM_DECLARE_ATTRS(CallInplacePackedAttrs, "relax.attrs.CallInplacePackedAttrs") {
67  .describe(
68  "Indices that describe which input corresponds to which output. If the `i`th member "
69  "has the value `k` >= 0, then that means that input `k` should be used to store the "
70  "`i`th output. If an element has the value -1, that means the output will be newly "
71  "allocated.");
72  }
73 }; // struct CallInplacePackedAttrs
74 
76 struct ToVDeviceAttrs : public tvm::AttrsNode<ToVDeviceAttrs> {
78  TVM_DECLARE_ATTRS(ToVDeviceAttrs, "relax.attrs.ToVDeviceAttrs") {
79  TVM_ATTR_FIELD(dst_vdevice).describe("The destination device where the data is copied to.");
80  }
81 }; // struct ToVDeviceAttrs
82 
84 struct HintOnDeviceAttrs : public tvm::AttrsNode<HintOnDeviceAttrs> {
85  int32_t dev_type;
86  int32_t dev_id;
87  TVM_DECLARE_ATTRS(HintOnDeviceAttrs, "relax.attrs.HintOnDeviceAttrs") {
88  TVM_ATTR_FIELD(dev_type).describe("The device type where the data is supposed to be executed.");
89  TVM_ATTR_FIELD(dev_id).describe("The device id.");
90  }
91 }; // struct HintOnDeviceAttrs
92 
93 } // namespace relax
94 } // namespace tvm
95 
96 #endif // TVM_RELAX_ATTRS_OP_H_
#define TVM_ATTR_FIELD(FieldName)
Declare an attribute field.
Definition: attrs.h:76
The base class of the all the Use "curiously recurring template pattern".
Definition: attrs.h:870
Managed reference to VDeviceNode.
Definition: global_info.h:95
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
Reference to string objects.
Definition: string.h:97
GlobalInfo are globally static object that are referred by the IR itself.
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
Attributes used in call_inplace_packed.
Definition: op.h:62
TVM_DECLARE_ATTRS(CallInplacePackedAttrs, "relax.attrs.CallInplacePackedAttrs")
Definition: op.h:65
Array< Integer > inplace_indices
Definition: op.h:63
Attributes used in call_tir_inplace.
Definition: op.h:48
Array< Integer > inplace_indices
Definition: op.h:49
TVM_DECLARE_ATTRS(CallTIRInplaceAttrs, "relax.attrs.CallTIRInplaceAttrs")
Definition: op.h:51
Attributes used in call_tir_with_grad.
Definition: op.h:34
String te_grad_name
Definition: op.h:35
Map< String, ObjectRef > te_grad_kwargs
Definition: op.h:36
TVM_DECLARE_ATTRS(CallTIRWithGradAttrs, "relax.attrs.CallTIRWithGradAttrs")
Definition: op.h:38
Attributes used in hint_on_device.
Definition: op.h:84
int32_t dev_id
Definition: op.h:86
int32_t dev_type
Definition: op.h:85
TVM_DECLARE_ATTRS(HintOnDeviceAttrs, "relax.attrs.HintOnDeviceAttrs")
Definition: op.h:87
Attributes used in to_vdevice.
Definition: op.h:76
VDevice dst_vdevice
Definition: op.h:77
TVM_DECLARE_ATTRS(ToVDeviceAttrs, "relax.attrs.ToVDeviceAttrs")
Definition: op.h:78