(git:374b731)
Loading...
Searching...
No Matches
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
15typedef struct {
16 double x;
17 double y;
18} double2;
19
20typedef struct {
21 float x;
22 float y;
23} float2;
24
25#ifdef __PW_FPGA_SP
26typedef float2 cmplx;
27#else
28typedef double2 cmplx;
29#endif
30
31// Initialize FPGA
32int pw_fpga_initialize_();
33
34// Finalize FPGA
35void pw_fpga_final_();
36
37// Single precision FFT3d procedure
38void pw_fpga_fft3d_sp_(int direction, int N[3], cmplx *din);
39
40// Double precision FFT3d procedure
41void pw_fpga_fft3d_dp_(int direction, int N[3], cmplx *din);
42
43// Check fpga bitstream present in directory
44int pw_fpga_check_bitstream_(char *data_path, int N[3]);
45
46// host variables
47static cl_platform_id platform = NULL;
48static cl_device_id *devices;
49static cl_device_id device = NULL;
50static cl_context context = NULL;
51static cl_program program = NULL;
52
53static cl_command_queue queue1 = NULL, queue2 = NULL, queue3 = NULL;
54static cl_command_queue queue4 = NULL, queue5 = NULL, queue6 = NULL;
55
56#endif
57#endif