Skip to content

Warnings from campHipErrchk #121

@MrBurmark

Description

@MrBurmark

I see warnings with rocm coming from campHipErrchk.
I took a look in the hip headers and with c++17 the hip error type is declared with nodiscard. So while we check the error in campHipErrchk, we still get a warning because the error is returned.

In file included from ../test/resource.cpp:16:
In file included from ../include/camp/resource.hpp:27:
../include/camp/resource/hip.hpp:33:11: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
         campHipErrchk(hipGetDevice(&prev_device));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/camp/defines.hpp:196:28: note: expanded from macro 'campHipErrchk'
#define campHipErrchk(ans) ::camp::hipAssert((ans), #ans, __FILE__, __LINE__)
                           ^~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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