LLNL / RAJA

RAJA Performance Portability Layer (C++)
BSD 3-Clause "New" or "Revised" License
482 stars 102 forks source link

RAJA Build fails in avx2_int32.hpp when using Cray MPI Compiler wrappers #1296

Open gzagaris opened 2 years ago

gzagaris commented 2 years ago

I encountered the following compilation issue when trying to use the Cray MPI compiler wrappers with the latest RAJA release, v2022.03.0:

.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(317): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &(const int32_t &)" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(325): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &(const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &)" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(332): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> (const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &) const" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(338): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> (const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &) const" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(344): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> (const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &) const" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(372): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> (const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &) const" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(388): error: "RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> (const RAJA::expt::Register<int32_t, RAJA::expt::avx2_register> &, camp::idx_t) const" contains a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(355): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(355): error: "__v8sf" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(355): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(358): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(358): error: "__v8sf" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(358): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(365): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(365): error: "__v8sf" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(365): error: "__m256" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(367): error: "__m256i" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(367): error: "__v8si" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(367): error: "__m256i" is a vector, which is not supported in device code
.../RAJA/include/RAJA/policy/tensor/arch/avx2/avx2_int32.hpp(367): error: "__v8si" is a vector, which is not supported in device code

The C/C++ Cray compiler wrappers are pointing to gcc-9.3.0:

> CC --version
g++ (GCC) 9.3.0 20200312 (Cray Inc.)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

RAJA seems to detect the correct compiler, e.g., RAJA_COMPILER_GNU is defined in the generated config: https://github.com/LLNL/RAJA/blob/f8c702cb116841ed43229f70f1deb75ca98acd15/include/RAJA/config.hpp.in#L229-L231

If I don't use the Cray compiler wrappers, and instead point the unwrapped version of gcc-9.3.0 and MPICH on the system, the code compiles fine. However, I would be interested in a workaround for using the Cray MPI compiler wrappers, since other parts of the code like that better.

Any suggestions?

gzagaris commented 2 years ago

I should have also mentioned that I am currently not trying to use any of the vectorization stuff through RAJA, so, this must be included by some other RAJA headers