HIP icon indicating copy to clipboard operation
HIP copied to clipboard

Compiler warnings for g++13.1

Open torrance opened this issue 2 years ago • 2 comments

When compiling with -Wpendantic, g++ 13.1 emits the following warnings when simply including hip/hip_runtime.h:

g++ --std=c++17 playground.cpp -Wall -Wextra -Wpedantic -o playground -I/opt/rocm/include --D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__=
In file included from /opt/rocm/include/hip/amd_detail/amd_channel_descriptor.h:28,
                 from /opt/rocm/include/hip/channel_descriptor.h:32,
                 from /opt/rocm/include/hip/texture_types.h:38,
                 from /opt/rocm/include/hip/hip_runtime_api.h:489,
                 from /opt/rocm/include/hip/hip_runtime.h:113,
                 from playground.cpp:3:
/opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h:152:20: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  152 |             struct {
      |                    ^
/opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h:187:20: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  187 |             struct {
      |                    ^
/opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h:368:20: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  368 |             struct {
      |                    ^
/opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h:411:20: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  411 |             struct {

torrance avatar Aug 03 '23 07:08 torrance

We want to fix it but it might require a some work and restructuring of code inorder to preserve API/ABI compatibility.

For now can you use something like:

#pragma GCC diagnostic ignored "-Wpedantic"
#include <hip/hip_runtime.h>
#pragma GCC diagnostic pop

cjatin avatar Aug 03 '23 09:08 cjatin

@torrance Can you please test with latest ROCm 6.1.0 (HIP 6.1)? If resolved, please close ticket. Thanks!

ppanchad-amd avatar Apr 25 '24 18:04 ppanchad-amd