kokkos-kernels icon indicating copy to clipboard operation
kokkos-kernels copied to clipboard

Not nodiscard safe with hip

Open jczhang07 opened this issue 4 years ago • 1 comments

/home/petsc/petsc-hash-pkgs/4bdb58/include/KokkosKernels_ExecSpaceUtils.hpp:208:3: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
  hipMemGetInfo(&free_mem, &total_mem);
  ^~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/petsc/petsc-hash-pkgs/4bdb58/include/KokkosKernels_ExecSpaceUtils.hpp:371:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
    hipStreamCreate(&stream);
    ^~~~~~~~~~~~~~~ ~~~~~~~
/home/petsc/petsc-hash-pkgs/4bdb58/include/KokkosKernels_ExecSpaceUtils.hpp:376:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
    hipStreamDestroy(stream);
    ^~~~~~~~~~~~~~~~ ~~~~~~
3 warnings generated when compiling for host.

jczhang07 avatar Feb 27 '22 22:02 jczhang07

Thanks for pointing this out to us, we will look at how we want to handle these return values.

lucbv avatar Feb 28 '22 17:02 lucbv