Closed
Description
A recent clang change (llvm/llvm-project#77359) caused build failure in composable_kernel:
[2024-06-11T01:46:46.213Z] /jenkins/workspace/compiler-psdb-amd-staging/Libs/composable_kernel/include/ck/utility/f8_utils.hpp:20:23: error: 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 [-Werror,-Wnvcc-compat]
[2024-06-11T01:46:46.213Z] 20 | __device__ inline int clz(uint32_t x) { return __clz(x); }
[2024-06-11T01:46:46.213Z] | ^
[2024-06-11T01:46:46.213Z] /jenkins/workspace/compiler-psdb-amd-staging/Libs/composable_kernel/include/ck/utility/f8_utils.hpp:19:21: note: previous declaration is here
[2024-06-11T01:46:46.213Z] 19 | __host__ inline int clz(uint32_t x) { return __builtin_clz(x); }
[2024-06-11T01:46:46.213Z] |
This warning is intended for HIP code that is compatible with nvcc (not overloading device/host functions with the same signature) and is off by default. composable_kernel uses overloaded device/host functions with the same signature, therefore has to turn this warning off. Since composable_kernel uses -Weverything, it has to explicitly add -Wno-nvcc-compat to disable this warning.