Imath icon indicating copy to clipboard operation
Imath copied to clipboard

redefinition of `half` in `imath` when using with `hip-runtime-amd`

Open t1nux opened this issue 1 year ago • 0 comments

I am using imath-3.1.11-2 together with hip-runtime-amd-6.0.2-4 on Arch Linux, and I am getting this error during compilation:

/usr/include/Imath/half.h:989:7: error: type alias redefinition with different types ('Imath_3_1::half' vs '__half')
using half = IMATH_INTERNAL_NAMESPACE::half;
      ^
/opt/rocm/include/hip/amd_detail/amd_hip_fp16.h:1743:19: note: previous definition is here
            using half = __half;

It seems to be caused by the combination of this and that.

This must have been introduced by ROCM recently, since I did not get this in the past. I would have written this on ROCM, but there seems to be an exception in imath for CUDA already (see first link above, line 988), so I guess an appropriate exception for ROCM would also make sense.

For my purposes, I temporarily removed using half = IMATH_INTERNAL_NAMESPACE::half;, but maybe a cleaner solution might be more widely accepted.

t1nux avatar Jul 09 '24 09:07 t1nux