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__.
The
MSGargument fo theLVARRAY_ERROR_IFis useless when used on a GPU (device):LvArray/src/Macros.hpp
Line 148 in 86af5bf
For example, the expression in
LvArray/src/ArraySlice.hpp
Lines 56 to 57 in 86af5bf
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
printforsnprintftogether withMSGand...variadic macros arguments which can be used asprintf(MSG, __VA_ARGS__);maybe in combination with__VA_OPT__.