Skip to content

Commit

Permalink
HIP 4.5.0 workaround compile error
Browse files Browse the repository at this point in the history
Disable printf to avoid compiler error: `error: stack size limit
exceeded (181896) in _ZN6alpaka...`
  • Loading branch information
psychocoderHPC committed Aug 3, 2022
1 parent db3e11b commit ef0dfb7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions include/alpaka/test/Check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// TODO: SYCL doesn't have a way to detect if we're looking at device or host code. This needs a workaround so that
// SYCL and other back-ends are compatible.
#ifdef ALPAKA_ACC_SYCL_ENABLED
# define ALPAKA_CHECK_DO(file, line, success, expression) \
# define ALPAKA_CHECK_DO(printMsg, file, line, success, expression) \
do \
{ \
if(!(expression)) \
Expand All @@ -27,7 +27,7 @@
} \
} while(0)
#else
# define ALPAKA_CHECK_DO(file, line, success, expression) \
# define ALPAKA_CHECK_DO(printMsg, file, line, success, expression) \
do \
{ \
if(!(expression)) \
Expand All @@ -38,4 +38,17 @@
} while(0)
#endif

#define ALPAKA_CHECK(success, expression) ALPAKA_CHECK_DO(__FILE__, __LINE__, success, expression)
#if BOOST_LANG_HIP == BOOST_VERSION_NUMBER(4, 5, 0)
// disable message print to avoid compiler error: 'error: stack size limit exceeded (181896) in _ZN6alpaka...'
# define ALPAKA_CHECK(printMsg, file, line, success, expression) \
do \
{ \
if(!(expression)) \
{ \
printf("ALPAKA_CHECK failed because '!(%s)' in %s:%d\n", #expression, file, line); \
success = false; \
} \
} while(0)
#else
# define ALPAKA_CHECK(success, expression) ALPAKA_CHECK_DO(__FILE__, __LINE__, success, expression)
#endif

0 comments on commit ef0dfb7

Please sign in to comment.