diff --git a/openmp/libomptarget/DeviceRTL/include/Debug.h b/openmp/libomptarget/DeviceRTL/include/Debug.h --- a/openmp/libomptarget/DeviceRTL/include/Debug.h +++ b/openmp/libomptarget/DeviceRTL/include/Debug.h @@ -23,8 +23,16 @@ ///} -// TODO: We need to allow actual printf. -#define PRINTF(fmt, ...) (void)fmt; +/// Print +/// { +extern "C" { +int printf(const char *format, ...); +int vprintf(const char *format, __builtin_va_list args); +} + +#define PRINTF(fmt, ...) (void)printf(fmt, __VA_ARGS__); #define PRINT(str) PRINTF("%s", str) +///} + #endif diff --git a/openmp/libomptarget/DeviceRTL/src/Debug.cpp b/openmp/libomptarget/DeviceRTL/src/Debug.cpp --- a/openmp/libomptarget/DeviceRTL/src/Debug.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Debug.cpp @@ -28,4 +28,16 @@ } } +/// AMDGCN implementations of the printf. +/// +///{ +#pragma omp begin declare variant match(device = {arch(amdgcn)}) + +extern "C" { +int vprintf(const char *format, __builtin_va_list args) { return 0; } +} + +#pragma omp end declare variant +///} + #pragma omp end declare target