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
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 -Woffload-incompatible-redeclare.
It won't cause warning in system headers, even with
-Woffload-incompatible-redeclare.
__device__voidf(); // redecl-note {{previous declaration is here}}
14
+
15
+
voidf() {} // redecl-warning {{incompatible host/device attribute with redeclaration: new declaration is __host__ function, old declaration is __device__ function. It will cause warning with nvcc}}
16
+
17
+
voidg(); // redecl-note {{previous declaration is here}}
18
+
19
+
__device__voidg() {} // redecl-warning {{incompatible host/device attribute with redeclaration: new declaration is __device__ function, old declaration is __host__ function. It will cause warning with nvcc}}
0 commit comments