33 lines
867 B
Plaintext
33 lines
867 B
Plaintext
|
#include <cstdio>
|
|||
|
#include <cufft.h>
|
|||
|
#include <cmath>
|
|||
|
#include <cuda_runtime.h>
|
|||
|
#include "BaseConstVariable.h"
|
|||
|
|
|||
|
#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
|
|||
|
|
|||
|
|
|||
|
struct GPUDATA {
|
|||
|
int 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>
|
|||
|
float* AntX, * AntY, * AntZ, * minF; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꡢ<EFBFBD><EAA1A2>ʼƵ<CABC><C6B5>
|
|||
|
float* x_mat, * y_mat, * z_mat;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
float* r_vec; // <20><><EFBFBD>귶Χ
|
|||
|
cufftComplex* phdata;// <20>ز<EFBFBD>
|
|||
|
cufftComplex* im_final;// ͼ<><CDBC>
|
|||
|
float R0; // <20>ο<EFBFBD>б<EFBFBD><D0B1>
|
|||
|
};
|
|||
|
|
|||
|
extern "C" {
|
|||
|
void initGPUData(GPUDATA& h_data, GPUDATA& d_data);
|
|||
|
void freeGPUData(GPUDATA& d_data);
|
|||
|
};
|
|||
|
|