-
Notifications
You must be signed in to change notification settings - Fork 62
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
RVV: add cmake toolchain for use Spike #395
Conversation
const auto rhs = (b); \ | ||
if (lhs != rhs) { \ | ||
std::stringstream lhs_str; \ | ||
lhs_str << lhs; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are getting errors such as...
D:\a\simdutf\simdutf\tests\base64_tests.cpp(95,5): message : did you mean to call the c_str() method? [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
D:\a\simdutf\simdutf\tests\..\tests/helpers/test.h(52,34): message : expanded from macro 'ASSERT_EQUAL' [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
D:\a\simdutf\simdutf\tests\base64_tests.cpp(95,5): error : cannot pass non-trivial object of type '_Mystr' (aka 'basic_string<char, std::char_traits<char>, std::allocator<char>>') to variadic function; expected type from format string was 'char *' [-Wnon-pod-varargs] [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
D:\a\simdutf\simdutf\tests\..\tests/helpers/test.h(53,34): message : expanded from macro 'ASSERT_EQUAL' [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
D:\a\simdutf\simdutf\tests\base64_tests.cpp(95,5): message : did you mean to call the c_str() method? [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
D:\a\simdutf\simdutf\tests\..\tests/helpers/test.h(53,34): message : expanded from macro 'ASSERT_EQUAL' [D:\a\simdutf\simdutf\build\tests\base64_tests.vcxproj]
lhs_str << lhs; \ | ||
std::stringstream rhs_str; \ | ||
rhs_str << rhs; \ | ||
printf("lhs: %s = %s\n", #a, lhs_str.str()); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf("lhs: %s = %s\n", #a, lhs_str.str()); \ | |
printf("lhs: %s = %s\n", #a, lhs_str.str().c_str()); \ |
std::stringstream rhs_str; \ | ||
rhs_str << rhs; \ | ||
printf("lhs: %s = %s\n", #a, lhs_str.str()); \ | ||
printf("rhs: %s = %s\n", #b, rhs_str.str()); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf("rhs: %s = %s\n", #b, rhs_str.str()); \ | |
printf("rhs: %s = %s\n", #b, rhs_str.str().c_str()); \ |
Note that in modern C++ (C++20), we would just use Or, we could use |
Use of std::cout or std:cerr makes impossible to run programs under Spike & proxy kernel (`pk`). The initialization of these standard streams depends on futexes (in glibc) and `pk` does not implement all system calls. A side effect is being ready for use the `fmt` library.
a7144ee
to
88cffcb
Compare
std::cout << " implementation.convert_utf16_to_utf32.second return " << utf16_to_utf32.second << std::endl; | ||
printf("%s\n", (is_ok_utf16.second ? "UTF-16 is ok" : "UTF-16 is not ok")); | ||
printf(" size = %llu\n", input.size() / sizeof(char16_t)); | ||
printf(" implementation.convert_utf16_to_utf8.second return %llu\n", utf16_to_utf8.second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The recommended expression to print a size_t
value is %zu
and not %llu
.
@@ -374,8 +373,7 @@ TEST(roundtrip_base64) { | |||
printf("=====input size %zu\n", len); | |||
for (size_t i = 0; i < len; i++) { | |||
if (back[i] != source[i]) { | |||
std::cerr << "Mismatch at position " << i << " trial " << trial | |||
<< std::endl; | |||
printf("Mismatch at position %llu trial %llu\n", i, trial); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here, should be %zu
and not %llu
.
@WojciechMula Your changes have triggered another bug in our test framework, see #404 Eventually, you should rebase on top of #404 Sorry. |
@WojciechMula Can you rebase? I think I fixed the issue your work outlined. |
Running tests. |
I am going to merge and then fix the issues. |
I have resolved the issue directly in the main branch. |
Thanks a lot! |
The current state of tests: