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

Rework Macros.hpp for devices #303

Open
tbeltzun opened this issue Sep 7, 2023 · 0 comments
Open

Rework Macros.hpp for devices #303

tbeltzun opened this issue Sep 7, 2023 · 0 comments

Comments

@tbeltzun
Copy link

tbeltzun commented Sep 7, 2023

The MSG argument fo the LVARRAY_ERROR_IF is useless when used on a GPU (device):

"***** MSG: " STRINGIZE( MSG ) "\n\n"; \

For example, the expression in

LVARRAY_ERROR_IF( index < 0 || index >= m_dims[ 0 ], \
"Array Bounds Check Failed: index=" << index << " m_dims[0]=" << m_dims[0] )

is printed as Array Bounds Check Failed: index= << index << m_dims[0]= << m_dims[0] in the stacktraces (unevaluated, hence not helpful).

One could use printf or snprintf together with MSG and ... variadic macros arguments which can be used as printf(MSG, __VA_ARGS__); maybe in combination with __VA_OPT__.

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 a pull request may close this issue.

1 participant