Skip to content

Commit 0673acc

Browse files
committed
[SYCL] Fix overloadble requirement for sycl_device_only
1 parent dd2161a commit 0673acc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7355,6 +7355,10 @@ static bool isIncompleteDeclExternC(Sema &S, const T *D) {
73557355
if (S.getLangOpts().CUDA && (D->template hasAttr<CUDADeviceAttr>() ||
73567356
D->template hasAttr<CUDAHostAttr>()))
73577357
return false;
7358+
7359+
// So does SYCL's device_only attribute.
7360+
if (S.getLangOpts().isSYCL() && D->template hasAttr<SYCLDeviceOnlyAttr>())
7361+
return false;
73587362
}
73597363
return D->isExternC();
73607364
}

sycl/include/sycl/stl_wrappers/cmath-fallback.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
#ifdef __SYCL_DEVICE_ONLY__
55

6-
#define __DPCPP_SYCL_DEVICE \
7-
__attribute__((sycl_device_only, always_inline, overloadable))
6+
#define __DPCPP_SYCL_DEVICE __attribute__((sycl_device_only, always_inline))
87
#define __DPCPP_SYCL_DEVICE_C \
9-
extern "C" __attribute__((sycl_device_only, always_inline, overloadable))
8+
extern "C" __attribute__((sycl_device_only, always_inline))
109

1110
#define __DPCPP_SPIRV_MAP_UNARY(NAME) \
1211
__DPCPP_SYCL_DEVICE_C float NAME##f(float x) { \

0 commit comments

Comments
 (0)