LLNL/Umpire

Better guard debug output in AllocationMap::find()

Closed this issue · 0 comments

Is your feature request related to a problem? Please describe.

In debug, I see a lot of verbose output from Umpire due to the following:

#if !defined(NDEBUG)
// use this from a debugger to dump the contents of the AllocationMap
printAll();
#endif

This happens b/c I do have buffers that may be allocated on the stack, but, the code may still try to find an umpire allocator in the process of determining whether the memory is on the host or device.

The output can be quite verbose and it is preferable if it can be disabled on demand for debug builds as well (on Release builds it goes away).

Describe the solution you'd like

Perhaps, one way to do this would be to provide an umpire cmake option, e.g., UMPIRE_DISABLE_ALLOCATION_MAP_NO_DEBUG or something like that.

Describe alternatives you've considered

I tried setting target_source_properties and blt_target_definitions to define NDEBUG, but, that didn't seem to work...