Commit 9f40899a authored by Stan Moore's avatar Stan Moore
Browse files

Error out if using cuFFT with Kokkos CUDA on host CPUs

parent f34c899a
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -43,11 +43,15 @@ FFT3dKokkos<DeviceType>::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int
  Pointers(lmp)
{
  int nthreads = lmp->kokkos->nthreads;
  int ngpus = lmp->kokkos->ngpus;
  ExecutionSpace execution_space = ExecutionSpaceFromDevice<DeviceType>::space;

#if defined(FFT_FFTW3)
  int ngpus = lmp->kokkos->ngpus;
  if (ngpus > 0)
    lmp->error->all(FLERR,"Cannot use the FFTW library with Kokkos CUDA");
  if (ngpus > 0 && execution_space == Device)
    lmp->error->all(FLERR,"Cannot use the FFTW library with Kokkos CUDA on GPUs");
#elif defined(FFT_CUFFT)
  if (ngpus > 0 && execution_space == Host)
    lmp->error->all(FLERR,"Cannot use the cuFFT library with Kokkos CUDA on the host CPUs");
#endif

  plan = fft_3d_create_plan_kokkos(comm,nfast,nmid,nslow,
@@ -339,7 +343,6 @@ void FFT3dKokkos<DeviceType>::fft_3d_kokkos(typename ArrayTypes<DeviceType>::t_F
    Kokkos::parallel_for(num,f);
  #endif
  }

}

/* ----------------------------------------------------------------------
+8 −3
Original line number Diff line number Diff line
@@ -135,9 +135,14 @@ The FFT setup for the PPPM solver failed, typically due
to lack of memory.  This is an unusual error.  Check the
size of the FFT grid you are requesting.

E: Cannot use the FFTW library with Kokkos CUDA
E: Cannot use the FFTW library with Kokkos CUDA on GPUs 

Kokkos CUDA doesn't support using the FFTW library to
calculate FFTs for PPPM on GPUs.
Kokkos CUDA doesn't support using the FFTW library to calculate FFTs for 
PPPM on GPUs. 

E: Cannot use the cuFFT library with Kokkos CUDA on the host CPUs

Kokkos CUDA doesn't support using the cuFFT library to calculate FFTs 
for PPPM on the host CPUs, use KISS FFT instead. 

*/