You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/19 15:55:39 UTC

[GitHub] [tvm] NicolaLancellotti commented on a diff in pull request #13643: [CMSIS-NN] Add a runtime error message

NicolaLancellotti commented on code in PR #13643:
URL: https://github.com/apache/tvm/pull/13643#discussion_r1052365665


##########
python/tvm/testing/aot.py:
##########
@@ -244,8 +244,15 @@ def _emit_main_prologue(
   va_start(args, msg);
   vfprintf(stdout, msg, args);
   va_end(args);
-}\n
-TVM_DLL int TVMFuncRegisterGlobal(const char* name, TVMFunctionHandle f, int override) {}
+}
+tvm_crt_error_t TVMPlatformTimerStart() {
+    return kTvmErrorFunctionCallNotImplemented;
+}
+tvm_crt_error_t TVMPlatformTimerStop(double* elapsed_time_seconds) {
+  return kTvmErrorFunctionCallNotImplemented;
+}
+const TVMModule* TVMSystemLibEntryPoint(void) { return NULL; }
+

Review Comment:
   `TVMGetLastError` and `TVMAPISetLastError` are defined in `crt_runtime_api.c`.



##########
python/tvm/testing/aot.py:
##########
@@ -455,6 +465,7 @@ def _emit_main_common_includes(main_file, custom_includes):
     main_file.write("#include <math.h>\n")
     main_file.write('#include "tvm/runtime/c_runtime_api.h"\n')
     main_file.write('#include "tvm/runtime/crt/stack_allocator.h"\n')
+    main_file.write('#include "tvm/runtime/crt/module.h"\n')

Review Comment:
   `tvm/runtime/crt/module.h` defines `TVMModule` needed by
   `TVMModule* TVMSystemLibEntryPoint(void)`.



##########
src/relay/backend/contrib/cmsisnn/tir_to_runtime.cc:
##########
@@ -355,13 +355,7 @@ class CodeGenCMSISNN : public codegen::CodeGenCHost {
     stream << "&" << filter_dim << ", " << filter_data << ", ";
     stream << "&" << bias_dim << ", " << bias_data << ", ";
     stream << "&" << output_dim << ", " << output_data << ");\n";
-    PrintIndent();
-    stream << "if (status != ARM_CMSIS_NN_SUCCESS) {\n";
-    PrintIndent();
-    PrintIndent();
-    stream << "return -1;\n";
-    PrintIndent();
-    stream << "}\n";
+    EmitCheckError();

Review Comment:
   I agree, I'll update the pr.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org