From f904e3d140af10d27aea16e8bb0d4756a99f64ee Mon Sep 17 00:00:00 2001 From: "Jiang, Zhiwei" Date: Mon, 26 Aug 2024 15:19:00 +0800 Subject: [PATCH 1/2] [SYCLomatic] Define __dpct_inline__ as an alias of __syclcompat_inline__ when using syclcompat headers Signed-off-by: Jiang, Zhiwei --- clang/runtime/dpct-rt/include/dpct/compat_service.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/runtime/dpct-rt/include/dpct/compat_service.hpp b/clang/runtime/dpct-rt/include/dpct/compat_service.hpp index 1a85356af5ed..be98ce90a6a7 100644 --- a/clang/runtime/dpct-rt/include/dpct/compat_service.hpp +++ b/clang/runtime/dpct-rt/include/dpct/compat_service.hpp @@ -26,6 +26,7 @@ namespace ns = ::syclcompat; template using DataType = ::syclcompat::detail::DataType; using memcpy_direction = ::syclcompat::experimental::memcpy_direction; template using kernel_name = syclcompat_kernel_name; +#define __dpct_inline__ __syclcompat_inline__ #endif using ns::get_current_device; From 70fe968b332d2bd02d45044be58cf85472636dff Mon Sep 17 00:00:00 2001 From: "Jiang, Zhiwei" Date: Mon, 26 Aug 2024 16:05:42 +0800 Subject: [PATCH 2/2] Add protect Signed-off-by: Jiang, Zhiwei --- clang/runtime/dpct-rt/include/dpct/compat_service.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/runtime/dpct-rt/include/dpct/compat_service.hpp b/clang/runtime/dpct-rt/include/dpct/compat_service.hpp index be98ce90a6a7..aabf3c54a8f7 100644 --- a/clang/runtime/dpct-rt/include/dpct/compat_service.hpp +++ b/clang/runtime/dpct-rt/include/dpct/compat_service.hpp @@ -26,8 +26,10 @@ namespace ns = ::syclcompat; template using DataType = ::syclcompat::detail::DataType; using memcpy_direction = ::syclcompat::experimental::memcpy_direction; template using kernel_name = syclcompat_kernel_name; +#ifndef __dpct_inline__ #define __dpct_inline__ __syclcompat_inline__ #endif +#endif using ns::get_current_device; using ns::get_default_context;