From 3d0606313f2cb7625eeec5308fe33354dc94fc90 Mon Sep 17 00:00:00 2001 From: Liangfu Chen Date: Wed, 3 Jun 2020 00:22:14 +0800 Subject: [PATCH] [BUGFIX][CRT] Fix Compilation Error in CRT (#5713) --- src/runtime/crt/crt_backend_api.c | 2 ++ src/runtime/crt/ndarray.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/crt/crt_backend_api.c b/src/runtime/crt/crt_backend_api.c index fe7143912263..7589ce479014 100644 --- a/src/runtime/crt/crt_backend_api.c +++ b/src/runtime/crt/crt_backend_api.c @@ -24,6 +24,8 @@ #include #include +#include "packed_func.h" + void* TVMBackendAllocWorkspace(int device_type, int device_id, uint64_t nbytes, int dtype_code_hint, int dtype_bits_hint) { void* ptr = 0; diff --git a/src/runtime/crt/ndarray.c b/src/runtime/crt/ndarray.c index 02c37bf780b5..17e210785aa1 100644 --- a/src/runtime/crt/ndarray.c +++ b/src/runtime/crt/ndarray.c @@ -100,9 +100,9 @@ int TVMNDArray_Load(TVMNDArray* ret, const char** strm) { *strm += sizeof(data_byte_size); if (!(data_byte_size == num_elems * elem_bytes)) { fprintf(stderr, - "invalid DLTensor file format: data_byte_size=%jd, " - "while num_elems*elem_bytes=%jd\n", - data_byte_size, (num_elems * elem_bytes)); + "invalid DLTensor file format: data_byte_size=%d, " + "while num_elems*elem_bytes=%d\n", + (int)data_byte_size, (int)(num_elems * elem_bytes)); // NOLINT(*) status = -1; } memcpy(ret->dl_tensor.data, *strm, data_byte_size);