Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly clang/7+cuda/9.2 build failure with -Werror: /gmres.hpp:273:21: error: using integer absolute value function 'abs' when argument is of floating point type #1172

Closed
ndellingwood opened this issue Nov 4, 2021 · 0 comments

Comments

@ndellingwood
Copy link
Contributor

The nightly clang/7+cuda/9.2 build began failing with error message:

In file included from /ascldap/users/ndellin/kokkos-kernels/example/gmres/test_real_A.cpp:54:
/ascldap/users/ndellin/kokkos-kernels/example/gmres/gmres.hpp:273:21: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
      shortRelRes = abs(GVec_h(j+1))/nrmB; // this abs is in libstdc++
                    ^
/ascldap/users/ndellin/kokkos-kernels/example/gmres/test_real_A.cpp:102:27: note: in instantiation of function template specialization 'gmres<double, Kokkos::LayoutLeft, Kokkos::Cuda, int>' requested here
  GmresStats solveStats = gmres<ST, Kokkos::LayoutLeft, EXSP>(A, B, X, solverOpts);
                          ^
/ascldap/users/ndellin/kokkos-kernels/example/gmres/gmres.hpp:273:21: note: use function 'std::abs' instead
      shortRelRes = abs(GVec_h(j+1))/nrmB; // this abs is in libstdc++
                    ^~~
                    std::abs

The only change in kokkos-kernels was merge of #1171 , but it's not clear to me how those changes would impact this build (abs should be called from blas not batched blas, right?)

@e10harvey the compiler suggests explicit namespacing of abs with std, but I saw there are additional abs routines in this code to handle half precision types and wasn't certain of the best way to handle this. Can you offer a suggestion or look into the failure as well?

Reproducer (kokkos-dev-2):

module load sems-env sems-cmake/3.17.1 sems-clang/7.0.1 sems-cuda/9.2

$KOKKOSKERNELS_PATH/cm_generate_makefile.bash --with-devices=Cuda,OpenMP --arch=Volta70 --compiler=clang++ --cxxflags="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized " --cxxstandard="14"  --kokkos-path=$KOKKOS_PATH --kokkoskernels-path=$KOKKOSKERNELS_PATH --with-scalars='double,complex_double' --with-ordinals=int --with-offsets=int,size_t --with-layouts=LayoutLeft  --with-options=disable_deprecated_code --with-cuda-options=enable_lambda   --no-examples
@e10harvey e10harvey self-assigned this Nov 4, 2021
e10harvey added a commit to e10harvey/kokkos-kernels that referenced this issue Nov 16, 2021
e10harvey added a commit to e10harvey/kokkos-kernels that referenced this issue Nov 17, 2021
  - Fixes kokkos#1172

sparse: Fix unused vars in bsrmatrix impl
e10harvey added a commit to e10harvey/kokkos-kernels that referenced this issue Nov 18, 2021
  - Fixes kokkos#1172

sparse: Fix unused vars in bsrmatrix impl
e10harvey added a commit to e10harvey/kokkos-kernels that referenced this issue Nov 18, 2021
  - Fixes kokkos#1172

sparse: Fix unused vars in bsrmatrix impl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants