Skip to content

need to add -Wno-nvcc-compt #1330

Closed
Closed
@yxsamliu

Description

@yxsamliu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions