2025-03-05 09:10:21 +00:00
|
|
|
|
|
|
|
|
|
#ifndef _BPBASIC0_CUDA_H_
|
|
|
|
|
#define _BPBASIC0_CUDA_H_
|
2025-03-03 08:25:50 +00:00
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cufft.h>
|
|
|
|
|
#include <cmath>
|
|
|
|
|
#include <cuda_runtime.h>
|
|
|
|
|
#include "BaseConstVariable.h"
|
|
|
|
|
|
2025-03-05 09:10:21 +00:00
|
|
|
|
//#define cudaCheckError(ans) { gpuAssert((ans), __FILE__, __LINE__); }
|
|
|
|
|
//inline void gpuAssert(cudaError_t code, const char* file, int line) {
|
|
|
|
|
// if (code != cudaSuccess) {
|
|
|
|
|
// fprintf(stderr, "CUDA Error: %s %s %d\n", cudaGetErrorString(code), file, line);
|
|
|
|
|
// exit(code);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//#define c LIGHTSPEED
|
2025-03-03 08:25:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct GPUDATA {
|
2025-03-04 08:18:35 +00:00
|
|
|
|
long Nfft, K, Np, nx, ny; // <20><><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>С<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
|
2025-03-03 09:50:28 +00:00
|
|
|
|
double* AntX, * AntY, * AntZ, * minF; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꡢ<EFBFBD><EAA1A2>ʼƵ<CABC><C6B5>
|
|
|
|
|
double* x_mat, * y_mat, * z_mat;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
double* r_vec; // <20><><EFBFBD>귶Χ
|
|
|
|
|
double* Freq;// Ƶ<><C6B5>
|
2025-03-06 05:43:56 +00:00
|
|
|
|
cuComplex* phdata;// <20>ز<EFBFBD>
|
|
|
|
|
cuComplex* im_final;// ͼ<><CDBC>
|
2025-03-03 09:50:28 +00:00
|
|
|
|
double R0; // <20>ο<EFBFBD>б<EFBFBD><D0B1>
|
|
|
|
|
double deltaF; // Ƶ<>㷶Χ
|
2025-03-03 08:25:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
2025-03-04 08:18:35 +00:00
|
|
|
|
void bpBasic0CUDA(GPUDATA& data, int flag,double* h_R=nullptr);
|
2025-03-03 08:25:50 +00:00
|
|
|
|
void initGPUData(GPUDATA& h_data, GPUDATA& d_data);
|
|
|
|
|
void freeGPUData(GPUDATA& d_data);
|
2025-03-03 09:50:28 +00:00
|
|
|
|
void freeHostData(GPUDATA& d_data);
|
|
|
|
|
void BPBasic0(GPUDATA& h_data);
|
2025-03-03 08:25:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
2025-03-05 09:10:21 +00:00
|
|
|
|
#endif
|