Skip to content

Rework Macros.hpp for devices #303

@tbeltzun

Description

@tbeltzun

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__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions