Add an OpenACC variant of default_precondition_violation_handler() - #463
Conversation
…ion_handler() function, which fixes the unsupported fprintf error in Kokkos PR #9345. Signed-off-by: Seyong Lee <lees2@ornl.gov>
mhoemmen
left a comment
There was a problem hiding this comment.
Would you consider a small change, just to remove the possibility of unused parameter warnings completely? Thanks! : - )
| MDSPAN_FUNCTION inline void default_precondition_violation_handler(const char* cond, const char* file, unsigned line) | ||
| { | ||
| std::fprintf(stderr, "%s:%u: precondition failure: `%s`\n", file, line, cond); | ||
| std::abort(); |
There was a problem hiding this comment.
This is a separate issue, but should we consider putting assert(false); here instead of std::abort();? It doesn't seem right to make this back end abort unconditionally, but have all the other back-ends use the assert macro.
There was a problem hiding this comment.
Why would we want the default precondition handler to silently do nothing when NDEBUG is defined?
There was a problem hiding this comment.
Hmmm I see now that is what we do for CUDA/HIP/SYCL so we are inconsistent in the fallback implementation that you pointed out.
There was a problem hiding this comment.
@dalg24 That's right! Whatever we do, we should be consistent about it.
applied the suggested change. Co-authored-by: Mark Hoemmen <mhoemmen@users.noreply.github.com>
Applied; thanks. |
This PR adds an OpenACC variant of mdspan default_precondition_violation_handler() function, which fixes the unsupported fprintf error in Kokkos PR #9345 (kokkos/kokkos#9345 (comment)).
This PR contains the same changes as Kokkos PR #9369 (kokkos/kokkos#9369).