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 12:26:11 UTC

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

ashutosh-arm commented on code in PR #13643:
URL: https://github.com/apache/tvm/pull/13643#discussion_r1052140042


##########
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:
   Should we be adding error set/get apis instead?



##########
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:
   nit: does `EmitErrorCheck` sound better? your call.



##########
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:
   interesting, I thought `c_runtime_api.h` would be enough :smile_cat: 



-- 
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