Skip to content

Commit a589638

Browse files
authored
AMREX_DEVICE_PRINTF: Host (#4116)
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.
1 parent b788490 commit a589638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Src/Base/AMReX_GpuPrint.H

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#define AMREX_GPU_PRINT_H_
33
#include <AMReX_Config.H>
44

5-
#if !defined(__APPLE__)
6-
75
#include <cstdio>
86

97
#ifdef AMREX_USE_SYCL
@@ -23,7 +21,9 @@
2321
# define AMREX_DEVICE_PRINTF(...) std::printf(__VA_ARGS__);
2422
#elif defined(AMREX_USE_HIP)
2523
# define AMREX_DEVICE_PRINTF(...) ::printf(__VA_ARGS__);
24+
#else
25+
# define AMREX_DEVICE_PRINTF(format,...) { \
26+
std::printf(format, __VA_ARGS__); }
2627
#endif
2728

28-
#endif // !defined(__APPLE__)
2929
#endif // AMREX_GPU_PRINT_H_

0 commit comments

Comments
 (0)