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

Fix pragma error with gcc/4.8.4 #181

Merged
merged 2 commits into from
Mar 15, 2018

Conversation

ndellingwood
Copy link
Contributor

Error with gcc/4.8.4 and OpenMP backend
kokkos-kernels/src/blas/impl/KokkosBlas3_gemm_impl.hpp:343:0: error:
ignoring #pragma omp simd [-Werror=unknown-pragmas]

Fixed by adding preprocessor #if to remove the pragma if gnu compiler
less than 4.8.5

Error with gcc/4.8.4 and OpenMP backend
kokkos-kernels/src/blas/impl/KokkosBlas3_gemm_impl.hpp:343:0: error:
ignoring #pragma omp simd [-Werror=unknown-pragmas]

Fixed by adding preprocessor #if to remove the pragma if gnu compiler
less than 4.8.5
@ndellingwood ndellingwood requested a review from crtrott March 13, 2018 21:47
@ndellingwood
Copy link
Contributor Author

Fix for #180

@ndellingwood
Copy link
Contributor Author

Test results:

[ndellin@kokkos-dev TestAllSandia-spot]$ ../../scripts/test_all_sandia gcc/4.8.4 --build-list=OpenMP --skip-hwloc
Going to test compilers:  gcc/4.8.4
Testing compiler gcc/4.8.4
  Starting job gcc-4.8.4-OpenMP-release
  PASSED gcc-4.8.4-OpenMP-release
#######################################################
PASSED TESTS
#######################################################
gcc-4.8.4-OpenMP-release build_time=183 run_time=358
#######################################################
FAILED TESTS
#######################################################

@ndellingwood
Copy link
Contributor Author

gcc/4.8.4 implements OpenMP version 3.1 which does not support simd constructs (at least nowhere to be found in reference here openmp3.1), hence the -Werror for unknown pragma.

Relevant to discussion in trilinos/Trilinos#2317.

@@ -340,7 +340,10 @@ void impl_team_gemm_block(const TeamHandle& team, const ViewTypeC& C, const View
#if defined(__CUDA_ARCH__) || !defined(KOKKOS_ENABLE_OPENMP)
Kokkos::parallel_for(Kokkos::ThreadVectorRange(team,blockB1/4), [&] (const int B_j) {
#else
#if (KOKKOS_COMPILER_GNU < 485 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably is not correct for intel. You probably need to nest this, or alternatively add a OMP_SIMD_EXISTS or whatever variable inside of Kokkos_Macros.hpp (there are similar variables for other pragma features, model it based on those). But that would require a change in Kokkos ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crtrott thanks for catch, just pushed fix. Rerunning with gcc and intel

@ndellingwood
Copy link
Contributor Author

Updated test results:

[ndellin@kokkos-dev TestAllSandia-spot]$ ../../scripts/test_all_sandia gcc/4.8.4 intel/15.0.2 --build-list=OpenMP --skip-hwloc
Going to test compilers:  gcc/4.8.4 intel/15.0.2
Testing compiler gcc/4.8.4
Testing compiler intel/15.0.2
  Starting job gcc-4.8.4-OpenMP-release
  Starting job intel-15.0.2-OpenMP-release
  PASSED gcc-4.8.4-OpenMP-release
  PASSED intel-15.0.2-OpenMP-release
#######################################################
PASSED TESTS
#######################################################
gcc-4.8.4-OpenMP-release build_time=342 run_time=396
intel-15.0.2-OpenMP-release build_time=518 run_time=344
#######################################################

#pragma omp simd
#endif
#else
#pragma omp simd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indenting preprocessors directives !

@ndellingwood ndellingwood merged commit ef39d9a into kokkos:develop Mar 15, 2018
@ndellingwood ndellingwood deleted the fix-pragma-error branch August 30, 2018 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants