File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 21
21
#define __LIBC_ATTRS __attribute__((device))
22
22
#endif
23
23
24
+ // Some headers provide these as macros. Temporarily undefine them so they do
25
+ // not conflict with any definitions for the GPU.
26
+
27
+ #pragma push_macro("stdout")
28
+ #pragma push_macro("stdin")
29
+ #pragma push_macro("stderr")
30
+
31
+ #undef stdout
32
+ #undef stderr
33
+ #undef stdin
34
+
24
35
#pragma omp begin declare target
25
36
26
37
#include <llvm-libc-decls/stdio.h>
29
40
30
41
#undef __LIBC_ATTRS
31
42
43
+ // Restore the original macros when compiling on the host.
44
+ #if !defined(__NVPTX__ ) && !defined(__AMDGPU__ )
45
+ #pragma pop_macro("stdout")
46
+ #pragma pop_macro("stderr")
47
+ #pragma pop_macro("stdin")
48
+ #endif
49
+
32
50
#endif
33
51
34
52
#endif // __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
You can’t perform that action at this time.
0 commit comments