Skip to content

Commit 8e1b9a9

Browse files
[SYCL] Don't use common macro names in sycl.hpp (#19393)
fixes #19392 and #19390 These macro names are clashing with macros that OneDNN defined. Regression after #19279
1 parent 252b37f commit 8e1b9a9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sycl/include/sycl/sycl.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010

1111
// Throw warning when including sycl.hpp without using -fsycl flag.
1212
// Warning can be disabled by defining SYCL_DISABLE_FSYCL_SYCLHPP_WARNING macro.
13-
#define STRINGIFY(x) #x
14-
#define TOSTRING(x) STRINGIFY(x)
13+
#define __SYCL_STRINGIFY(x) #x
14+
#define __SYCL_TOSTRING(x) __SYCL_STRINGIFY(x)
1515

1616
#ifdef _MSC_VER
17-
#define WARNING(msg) \
18-
__pragma(message(__FILE__ "(" TOSTRING(__LINE__) "): warning: " msg))
17+
#define __SYCL_WARNING(msg) \
18+
__pragma(message(__FILE__ "(" __SYCL_TOSTRING(__LINE__) "): warning: " msg))
1919
#elif defined(__GNUC__) || defined(__clang__)
20-
#define WARNING(msg) _Pragma(TOSTRING(GCC warning msg))
20+
#define __SYCL_WARNING(msg) _Pragma(__SYCL_TOSTRING(GCC warning msg))
2121
#else
22-
#define WARNING(msg) // Unsupported compiler
22+
#define __SYCL_WARNING(msg) // Unsupported compiler
2323
#endif
2424

2525
#if !defined(SYCL_LANGUAGE_VERSION) && \
2626
!defined(SYCL_DISABLE_FSYCL_SYCLHPP_WARNING)
27-
WARNING("You are including <sycl/sycl.hpp> without -fsycl flag, \
27+
__SYCL_WARNING("You are including <sycl/sycl.hpp> without -fsycl flag, \
2828
which is errorenous for device code compilation. This warning \
2929
can be disabled by setting SYCL_DISABLE_FSYCL_SYCLHPP_WARNING macro.")
3030
#endif
31-
#undef WARNING
32-
#undef TOSTRING
33-
#undef STRINGIFY
31+
#undef __SYCL_WARNING
32+
#undef __SYCL_TOSTRING
33+
#undef __SYCL_STRINGIFY
3434

3535
#include <sycl/detail/core.hpp>
3636

0 commit comments

Comments
 (0)