代码修改同步远程检查
parent
dfe057c13c
commit
6737300246
|
|
@ -394,8 +394,8 @@ __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
double antDirectX, double antDirectY, double antDirectZ,// 天线的指向
|
double antDirectX, double antDirectY, double antDirectZ,// 天线的指向
|
||||||
double Pt,// 发射能量
|
double Pt,// 发射能量
|
||||||
double refPhaseRange,
|
double refPhaseRange,
|
||||||
double* TransAntpattern, PatternImageDesc TransAntpatternDesc,// double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
double* TransAntpattern, double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
||||||
double* ReceiveAntpattern, PatternImageDesc ReceiveAntpatternDesc,// double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
double* ReceiveAntpattern, double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
||||||
double NearR, double FarR, // 距离范围
|
double NearR, double FarR, // 距离范围
|
||||||
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
||||||
float* outR, // 输出距离
|
float* outR, // 输出距离
|
||||||
|
|
@ -417,7 +417,7 @@ __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
double RstR2 = RstX * RstX + RstY * RstY + RstZ * RstZ;
|
double RstR2 = RstX * RstX + RstY * RstY + RstZ * RstZ;
|
||||||
double RstR = sqrt(RstR2); // 矢量距离
|
double RstR = sqrt(RstR2); // 矢量距离
|
||||||
|
|
||||||
//printf("antX=%f;antY=%f;antZ=%f;targetX=%f;targetY=%f;targetZ=%f;RstR=%.6f;diffR=%.6f;\n",antX,antY,antZ,targetX,targetY,targetZ,RstR, RstR - 9.010858499003178e+05);
|
//printf("idx=%d;antX=%f;antY=%f;antZ=%f;targetX=%f;targetY=%f;targetZ=%f;RstR=%.6f;diffR=%.6f;\n", idx,antX,antY,antZ,targetX,targetY,targetZ,RstR, RstR - 9.010858499003178e+05);
|
||||||
|
|
||||||
if (RstR<NearR || RstR>FarR) {
|
if (RstR<NearR || RstR>FarR) {
|
||||||
outAmp[idx] = 0;
|
outAmp[idx] = 0;
|
||||||
|
|
@ -444,17 +444,13 @@ __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
double TansantPatternGain =
|
double TansantPatternGain =
|
||||||
GPU_BillerInterpAntPattern(
|
GPU_BillerInterpAntPattern(
|
||||||
TransAntpattern,
|
TransAntpattern,
|
||||||
TransAntpatternDesc.startTheta, TransAntpatternDesc.startPhi,
|
Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
||||||
TransAntpatternDesc.dtheta, TransAntpatternDesc.dphi, TransAntpatternDesc.thetanum, TransAntpatternDesc.phinum,
|
|
||||||
//Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
|
||||||
temptheta, tempphi);
|
temptheta, tempphi);
|
||||||
|
|
||||||
// 接收方向图
|
// 接收方向图
|
||||||
double antPatternGain = GPU_BillerInterpAntPattern(
|
double antPatternGain = GPU_BillerInterpAntPattern(
|
||||||
ReceiveAntpattern,
|
ReceiveAntpattern,
|
||||||
ReceiveAntpatternDesc.startTheta, ReceiveAntpatternDesc.startPhi,
|
Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
||||||
ReceiveAntpatternDesc.dtheta, ReceiveAntpatternDesc.dphi, ReceiveAntpatternDesc.thetanum, ReceiveAntpatternDesc.phinum,
|
|
||||||
//Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
|
||||||
temptheta, tempphi);
|
temptheta, tempphi);
|
||||||
|
|
||||||
// 计算
|
// 计算
|
||||||
|
|
@ -487,6 +483,7 @@ __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
ampGain = ampGain / (powf(4 * LAMP_CUDA_PI, 2) * powf(RstR, 4)); // 反射强度
|
ampGain = ampGain / (powf(4 * LAMP_CUDA_PI, 2) * powf(RstR, 4)); // 反射强度
|
||||||
outAmp[idx] = float(ampGain * Pt * sigma0);
|
outAmp[idx] = float(ampGain * Pt * sigma0);
|
||||||
outR[idx] = float(RstR - refPhaseRange);
|
outR[idx] = float(RstR - refPhaseRange);
|
||||||
|
//printf("%f-%f=%f\n", RstR , refPhaseRange, outR[idx]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
}
|
}
|
||||||
|
|
@ -499,7 +496,7 @@ __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
__global__ void CUDAKernel_PRF_GeneratorEcho(float* Rarr, float* ampArr,
|
__global__ void CUDAKernel_PRF_GeneratorEcho(float* Rarr, float* ampArr,
|
||||||
long pixelcount,
|
long pixelcount,
|
||||||
float f0, float dfreq,long freqnum,
|
float f0, float dfreq,long freqnum,
|
||||||
double* echo_real,double* echo_imag, long prfid)
|
float* echo_real, float* echo_imag, long prfid)
|
||||||
{
|
{
|
||||||
//// 假定共享内存大小为49152 byte
|
//// 假定共享内存大小为49152 byte
|
||||||
//// 假定每个Block 线程数大小为 32
|
//// 假定每个Block 线程数大小为 32
|
||||||
|
|
@ -533,10 +530,10 @@ __global__ void CUDAKernel_PRF_GeneratorEcho(float* Rarr, float* ampArr,
|
||||||
for (long j = 0; j < GPU_SHARE_STEP; j++) {
|
for (long j = 0; j < GPU_SHARE_STEP; j++) {
|
||||||
dataid = j * BLOCK_SIZE + tid; //
|
dataid = j * BLOCK_SIZE + tid; //
|
||||||
temp_phi = s_R[dataid] * factorjTemp;
|
temp_phi = s_R[dataid] * factorjTemp;
|
||||||
temp_amp = s_Amp[dataid];
|
temp_amp = 1; s_Amp[dataid];
|
||||||
|
|
||||||
temp_real += temp_amp * cosf(temp_phi);
|
temp_real += 1; //temp_amp* cosf(temp_phi);
|
||||||
temp_imag += temp_amp * sinf(temp_phi);
|
temp_imag += 1;// temp_amp* sinf(temp_phi);
|
||||||
}
|
}
|
||||||
atomicAdd(&echo_real[prfid * freqnum + fid], temp_real); // 更新实部
|
atomicAdd(&echo_real[prfid * freqnum + fid], temp_real); // 更新实部
|
||||||
atomicAdd(&echo_imag[prfid * freqnum + fid], temp_imag); // 更新虚部
|
atomicAdd(&echo_imag[prfid * freqnum + fid], temp_imag); // 更新虚部
|
||||||
|
|
@ -564,11 +561,11 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
double* demSlopeX, double* demSlopeY, double* demSlopeZ, // 地表坡度矢量
|
double* demSlopeX, double* demSlopeY, double* demSlopeZ, // 地表坡度矢量
|
||||||
double Pt,// 发射能量
|
double Pt,// 发射能量
|
||||||
double refPhaseRange,
|
double refPhaseRange,
|
||||||
double* TransAntpattern, PatternImageDesc TransAntpatternDesc,// double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
double* TransAntpattern, double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
||||||
double* ReceiveAntpattern, PatternImageDesc ReceiveAntpatternDesc, //double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
double* ReceiveAntpattern, double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
||||||
double NearR, double FarR, // 距离范围
|
double NearR, double FarR, // 距离范围
|
||||||
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
||||||
double* out_echoReal, double* out_echoImag,// 输出回波
|
float* out_echoReal, float* out_echoImag,// 输出回波
|
||||||
float* temp_R, float* temp_amp
|
float* temp_R, float* temp_amp
|
||||||
//, double* temp_phi, double* temp_real, double* temp_imag// 临时变量
|
//, double* temp_phi, double* temp_real, double* temp_imag// 临时变量
|
||||||
) {
|
) {
|
||||||
|
|
@ -590,11 +587,9 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
Pt,// 增益后发射能量
|
Pt,// 增益后发射能量
|
||||||
refPhaseRange,
|
refPhaseRange,
|
||||||
TransAntpattern,
|
TransAntpattern,
|
||||||
TransAntpatternDesc,
|
Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
||||||
//Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
|
||||||
ReceiveAntpattern,
|
ReceiveAntpattern,
|
||||||
ReceiveAntpatternDesc,
|
Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
||||||
//Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
|
||||||
NearR, FarR,
|
NearR, FarR,
|
||||||
sigma0Paramslist, sigmaparamslistlen,
|
sigma0Paramslist, sigmaparamslistlen,
|
||||||
//factorj, freqnum,
|
//factorj, freqnum,
|
||||||
|
|
@ -602,13 +597,26 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
temp_amp
|
temp_amp
|
||||||
//out_echoReal, out_echoImag, pid // 输出振幅
|
//out_echoReal, out_echoImag, pid // 输出振幅
|
||||||
);
|
);
|
||||||
|
#ifdef __CUDADEBUG__
|
||||||
|
cudaError_t err = cudaGetLastError();
|
||||||
|
if (err != cudaSuccess) {
|
||||||
|
printf("CUDA_RFPC_MainBlock [CUDAKernel_RFPC_Computer_R_Gain] CUDA Error [pid:%d] : %s\n", startpid + pid, cudaGetErrorString(err));
|
||||||
|
// Possibly: exit(-1) if program cannot continue....
|
||||||
|
}
|
||||||
|
#endif // __CUDADEBUG__
|
||||||
blocknum = (pixelcount + GPU_SHARE_STEP - 1) / GPU_SHARE_STEP;
|
blocknum = (pixelcount + GPU_SHARE_STEP - 1) / GPU_SHARE_STEP;
|
||||||
numBlocks = (blocknum + BLOCK_SIZE - 1) / BLOCK_SIZE; // 网格数量
|
numBlocks = (blocknum + BLOCK_SIZE - 1) / BLOCK_SIZE; // 网格数量
|
||||||
CUDAKernel_PRF_GeneratorEcho << <numBlocks, BLOCK_SIZE >> >
|
CUDAKernel_PRF_GeneratorEcho << <numBlocks, BLOCK_SIZE >> >
|
||||||
(temp_R, temp_amp, pixelcount,
|
(temp_R, temp_amp, pixelcount,
|
||||||
f0,dfreq,freqnum,
|
f0,dfreq,freqnum,
|
||||||
out_echoReal, out_echoImag, pid);
|
out_echoReal, out_echoImag, pid);
|
||||||
|
#ifdef __CUDADEBUG__
|
||||||
|
err = cudaGetLastError();
|
||||||
|
if (err != cudaSuccess) {
|
||||||
|
printf("CUDA_RFPC_MainBlock [CUDAKernel_PRF_GeneratorEcho] CUDA Error [pid:%d] : %s\n", startpid+pid,cudaGetErrorString(err));
|
||||||
|
// Possibly: exit(-1) if program cannot continue....
|
||||||
|
}
|
||||||
|
#endif // __CUDADEBUG__
|
||||||
}
|
}
|
||||||
cudaDeviceSynchronize();
|
cudaDeviceSynchronize();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ extern __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
double antDirectX, double antDirectY, double antDirectZ,// 天线的指向
|
double antDirectX, double antDirectY, double antDirectZ,// 天线的指向
|
||||||
double Pt,// 发射能量
|
double Pt,// 发射能量
|
||||||
double refPhaseRange,
|
double refPhaseRange,
|
||||||
double* TransAntpattern, PatternImageDesc TransAntpatternDesc, //double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
double* TransAntpattern, double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
||||||
double* ReceiveAntpattern, PatternImageDesc ReceiveAntpatternDesc,// double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
double* ReceiveAntpattern, double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
||||||
double NearR, double FarR, // 距离范围
|
double NearR, double FarR, // 距离范围
|
||||||
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
||||||
float* outR, // 输出距离
|
float* outR, // 输出距离
|
||||||
|
|
@ -83,7 +83,7 @@ extern __global__ void CUDAKernel_RFPC_Computer_R_Gain(
|
||||||
extern __global__ void CUDAKernel_PRF_GeneratorEcho(float* Rarr, float* ampArr,
|
extern __global__ void CUDAKernel_PRF_GeneratorEcho(float* Rarr, float* ampArr,
|
||||||
long pixelcount,
|
long pixelcount,
|
||||||
float f0, float dfreq, long freqnum,
|
float f0, float dfreq, long freqnum,
|
||||||
double* echo_real, double* echo_imag, long prfid);
|
float* echo_real, float* echo_imag, long prfid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -113,11 +113,11 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
double* demSlopeX, double* demSlopeY, double* demSlopeZ, // 地表坡度矢量
|
double* demSlopeX, double* demSlopeY, double* demSlopeZ, // 地表坡度矢量
|
||||||
double Pt,// 发射能量
|
double Pt,// 发射能量
|
||||||
double refPhaseRange,
|
double refPhaseRange,
|
||||||
double* TransAntpattern, PatternImageDesc TransAntpatternDesc, //double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
double* TransAntpattern, double Transtarttheta, double Transstartphi, double Transdtheta, double Transdphi, int Transthetapoints, int Transphipoints, // 发射天线方向图
|
||||||
double* ReceiveAntpattern, PatternImageDesc ReceiveAntpatternDesc,//double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
double* ReceiveAntpattern, double Receivestarttheta, double Receivestartphi, double Receivedtheta, double Receivedphi, int Receivethetapoints, int Receivephipoints,//接收天线方向图
|
||||||
double NearR, double FarR, // 距离范围
|
double NearR, double FarR, // 距离范围
|
||||||
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
CUDASigmaParam* sigma0Paramslist, long sigmaparamslistlen,// 插值图
|
||||||
double* out_echoReal,double* out_echoImag,// 输出回波
|
float* out_echoReal, float* out_echoImag,// 输出回波
|
||||||
float* temp_R, float* temp_amp
|
float* temp_R, float* temp_amp
|
||||||
//,double* temp_phi ,double* temp_real, double* tmep_imag// 临时变量
|
//,double* temp_phi ,double* temp_real, double* tmep_imag// 临时变量
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ void RFPCProcessMain(long num_thread,
|
||||||
RFPC.setTaskSetting(task); //qDebug() << "setTaskSetting";
|
RFPC.setTaskSetting(task); //qDebug() << "setTaskSetting";
|
||||||
RFPC.setTaskFileName(simulationtaskName); //qDebug() << "setTaskFileName";
|
RFPC.setTaskFileName(simulationtaskName); //qDebug() << "setTaskFileName";
|
||||||
RFPC.setDEMTiffPath(demTiffPath); //qDebug() << "setDEMTiffPath";
|
RFPC.setDEMTiffPath(demTiffPath); //qDebug() << "setDEMTiffPath";
|
||||||
RFPC.setDEMTiffPath(demTiffPath); //qDebug() << "setDEMTiffPath";
|
RFPC.setSloperPath(sloperPath); //qDebug() << "setDEMTiffPath";
|
||||||
RFPC.setLandCoverPath(LandCoverPath); //qDebug() << "setLandCoverPath";
|
RFPC.setLandCoverPath(LandCoverPath); //qDebug() << "setLandCoverPath";
|
||||||
RFPC.setOutEchoPath(OutEchoPath); //qDebug() << "setOutEchoPath";
|
RFPC.setOutEchoPath(OutEchoPath); //qDebug() << "setOutEchoPath";
|
||||||
qDebug() << "-------------- RFPC start---------------------------------------";
|
qDebug() << "-------------- RFPC start---------------------------------------";
|
||||||
|
|
@ -470,8 +470,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
double Tdtheta = (Tmaxtheta - Tmintheta) / (Tthetanum - 1);
|
double Tdtheta = (Tmaxtheta - Tmintheta) / (Tthetanum - 1);
|
||||||
double Tdphi = (Tmaxphi - Tminphi) / (Tphinum - 1);
|
double Tdphi = (Tmaxphi - Tminphi) / (Tphinum - 1);
|
||||||
|
|
||||||
double* h_TantPattern = (double*)mallocCUDAHost(sizeof(double) * Tthetanum * Tphinum);
|
h_TantPattern = (double*)mallocCUDAHost(sizeof(double) * Tthetanum * Tphinum);
|
||||||
double* d_TantPattern = (double*)mallocCUDADevice(sizeof(double) * Tthetanum * Tphinum);
|
d_TantPattern = (double*)mallocCUDADevice(sizeof(double) * Tthetanum * Tphinum);
|
||||||
|
|
||||||
for (long i = 0; i < Tthetanum; i++) {
|
for (long i = 0; i < Tthetanum; i++) {
|
||||||
for (long j = Tphinum - 1; j >= 0; j--) {
|
for (long j = Tphinum - 1; j >= 0; j--) {
|
||||||
|
|
@ -515,8 +515,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
double Rdtheta = (Rmaxtheta - Rmintheta) / (Rthetanum - 1);
|
double Rdtheta = (Rmaxtheta - Rmintheta) / (Rthetanum - 1);
|
||||||
double Rdphi = (Rmaxphi - Rminphi) / (Rphinum - 1);
|
double Rdphi = (Rmaxphi - Rminphi) / (Rphinum - 1);
|
||||||
|
|
||||||
double* h_RantPattern = (double*)mallocCUDAHost(sizeof(double) * Rthetanum * Rphinum);
|
h_RantPattern = (double*)mallocCUDAHost(sizeof(double) * Rthetanum * Rphinum);
|
||||||
double* d_RantPattern = (double*)mallocCUDADevice(sizeof(double) * Rthetanum * Rphinum);
|
d_RantPattern = (double*)mallocCUDADevice(sizeof(double) * Rthetanum * Rphinum);
|
||||||
|
|
||||||
for (long i = 0; i < Rthetanum; i++) {
|
for (long i = 0; i < Rthetanum; i++) {
|
||||||
for (long j = 0; j < Rphinum; j++) {
|
for (long j = 0; j < Rphinum; j++) {
|
||||||
|
|
@ -636,10 +636,10 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
float* d_amp = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
float* d_amp = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
||||||
|
|
||||||
|
|
||||||
double* h_PRFEcho_real = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
float* h_PRFEcho_real = (float*)mallocCUDAHost(sizeof(float) * echoblockline * PlusePoint);
|
||||||
double* h_PRFEcho_imag = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
float* h_PRFEcho_imag = (float*)mallocCUDAHost(sizeof(float) * echoblockline * PlusePoint);
|
||||||
double* d_PRFEcho_real = (double*)mallocCUDADevice(sizeof(double) * echoblockline * PlusePoint);
|
float* d_PRFEcho_real = (float*)mallocCUDADevice(sizeof(float) * echoblockline * PlusePoint);
|
||||||
double* d_PRFEcho_imag = (double*)mallocCUDADevice(sizeof(double) * echoblockline * PlusePoint);
|
float* d_PRFEcho_imag = (float*)mallocCUDADevice(sizeof(float) * echoblockline * PlusePoint);
|
||||||
|
|
||||||
|
|
||||||
double* h_factorj = (double*)mallocCUDAHost(sizeof(double) * freqlist.size());
|
double* h_factorj = (double*)mallocCUDAHost(sizeof(double) * freqlist.size());
|
||||||
|
|
@ -649,11 +649,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
h_freqlist[ii] = freqlist[ii];
|
h_freqlist[ii] = freqlist[ii];
|
||||||
}
|
}
|
||||||
|
|
||||||
double* d_factorj = (double*)mallocCUDADevice(sizeof(double) * freqlist.size());
|
|
||||||
double* d_freqlist = (double*)mallocCUDADevice(sizeof(double) * freqlist.size());
|
|
||||||
HostToDevice(h_factorj, d_factorj, (sizeof(double) * freqlist.size()));
|
|
||||||
HostToDevice(h_freqlist, d_freqlist, (sizeof(double) * freqlist.size()));
|
|
||||||
|
|
||||||
testOutAmpArr("freqlist.bin", h_freqlist, freqlist.size(), 1);
|
testOutAmpArr("freqlist.bin", h_freqlist, freqlist.size(), 1);
|
||||||
testOutAmpArr("factorj.bin", h_factorj, freqlist.size(), 1);
|
testOutAmpArr("factorj.bin", h_factorj, freqlist.size(), 1);
|
||||||
// 地表覆盖类型
|
// 地表覆盖类型
|
||||||
|
|
@ -754,16 +749,11 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
HostToDevice((void*)h_demsloper_z, (void*)d_demsloper_z, sizeof(double) * newblokline * tempDemCols);
|
HostToDevice((void*)h_demsloper_z, (void*)d_demsloper_z, sizeof(double) * newblokline * tempDemCols);
|
||||||
HostToDevice((void*)h_demcls, (void*)d_demcls, sizeof(long) * newblokline * tempDemCols);
|
HostToDevice((void*)h_demcls, (void*)d_demcls, sizeof(long) * newblokline * tempDemCols);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __PRFDEBUG__ && __PRFDEBUG_PRFINF__
|
#ifdef __PRFDEBUG__ && __PRFDEBUG_PRFINF__
|
||||||
printf("tatgetPs=[%f,%f,%f]\n", h_dem_x[0], h_dem_y[0], h_dem_z[0]);
|
printf("tatgetPs=[%f,%f,%f]\n", h_dem_x[0], h_dem_y[0], h_dem_z[0]);
|
||||||
std::shared_ptr<double> h_temp_R(new double[PluseCount], delArrPtr);
|
std::shared_ptr<double> h_temp_R(new double[PluseCount], delArrPtr);
|
||||||
#endif // __PRFDEBUG__
|
#endif // __PRFDEBUG__
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long pixelcount = newblokline * tempDemCols;
|
long pixelcount = newblokline * tempDemCols;
|
||||||
long startprfid = 0;
|
long startprfid = 0;
|
||||||
for (startprfid = 0; startprfid < pluseCount; startprfid = startprfid + echoblockline) {
|
for (startprfid = 0; startprfid < pluseCount; startprfid = startprfid + echoblockline) {
|
||||||
|
|
@ -776,8 +766,9 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
h_PRFEcho_imag[tempprfid * PlusePoint + freqid] = 0;// echotemp.get()[tempprfid * PlusePoint + freqid].imag();
|
h_PRFEcho_imag[tempprfid * PlusePoint + freqid] = 0;// echotemp.get()[tempprfid * PlusePoint + freqid].imag();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HostToDevice(h_PRFEcho_real, d_PRFEcho_real, sizeof(double) * echoblockline * PlusePoint);
|
|
||||||
HostToDevice(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(double) * echoblockline * PlusePoint);
|
HostToDevice(h_PRFEcho_real, d_PRFEcho_real, sizeof(float) * echoblockline * PlusePoint);
|
||||||
|
HostToDevice(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(float) * echoblockline * PlusePoint);
|
||||||
|
|
||||||
CUDA_RFPC_MainBlock(
|
CUDA_RFPC_MainBlock(
|
||||||
antpx, antpy, antpz, // 天线的坐标
|
antpx, antpy, antpz, // 天线的坐标
|
||||||
|
|
@ -793,8 +784,10 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
d_demsloper_x, d_demsloper_y, d_demsloper_z, // 地表坡度矢量
|
d_demsloper_x, d_demsloper_y, d_demsloper_z, // 地表坡度矢量
|
||||||
Pt,// 增益后发射能量
|
Pt,// 增益后发射能量
|
||||||
refphaseRange,
|
refphaseRange,
|
||||||
d_TantPattern, TantPatternDesc,// TstartTheta, TstartPhi, Tdtheta, Tdphi, Tthetanum, Tphinum, // 发射天线方向图
|
d_TantPattern,
|
||||||
d_RantPattern, RantPatternDesc,// RstartTheta, RstartPhi, Rdtheta, Rdphi, Rthetanum, Rphinum,//接收天线方向图
|
TantPatternDesc.startTheta, TantPatternDesc.startPhi, TantPatternDesc.dtheta,TantPatternDesc.dphi,TantPatternDesc.thetanum,TantPatternDesc.phinum,
|
||||||
|
d_RantPattern,
|
||||||
|
RantPatternDesc.startTheta, RantPatternDesc.startPhi, RantPatternDesc.dtheta, RantPatternDesc.dphi, RantPatternDesc.thetanum, RantPatternDesc.phinum,
|
||||||
NearRange, FarRange,
|
NearRange, FarRange,
|
||||||
d_clsSigmaParam, clamapid,
|
d_clsSigmaParam, clamapid,
|
||||||
d_PRFEcho_real, d_PRFEcho_imag,// 输出回波
|
d_PRFEcho_real, d_PRFEcho_imag,// 输出回波
|
||||||
|
|
@ -802,8 +795,9 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
//, d_phi, d_real, d_imag// 临时变量
|
//, d_phi, d_real, d_imag// 临时变量
|
||||||
);
|
);
|
||||||
|
|
||||||
DeviceToHost(h_PRFEcho_real, d_PRFEcho_real, sizeof(double) * echoblockline * PlusePoint);
|
DeviceToHost(h_PRFEcho_real, d_PRFEcho_real, sizeof(float) * echoblockline * PlusePoint);
|
||||||
DeviceToHost(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(double) * echoblockline * PlusePoint);
|
DeviceToHost(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(float) * echoblockline * PlusePoint);
|
||||||
|
|
||||||
for (long tempprfid = 0; tempprfid < templine; tempprfid++) {
|
for (long tempprfid = 0; tempprfid < templine; tempprfid++) {
|
||||||
for (long freqid = 0; freqid < PlusePoint; freqid++) {
|
for (long freqid = 0; freqid < PlusePoint; freqid++) {
|
||||||
echotemp.get()[tempprfid * PlusePoint + freqid].real(
|
echotemp.get()[tempprfid * PlusePoint + freqid].real(
|
||||||
|
|
@ -821,12 +815,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
#endif // __PRFDEBUG__
|
#endif // __PRFDEBUG__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
// 地面数据释放
|
// 地面数据释放
|
||||||
|
|
@ -842,8 +830,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
FreeCUDAHost(h_amp); FreeCUDADevice(d_amp);
|
FreeCUDAHost(h_amp); FreeCUDADevice(d_amp);
|
||||||
FreeCUDAHost(h_demcls); FreeCUDADevice(d_demcls);
|
FreeCUDAHost(h_demcls); FreeCUDADevice(d_demcls);
|
||||||
|
|
||||||
FreeCUDAHost(h_factorj); FreeCUDADevice(d_factorj);
|
FreeCUDAHost(h_factorj); //FreeCUDADevice(d_factorj);
|
||||||
FreeCUDAHost(h_freqlist); FreeCUDADevice(d_freqlist);
|
FreeCUDAHost(h_freqlist); //FreeCUDADevice(d_freqlist);
|
||||||
FreeCUDAHost(h_PRFEcho_real); FreeCUDADevice(d_PRFEcho_real);
|
FreeCUDAHost(h_PRFEcho_real); FreeCUDADevice(d_PRFEcho_real);
|
||||||
FreeCUDAHost(h_PRFEcho_imag); FreeCUDADevice(d_PRFEcho_imag);
|
FreeCUDAHost(h_PRFEcho_imag); FreeCUDADevice(d_PRFEcho_imag);
|
||||||
//FreeCUDAHost(h_phi); FreeCUDADevice(d_phi);
|
//FreeCUDAHost(h_phi); FreeCUDADevice(d_phi);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue