[BUGFIX][CRT] Fix Compilation Error in CRT (#5713)
authorLiangfu Chen <liangfu.chen@icloud.com>
Tue, 2 Jun 2020 16:22:14 +0000 (00:22 +0800)
committerGitHub <noreply@github.com>
Tue, 2 Jun 2020 16:22:14 +0000 (09:22 -0700)
src/runtime/crt/crt_backend_api.c
src/runtime/crt/ndarray.c

index fe71439..7589ce4 100644 (file)
@@ -24,6 +24,8 @@
 #include <tvm/runtime/c_backend_api.h>
 #include <tvm/runtime/crt/memory.h>
 
+#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;
index 02c37bf..17e2107 100644 (file)
@@ -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);