tvm
target_info.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_TARGET_TARGET_INFO_H_
25 #define TVM_TARGET_TARGET_INFO_H_
26 
27 #include <tvm/ir/expr.h>
28 
29 #include <string>
30 
31 namespace tvm {
32 
37 class MemoryInfoNode : public Object {
38  public:
40  int64_t unit_bits;
42  int64_t max_num_bits;
44  int64_t max_simd_bits;
50 
52  v->Visit("unit_bits", &unit_bits);
53  v->Visit("max_num_bits", &max_num_bits);
54  v->Visit("max_simd_bits", &max_simd_bits);
55  v->Visit("head_address", &head_address);
56  }
57 
58  static constexpr const char* _type_key = "MemoryInfo";
60 };
61 
63 class MemoryInfo : public ObjectRef {
64  public:
66 };
67 
73 TVM_DLL MemoryInfo GetMemoryInfo(const std::string& scope);
74 
75 } // namespace tvm
76 #endif // TVM_TARGET_TARGET_INFO_H_
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Memory information of special memory region. Use MemoryInfo as its container type.
Definition: target_info.h:37
int64_t max_simd_bits
maximum number of bits to be used in simd op
Definition: target_info.h:44
int64_t unit_bits
The addressable unit.
Definition: target_info.h:40
static constexpr const char * _type_key
Definition: target_info.h:58
TVM_DECLARE_FINAL_OBJECT_INFO(MemoryInfoNode, Object)
void VisitAttrs(AttrVisitor *v)
Definition: target_info.h:51
int64_t max_num_bits
Maximum number of bits supported in the memory.
Definition: target_info.h:42
PrimExpr head_address
head address of the buffer, if visible to CPU This address can be None.
Definition: target_info.h:49
Defines memory info.
Definition: target_info.h:63
TVM_DEFINE_OBJECT_REF_METHODS(MemoryInfo, ObjectRef, MemoryInfoNode)
Reference to PrimExprNode.
Definition: expr.h:115
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Base expr nodes in TVM.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
MemoryInfo GetMemoryInfo(const std::string &scope)
get memory info given scope