You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was already merged in trunk:
llvm#77359
However, it was reverted in amd-staging due
to ck issue ROCm/composable_kernel#1330
Now try relanding it in amd-staging after ck issue fixed
by
ROCm/composable_kernel#1342
Fixes: SWDEV-431838
Original commit message:
nvcc warns about the following code:
`void f();
__device__ void f() {}`
but clang does not since clang allows device function to overload host
function.
Users want clang to emit similar warning to help code to be compatible
with nvcc.
Since this may cause regression with existing code, the warning is off
by default and can be enabled by -Wnvcc-compat.
It won't cause warning in system headers, even with -Wnvcc-compat.
Change-Id: Ia370700eb3eb1b1928d04ec59e2ec63506f85545
__device__voidf(); // redecl-note {{previous declaration is here}}
14
+
15
+
voidf() {} // redecl-warning {{target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is __host__ function, old declaration is __device__ function}}
16
+
17
+
voidg(); // redecl-note {{previous declaration is here}}
18
+
19
+
__device__voidg() {} // redecl-warning {{target-attribute based function overloads are not supported by NVCC and will be treated as a function redeclaration:new declaration is __device__ function, old declaration is __host__ function}}
Clang can emit warnings when it detects that host (H) and device (D) functions are declared or defined with the same signature. These warnings are not enabled by default.
425
+
426
+
To enable these warnings, use the following compiler flag:
0 commit comments