Skip to content

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

@t1nux

Description

@t1nux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions