Skip to content

[BUG] code that uses openvdb-12.0.0 cannot be compiled with hipcc #2006

Open
@t1nux

Description

@t1nux

Environment

Operating System: (Arch Linux)
Version: (openvdb-12.0.0)
Other: (compiler: hipcc)

Describe the bug

While using openvdb-12.0.0, when using #include <openvdb/openvdb.h> in code and compiling it with hipcc (ROCM), I get this error:

In file included from test.cpp:1:
In file included from /usr/include/openvdb/openvdb.h:8:
/usr/include/openvdb/Types.h:701:19: error: use of overloaded operator '+' is ambiguous (with operand types 'const math::half' (aka 'const __half') and 'const float')
  701 |         *op = *ip + s;
      |               ~~~ ^ ~
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(float, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(double, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(long double, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(int, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(long, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(long long, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(unsigned int, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(unsigned long, float)
/usr/include/openvdb/Types.h:701:19: note: built-in candidate operator+(unsigned long long, float)
1 error generated when compiling for gfx1100.
failed to execute:/opt/rocm/lib/llvm/bin/clang++  -isystem "/opt/rocm/include" --offload-arch=gfx1100 -O3  -c -x hip test.cpp -o "test.o" -std=c++17

To Reproduce

Steps to reproduce the behavior:

  1. Install openvdb-12.0.0
  2. Add #include <openvdb/openvdb.h>
  3. Compile with hipcc
  4. See error.

Expected behavior

No error.

Additional context

  • Compiling with g++ and openvdb-12.0.0 works.
  • Compiling with hipcc and openvdb-11.0.0 works.

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