(git:b279b6b)
fft_fpga.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* CP2K: A general program to perform molecular dynamics simulations */
3 /* Copyright 2000-2024 CP2K developers group <https://cp2k.org> */
4 /* */
5 /* SPDX-License-Identifier: GPL-2.0-or-later */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef FFT_FPGA_H
9 #define FFT_FPGA_H
10 /*******************************************************************************
11  * \author Arjun Ramaswami
12  ******************************************************************************/
13 #if defined(__PW_FPGA)
14 
15 typedef struct {
16  double x;
17  double y;
18 } double2;
19 
20 typedef struct {
21  float x;
22  float y;
23 } float2;
24 
25 #ifdef __PW_FPGA_SP
26 typedef float2 cmplx;
27 #else
28 typedef double2 cmplx;
29 #endif
30 
31 // Initialize FPGA
32 int pw_fpga_initialize_();
33 
34 // Finalize FPGA
35 void pw_fpga_final_();
36 
37 // Single precision FFT3d procedure
38 void pw_fpga_fft3d_sp_(int direction, int N[3], cmplx *din);
39 
40 // Double precision FFT3d procedure
41 void pw_fpga_fft3d_dp_(int direction, int N[3], cmplx *din);
42 
43 // Check fpga bitstream present in directory
44 int pw_fpga_check_bitstream_(char *data_path, int N[3]);
45 
46 // host variables
47 static cl_platform_id platform = NULL;
48 static cl_device_id *devices;
49 static cl_device_id device = NULL;
50 static cl_context context = NULL;
51 static cl_program program = NULL;
52 
53 static cl_command_queue queue1 = NULL, queue2 = NULL, queue3 = NULL;
54 static cl_command_queue queue4 = NULL, queue5 = NULL, queue6 = NULL;
55 
56 #endif
57 #endif