Warnings from campHipErrchk
- Dominant language
- C++
- Stars
- 107
- Forks
- 26
- Avg merge
- 8d 11h
- Merged PRs (30d)
- 2
Description
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__)
^~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with include/camp/resource/hip.hpp, where the warning is reported, and include/camp/defines.hpp, where campHipErrchk is defined. Review test/resource.cpp to reproduce the C++17 ROCm warning. Done means the HIP error is still checked without the nodiscard warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100