Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uTVM] fix crt building and running error #6231

Merged
merged 1 commit into from
Aug 9, 2020

Conversation

windclarion
Copy link
Contributor

@windclarion windclarion commented Aug 7, 2020

  1. include\tvm\runtime\crt\module.h function TVMSystemLibEntryPoint: need extern "C", or else linker complain this symbol can't be found.

  2. src\target\source\codegen_c_host.cc function GenerateFuncRegistry: f need cast, or else C++ compiler say type not match

    L291 array _tvm_func_array miss "};", so build fail

    system_lib_registry and system_lib name need use new name in PR [µTVM] Add --runtime=c, remove micro_dev target, enable LLVM backend #6145

  3. src\support\str_escape.h function StrEscape: convert to octal need 3bit, but unsigned char c should use LSB 3bit, but only use LSB 2bit, because mask macro is 0x03, it should be 0x07.

    '0' + ((c >> 6) & 0x03) need cast to unsigned char, because ostringstream treat it as int, not unsigned char, so value is error. ex. c = 0x17, means we have 23 functions to register, so ((c >> 6) & 0x03) == 0, and '0' + ((c >> 6) & 0x03) is the int value of '0', which is 48, but ostringstream treat it as int, so we get a string "485055", in fact it should be "027"

Signed-off-by: windclarion <windclarion@gmail.com>
Copy link
Member

@liangfu liangfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liangfu liangfu merged commit c815d28 into apache:master Aug 9, 2020
@liangfu
Copy link
Member

liangfu commented Aug 9, 2020

Thanks @windclarion for the fix. This is now merged.

@windclarion windclarion deleted the fix_utvm_error branch August 10, 2020 01:45
wjliu1998 pushed a commit to wjliu1998/incubator-tvm that referenced this pull request Aug 13, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
Signed-off-by: windclarion <windclarion@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants