Skip to content

[LIBCLC] Set charSize when calling __assertfail #6370

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

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libclc/ptx-nvidiacl/libspirv/assert/__assert_fail.cl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <spirv/spirv.h>

void __assertfail(const char *__message, const char *__file, unsigned __line,
const char *__function);
const char *__function, size_t __charSize);

_CLC_DECL void __assert_fail(const char *expr, const char *file,
unsigned int line, const char *func) {
__assertfail(expr, file, line, func);
__assertfail(expr, file, line, func, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor and not that I would ever expect them to differ, but should this be

Suggested change
__assertfail(expr, file, line, func, 1);
__assertfail(expr, file, line, func, sizeof(char));

for good measure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @steffenlarsen, sorry was off last couple of days, I would normally agree, but in the PTX interoperability doc, they make an explicit point:

The only supported character size is 1

}

_CLC_DECL void _wassert(const char *_Message, const char *_File,
unsigned _Line) {
__assertfail(_Message, _File, _Line, 0);
__assertfail(_Message, _File, _Line, 0, 1);
}