More than one operator "=" error while compiling with CUDA 12.2

I am trying to build Spconv library with CUDA 12.2 and GCC 9 (for some reasons I can’t use GCC version > 10)

There is a problem related to implicit conversions:

[build] /usr/include/c++/9/bits/stl_algobase.h(342): error: more than one operator “=” matches these operands:
[build] function “__half::operator=(float)” (declared at line 341 of /usr/local/cuda/include/cuda_fp16.hpp)

I have defined

 __CUDA_FP16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__
 __CUDA_BF16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__

macros as suggested in documentation, but it doesn’t help.

There are conditional compilation strings in

/usr/local/cuda/include/cuda_fp16.hpp

#if !(defined __CUDA_FP16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__) || (defined __CUDACC__)

/usr/local/cuda/include/cuda_bf16.hpp

#if !(defined __CUDA_BF16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__) || (defined __CUDACC__)

If I try to modify these strings like that:


#if !(defined __CUDA_FP16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__)
#if !(defined __CUDA_BF16_DISABLE_IMPLICIT_INTEGER_CONVERTS_FOR_HOST_COMPILERS__)

Spconv library can be compiled succesfully (disable implicit converts macros are applied). So there is some error related to __CUDACC__ macro…
Also I can compile Spconv with CUDA 12.1 without errors.

Could you help with this problem?