Skip to content

Commit

Permalink
AMREX_DEVICE_PRINTF: Host (#4116)
Browse files Browse the repository at this point in the history
In AMReX, device means host if compiled for CPUs.
Add support for printf debugging on CPUs for `AMREX_DEVICE_PRINTF`.

Currently, the macro was undefined, unless for the special case of SYCL
compilation for host code paths where it worked.
  • Loading branch information
ax3l authored Sep 2, 2024
1 parent b788490 commit a589638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/Base/AMReX_GpuPrint.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#define AMREX_GPU_PRINT_H_
#include <AMReX_Config.H>

#if !defined(__APPLE__)

#include <cstdio>

#ifdef AMREX_USE_SYCL
Expand All @@ -23,7 +21,9 @@
# define AMREX_DEVICE_PRINTF(...) std::printf(__VA_ARGS__);
#elif defined(AMREX_USE_HIP)
# define AMREX_DEVICE_PRINTF(...) ::printf(__VA_ARGS__);
#else
# define AMREX_DEVICE_PRINTF(format,...) { \
std::printf(format, __VA_ARGS__); }
#endif

#endif // !defined(__APPLE__)
#endif // AMREX_GPU_PRINT_H_

0 comments on commit a589638

Please sign in to comment.