Skip to content

Commit 2d828f5

Browse files
authored
[CompileBugfix][contrib] meet 'base64.h: No such file or directory' and '‘tvm::runtime::vm::AllocatorType’ has not been declared' while compiling (#17265)
1 parent e5f85c0 commit 2d828f5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/contrib/torch/pt_call_tvm/tvm_class.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class TvmVMModulePack {
167167
const auto runtime_create = *tvm::runtime::Registry::Get("runtime._VirtualMachine");
168168
vm_ = runtime_create(exe_);
169169
auto init_func = vm_.GetFunction("init", false);
170-
auto alloc_type = static_cast<int>(tvm::runtime::vm::AllocatorType::kPooled);
170+
auto alloc_type = static_cast<int>(tvm::runtime::memory::AllocatorType::kPooled);
171171
if (device_type != kDLCPU) {
172172
// CPU is required for executing shape functions
173173
init_func(static_cast<int>(kDLCPU), 0, alloc_type, device_type, device_id, alloc_type);

src/contrib/torch/tvm_module_wrapper/RuntimeModuleWrapperTVM.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <vector>
3030

3131
#include "../../../runtime/graph_executor/graph_executor_factory.h"
32-
#include "../../support/base64.h"
32+
#include "../../../support/base64.h"
3333
#include "runtime_bridge.h"
3434

3535
namespace tvm {
@@ -209,10 +209,10 @@ inline void b64decode(const std::string b64str, uint8_t* ret) {
209209
size_t index = 0;
210210
const auto length = b64str.size();
211211
for (size_t i = 0; i < length; i += 4) {
212-
int8_t ch0 = base64::DecodeTable[(int32_t)b64str[i]];
213-
int8_t ch1 = base64::DecodeTable[(int32_t)b64str[i + 1]];
214-
int8_t ch2 = base64::DecodeTable[(int32_t)b64str[i + 2]];
215-
int8_t ch3 = base64::DecodeTable[(int32_t)b64str[i + 3]];
212+
int8_t ch0 = tvm::support::base64::DecodeTable[(int32_t)b64str[i]];
213+
int8_t ch1 = tvm::support::base64::DecodeTable[(int32_t)b64str[i + 1]];
214+
int8_t ch2 = tvm::support::base64::DecodeTable[(int32_t)b64str[i + 2]];
215+
int8_t ch3 = tvm::support::base64::DecodeTable[(int32_t)b64str[i + 3]];
216216
uint8_t st1 = (ch0 << 2) + (ch1 >> 4);
217217
ret[index++] = st1;
218218
if (b64str[i + 2] != '=') {

0 commit comments

Comments
 (0)