HipHipFFT3D.h 2.57 KB
Newer Older
one's avatar
one committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef __OPENMM_HIPHIPFFT3D_H__
#define __OPENMM_HIPHIPFFT3D_H__

/* -------------------------------------------------------------------------- *
 *                                   OpenMM                                   *
 * -------------------------------------------------------------------------- *
 * This is part of the OpenMM molecular simulation toolkit.                   *
 * See https://openmm.org/development.                                        *
 *                                                                            *
 * Portions copyright (c) 2009-2026 Stanford University and the Authors.      *
 * Contributors:                                                              *
 *                                                                            *
 * This program is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU Lesser General Public License as published   *
 * by the Free Software Foundation, either version 3 of the License, or       *
 * (at your option) any later version.                                        *
 *                                                                            *
 * This program is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
 * GNU Lesser General Public License for more details.                        *
 *                                                                            *
 * You should have received a copy of the GNU Lesser General Public License   *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
 * -------------------------------------------------------------------------- */

#include "openmm/common/windowsExportCommon.h"
#include "openmm/common/FFT3D.h"
#include "openmm/common/ArrayInterface.h"

#ifdef OPENMM_HIP_WITH_HIPFFT
#if __has_include(<hipfft/hipfft.h>)
#include <hipfft/hipfft.h>
#else
#include <hipfft.h>
#endif
#endif

namespace OpenMM {

class HipContext;

class OPENMM_EXPORT_COMMON HipHipFFT3D : public FFT3DImpl {
public:
    HipHipFFT3D(HipContext& context, int xsize, int ysize, int zsize, bool realToComplex);
    ~HipHipFFT3D();
    void execFFT(ArrayInterface& in, ArrayInterface& out, bool forward=true) override;
private:
    HipContext& context;
    bool realToComplex;
    bool doublePrecision;
#ifdef OPENMM_HIP_WITH_HIPFFT
    hipfftHandle forwardPlan;
    hipfftHandle backwardPlan;
#endif
};

} // namespace OpenMM

#endif // __OPENMM_HIPHIPFFT3D_H__