merge lmpfftsettings_kokkos.h into lmpfftsettings.h

This commit is contained in:
Axel Kohlmeyer
2024-01-31 12:54:03 -05:00
parent 23ed9a0980
commit e319555f64
3 changed files with 29 additions and 59 deletions

View File

@ -12,30 +12,21 @@
See the README file in the top-level LAMMPS directory. See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
// data types for 2d/3d FFTs
#ifndef LMP_FFT_DATA_KOKKOS_H
#define LMP_FFT_DATA_KOKKOS_H
#include "kokkos_type.h" #include "kokkos_type.h"
#ifndef MAX #ifndef MAX
#define MAX(A,B) ((A) > (B) ? (A) : (B)) #define MAX(A,B) ((A) > (B) ? (A) : (B))
#endif #endif
// data types for 2d/3d FFTs #include "lmpfftsettings.h"
#ifndef LMP_FFT_DATA_KOKKOS_H
#define LMP_FFT_DATA_KOKKOS_H
#include "lmpfftsettings_kokkos.h"
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Data types for single-precision complex
#if FFT_PRECISION == 1
#elif FFT_PRECISION == 2
#else
#error "FFT_PRECISION needs to be either 1 (=single) or 2 (=double)"
#endif
// with KOKKOS in CUDA or HIP mode we can only have // with KOKKOS in CUDA or HIP mode we can only have
// CUFFT/HIPFFT or KISSFFT, thus undefine all other // CUFFT/HIPFFT or KISSFFT, thus undefine all other
// FFTs here, since they may be valid in fft3d.cpp // FFTs here, since they may be valid in fft3d.cpp

View File

@ -1,43 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
LAMMPS development team: developers@lammps.org
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
// common FFT library related defines and compilation settings
#ifndef LMP_FFT_KOKKOS_SETTINGS_H
#define LMP_FFT_KOKKOS_SETTINGS_H
#include "lmpfftsettings.h"
// if user set FFTW, it means FFTW3
#ifdef FFT_KOKKOS_FFTW
#ifndef FFT_KOKKOS_FFTW3
#define FFT_KOKKOS_FFTW3
#endif
#endif
// set strings for library info output
#if defined(FFT_KOKKOS_FFTW3)
#define LMP_FFT_KOKKOS_LIB "FFTW3"
#elif defined(FFT_KOKKOS_MKL)
#define LMP_FFT_KOKKOS_LIB "MKL FFT"
#elif defined(FFT_KOKKOS_CUFFT)
#define LMP_FFT_KOKKOS_LIB "cuFFT"
#elif defined(FFT_KOKKOS_HIPFFT)
#define LMP_FFT_KOKKOS_LIB "hipFFT"
#else
#define LMP_FFT_KOKKOS_LIB "KISS FFT"
#endif
#endif

View File

@ -16,7 +16,7 @@
#ifndef LMP_FFT_SETTINGS_H #ifndef LMP_FFT_SETTINGS_H
#define LMP_FFT_SETTINGS_H #define LMP_FFT_SETTINGS_H
// if user set FFTW, it means FFTW3 // if a user sets FFTW, it means FFTW3
#ifdef FFT_FFTW #ifdef FFT_FFTW
#ifndef FFT_FFTW3 #ifndef FFT_FFTW3
@ -24,6 +24,14 @@
#endif #endif
#endif #endif
#ifdef LMP_KOKKOS
#ifdef FFT_KOKKOS_FFTW
#ifndef FFT_KOKKOS_FFTW3
#define FFT_KOKKOS_FFTW3
#endif
#endif
#endif
// set strings for library info output // set strings for library info output
#if defined(FFT_FFTW3) #if defined(FFT_FFTW3)
@ -38,6 +46,20 @@
#define LMP_FFT_LIB "KISS FFT" #define LMP_FFT_LIB "KISS FFT"
#endif #endif
#ifdef LMP_KOKKOS
#if defined(FFT_KOKKOS_FFTW3)
#define LMP_FFT_KOKKOS_LIB "FFTW3"
#elif defined(FFT_KOKKOS_MKL)
#define LMP_FFT_KOKKOS_LIB "MKL FFT"
#elif defined(FFT_KOKKOS_CUFFT)
#define LMP_FFT_KOKKOS_LIB "cuFFT"
#elif defined(FFT_KOKKOS_HIPFFT)
#define LMP_FFT_KOKKOS_LIB "hipFFT"
#else
#define LMP_FFT_KOKKOS_LIB "KISS FFT"
#endif
#endif
#ifdef FFT_SINGLE #ifdef FFT_SINGLE
typedef float FFT_SCALAR; typedef float FFT_SCALAR;
#define FFT_PRECISION 1 #define FFT_PRECISION 1