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/ffi/reflection/registry.h>
28 #include <tvm/ir/expr.h>
29 
30 #include <string>
31 
32 namespace tvm {
33 
38 class MemoryInfoNode : public Object {
39  public:
41  int64_t unit_bits;
43  int64_t max_num_bits;
45  int64_t max_simd_bits;
51 
52  static void RegisterReflection() {
53  namespace refl = tvm::ffi::reflection;
54  refl::ObjectDef<MemoryInfoNode>()
55  .def_ro("unit_bits", &MemoryInfoNode::unit_bits)
56  .def_ro("max_num_bits", &MemoryInfoNode::max_num_bits)
57  .def_ro("max_simd_bits", &MemoryInfoNode::max_simd_bits)
58  .def_ro("head_address", &MemoryInfoNode::head_address);
59  }
60 
61  static constexpr const char* _type_key = "target.MemoryInfo";
62 
64 };
65 
67 class MemoryInfo : public ObjectRef {
68  public:
70 };
71 
77 TVM_DLL MemoryInfo GetMemoryInfo(const std::string& scope);
78 
79 } // namespace tvm
80 #endif // TVM_TARGET_TARGET_INFO_H_
Memory information of special memory region. Use MemoryInfo as its container type.
Definition: target_info.h:38
int64_t max_simd_bits
maximum number of bits to be used in simd op
Definition: target_info.h:45
int64_t unit_bits
The addressable unit.
Definition: target_info.h:41
static constexpr const char * _type_key
Definition: target_info.h:61
TVM_DECLARE_FINAL_OBJECT_INFO(MemoryInfoNode, Object)
static void RegisterReflection()
Definition: target_info.h:52
int64_t max_num_bits
Maximum number of bits supported in the memory.
Definition: target_info.h:43
PrimExpr head_address
head address of the buffer, if visible to CPU This address can be None.
Definition: target_info.h:50
Defines memory info.
Definition: target_info.h:67
TVM_DEFINE_OBJECT_REF_METHODS(MemoryInfo, ObjectRef, MemoryInfoNode)
Reference to PrimExprNode.
Definition: expr.h:129
Base expr nodes in TVM.
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
MemoryInfo GetMemoryInfo(const std::string &scope)
get memory info given scope