Add old version of energies and only generate code for doubles

This commit is contained in:
2023-01-25 12:50:19 +01:00
parent 2b8b3bd421
commit c7e3fa45bd
4 changed files with 137 additions and 3 deletions

View File

@@ -38,6 +38,8 @@ namespace acc {
__MAYBE_DEVICE__ __MAYBE_HOST__ __INLINE__
F maybeConjugateScalar(const F &a) { return a; }
// TODO: instantiate for std::complex<double>
#if defined(HAVE_CUDA)
template <>
__MAYBE_DEVICE__ __MAYBE_HOST__ __INLINE__

View File

@@ -573,12 +573,15 @@ template <typename F=double>
// TODO: do it through the slice class
slice.info.state = Slice<F>::Dispatched;
#if defined(HAVE_CUDA) && defined(ATRIP_SOURCES_IN_GPU)
# if !defined(ATRIP_CUDA_AWARE_MPI)
# if !defined(ATRIP_CUDA_AWARE_MPI)
# error "You need CUDA aware MPI to have slices on the GPU"
# endif
MPI_Irecv((void*)slice.data,
#elif defined(HAVE_CUDA) && !defined(ATRIP_SOURCES_IN_GPU)
slice.mpi_data = (F*)malloc(sizeof(F) * slice.size);
MPI_Irecv(slice.mpi_data,
#else
MPI_Irecv(slice.data,
MPI_Irecv((void*)slice.data,
#endif
slice.size,
traits::mpi::datatypeOf<F>(),