Skip to content

Commit ace1052

Browse files
committed
[BREAKING CHANGE] Prefix all type keys and function names with "tvm."
1 parent ec0fed0 commit ace1052

File tree

876 files changed

+3750
-3595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

876 files changed

+3750
-3595
lines changed

apps/cpp_rpc/rpc_server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ void RPCServerCreate(std::string host, int port, int port_end, std::string track
401401

402402
TVM_FFI_STATIC_INIT_BLOCK() {
403403
namespace refl = tvm::ffi::reflection;
404-
refl::GlobalDef().def("rpc.ServerCreate", RPCServerCreate);
404+
refl::GlobalDef().def("tvm.rpc.ServerCreate", RPCServerCreate);
405405
}
406406
} // namespace runtime
407407
} // namespace tvm

apps/hexagon_launcher/launcher_core.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,13 @@ const tvm::ffi::Function get_module_func(tvm::runtime::Module module, const std:
148148
}
149149

150150
void reset_device_api() {
151-
const tvm::ffi::Function api = get_runtime_func("device_api.hexagon");
152-
tvm::ffi::Function::SetGlobal("device_api.cpu", api, true);
151+
const tvm::ffi::Function api = get_runtime_func("tvm.device_api.hexagon");
152+
tvm::ffi::Function::SetGlobal("tvm.device_api.cpu", api, true);
153153
}
154154

155155
tvm::runtime::Module load_module(const std::string& file_name) {
156-
static const tvm::ffi::Function loader = get_runtime_func("ffi.Module.load_from_file.hexagon");
156+
static const tvm::ffi::Function loader =
157+
get_runtime_func("tvm.ffi.Module.load_from_file.hexagon");
157158
tvm::ffi::Any rv = loader(file_name);
158159
if (rv.type_code() == kTVMModuleHandle) {
159160
ICHECK_EQ(rv.type_code(), kTVMModuleHandle)

apps/hexagon_launcher/launcher_hexagon.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ int __QAIC_HEADER(launcher_rpc_open)(const char* uri, remote_handle64* handle) {
4848
*handle = 0; // Just use any value.
4949
reset_device_api();
5050
static const tvm::ffi::Function acq_res =
51-
get_runtime_func("device_api.hexagon.acquire_resources");
51+
get_runtime_func("tvm.device_api.hexagon.acquire_resources");
5252
acq_res();
5353
return AEE_SUCCESS;
5454
}
5555

5656
int __QAIC_HEADER(launcher_rpc_close)(remote_handle64 handle) {
5757
// Comment to stop clang-format from single-lining this function.
5858
static const tvm::ffi::Function rel_res =
59-
get_runtime_func("device_api.hexagon.release_resources");
59+
get_runtime_func("tvm.device_api.hexagon.release_resources");
6060
rel_res();
6161
return AEE_SUCCESS;
6262
}

apps/ios_rpc/tests/ios_rpc_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040

4141
# override metal compiler to compile to iphone
42-
@tvm.register_global_func("tvm_callback_metal_compile")
42+
@tvm.register_global_func("tvm.tvm_callback_metal_compile")
4343
def compile_metal(src, target):
4444
return xcode.compile_metal(src, sdk=sdk)
4545

apps/ios_rpc/tvmrpc/RPCServer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
*/
6363
FEventHandler CreateServerEventHandler(NSOutputStream* outputStream, std::string name,
6464
std::string remote_key) {
65-
auto event_handler_factory = tvm::ffi::Function::GetGlobal("rpc.CreateEventDrivenServer");
65+
auto event_handler_factory = tvm::ffi::Function::GetGlobal("tvm.rpc.CreateEventDrivenServer");
6666
ICHECK(event_handler_factory.has_value())
6767
<< "You are using tvm_runtime module built without RPC support. "
6868
<< "Please rebuild it with USE_RPC flag.";

apps/ios_rpc/tvmrpc/TVMRuntime.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void LogMessageImpl(const std::string& file, int lineno, int level, const std::s
7070
NSBundle* bundle = [NSBundle mainBundle];
7171
base = [[bundle privateFrameworksPath] stringByAppendingPathComponent:@"tvm"];
7272

73-
if (tvm::ffi::Function::GetGlobal("ffi.Module.load_from_file.dylib_custom")) {
73+
if (tvm::ffi::Function::GetGlobal("tvm.ffi.Module.load_from_file.dylib_custom")) {
7474
// Custom dso loader is present. Will use it.
7575
base = NSTemporaryDirectory();
7676
fmt = "dylib_custom";
@@ -114,7 +114,7 @@ void Init(const std::string& name) {
114114
// Add UnsignedDSOLoader plugin in global registry
115115
TVM_FFI_STATIC_INIT_BLOCK() {
116116
namespace refl = tvm::ffi::reflection;
117-
refl::GlobalDef().def_packed("ffi.Module.load_from_file.dylib_custom",
117+
refl::GlobalDef().def_packed("tvm.ffi.Module.load_from_file.dylib_custom",
118118
[](ffi::PackedArgs args, ffi::Any* rv) {
119119
auto n = ffi::make_object<UnsignedDSOLoader>();
120120
n->Init(args[0]);

include/tvm/arith/analyzer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ConstIntBoundNode : public Object {
103103
static const constexpr int64_t kNegInf = -kPosInf;
104104

105105
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
106-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.ConstIntBound", ConstIntBoundNode, Object);
106+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.ConstIntBound", ConstIntBoundNode, Object);
107107
};
108108

109109
/*!
@@ -215,7 +215,7 @@ class ModularSetNode : public Object {
215215
}
216216

217217
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
218-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.ModularSet", ModularSetNode, Object);
218+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.ModularSet", ModularSetNode, Object);
219219
};
220220

221221
/*!

include/tvm/arith/int_set.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum SignType { kPositive, kNegative, kZero, kUnknown };
5656
*/
5757
class IntSetNode : public Object {
5858
public:
59-
TVM_FFI_DECLARE_OBJECT_INFO("ir.IntSet", IntSetNode, Object);
59+
TVM_FFI_DECLARE_OBJECT_INFO("tvm.ir.IntSet", IntSetNode, Object);
6060
};
6161

6262
/*!

include/tvm/arith/int_solver.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class IntGroupBoundsNode : public Object {
7272
}
7373

7474
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
75-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IntGroupBounds", IntGroupBoundsNode, Object);
75+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IntGroupBounds", IntGroupBoundsNode, Object);
7676
};
7777

7878
/*!
@@ -150,7 +150,7 @@ class IntConstraintsNode : public Object {
150150
}
151151

152152
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
153-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IntConstraints", IntConstraintsNode, Object);
153+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IntConstraints", IntConstraintsNode, Object);
154154
};
155155

156156
/*!
@@ -203,8 +203,8 @@ class IntConstraintsTransformNode : public Object {
203203
}
204204

205205
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
206-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IntConstraintsTransform", IntConstraintsTransformNode,
207-
Object);
206+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IntConstraintsTransform",
207+
IntConstraintsTransformNode, Object);
208208
};
209209

210210
/*!

include/tvm/arith/iter_affine_map.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace arith {
6767
class IterMapExprNode : public PrimExprNode {
6868
public:
6969
static constexpr const uint32_t _type_child_slots = 2;
70-
TVM_FFI_DECLARE_OBJECT_INFO("arith.IterMapExpr", IterMapExprNode, PrimExprNode);
70+
TVM_FFI_DECLARE_OBJECT_INFO("tvm.arith.IterMapExpr", IterMapExprNode, PrimExprNode);
7171
};
7272

7373
/*!
@@ -105,7 +105,7 @@ class IterMarkNode : public Object {
105105
}
106106

107107
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindDAGNode;
108-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IterMark", IterMarkNode, Object);
108+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IterMark", IterMarkNode, Object);
109109
};
110110

111111
/*!
@@ -151,7 +151,7 @@ class IterSplitExprNode : public IterMapExprNode {
151151
}
152152

153153
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
154-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IterSplitExpr", IterSplitExprNode, IterMapExprNode);
154+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IterSplitExpr", IterSplitExprNode, IterMapExprNode);
155155
};
156156

157157
/*!
@@ -205,7 +205,7 @@ class IterSumExprNode : public IterMapExprNode {
205205
}
206206

207207
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode;
208-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IterSumExpr", IterSumExprNode, IterMapExprNode);
208+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IterSumExpr", IterSumExprNode, IterMapExprNode);
209209
};
210210

211211
/*!
@@ -264,7 +264,7 @@ class IterMapResultNode : public Object {
264264
.def_ro("errors", &IterMapResultNode::errors)
265265
.def_ro("padding_predicate", &IterMapResultNode::padding_predicate);
266266
}
267-
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("arith.IterMapResult", IterMapResultNode, Object);
267+
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tvm.arith.IterMapResult", IterMapResultNode, Object);
268268
};
269269

270270
/*!

0 commit comments

Comments
 (0)