更新参数
parent
bb14fd12dd
commit
dfe057c13c
|
|
@ -12,7 +12,6 @@ using namespace std;
|
||||||
using namespace Eigen;
|
using namespace Eigen;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OrbitPoly::OrbitPoly()
|
OrbitPoly::OrbitPoly()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +19,7 @@ OrbitPoly::OrbitPoly()
|
||||||
OrbitPoly::OrbitPoly(int polynum, Eigen::MatrixX<double> polySatellitePara, double SatelliteModelStartTime)
|
OrbitPoly::OrbitPoly(int polynum, Eigen::MatrixX<double> polySatellitePara, double SatelliteModelStartTime)
|
||||||
{
|
{
|
||||||
if (polySatellitePara.rows() != polynum||polySatellitePara.cols()!=6) {
|
if (polySatellitePara.rows() != polynum||polySatellitePara.cols()!=6) {
|
||||||
throw exception("?????????????????");
|
throw exception("Orbit Model Params Fail !!!");
|
||||||
}
|
}
|
||||||
this->polySatellitePara = polySatellitePara;
|
this->polySatellitePara = polySatellitePara;
|
||||||
this->SatelliteModelStartTime = SatelliteModelStartTime;
|
this->SatelliteModelStartTime = SatelliteModelStartTime;
|
||||||
|
|
|
||||||
|
|
@ -557,7 +557,7 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
double* antYaxisX, double* antYaxisY, double* antYaxisZ,// 天线坐标系的Y轴
|
double* antYaxisX, double* antYaxisY, double* antYaxisZ,// 天线坐标系的Y轴
|
||||||
double* antZaxisX, double* antZaxisY, double* antZaxisZ,// 天线坐标系的Z轴
|
double* antZaxisX, double* antZaxisY, double* antZaxisZ,// 天线坐标系的Z轴
|
||||||
double* antDirectX, double* antDirectY, double* antDirectZ,// 天线的指向
|
double* antDirectX, double* antDirectY, double* antDirectZ,// 天线的指向
|
||||||
long PRFCount, // Âö³åÊý
|
long startpid,long PRFCount, // Âö³åÊý
|
||||||
float f0, float dfreq, long freqnum, // 频率数
|
float f0, float dfreq, long freqnum, // 频率数
|
||||||
double* targetX, double* targetY, double* targetZ, long TargetPixelNumber, // 地面坐标
|
double* targetX, double* targetY, double* targetZ, long TargetPixelNumber, // 地面坐标
|
||||||
long* demCls, // 地表类别
|
long* demCls, // 地表类别
|
||||||
|
|
@ -578,17 +578,15 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
int numBlocks = 0;
|
int numBlocks = 0;
|
||||||
for(long pid=0;pid<PRFCount;pid++){
|
for(long pid=0;pid<PRFCount;pid++){
|
||||||
numBlocks = (TargetPixelNumber + BLOCK_SIZE - 1) / BLOCK_SIZE; // 根据 pixelcount 计算网格大小
|
numBlocks = (TargetPixelNumber + BLOCK_SIZE - 1) / BLOCK_SIZE; // 根据 pixelcount 计算网格大小
|
||||||
|
|
||||||
|
|
||||||
CUDAKernel_RFPC_Computer_R_Gain<<<numBlocks , BLOCK_SIZE >>>(
|
CUDAKernel_RFPC_Computer_R_Gain<<<numBlocks , BLOCK_SIZE >>>(
|
||||||
antX[pid], antY[pid], antZ[pid],
|
antX[startpid+pid], antY[startpid+pid], antZ[startpid+pid],
|
||||||
targetX, targetY, targetZ, TargetPixelNumber,
|
targetX, targetY, targetZ, TargetPixelNumber,
|
||||||
demCls,
|
demCls,
|
||||||
demSlopeX, demSlopeY, demSlopeZ,
|
demSlopeX, demSlopeY, demSlopeZ,
|
||||||
antXaxisX[pid], antXaxisY[pid], antXaxisZ[pid],
|
antXaxisX[startpid+pid], antXaxisY[startpid+pid], antXaxisZ[startpid+pid],
|
||||||
antYaxisX[pid], antYaxisY[pid], antYaxisZ[pid],
|
antYaxisX[startpid+pid], antYaxisY[startpid+pid], antYaxisZ[startpid+pid],
|
||||||
antZaxisX[pid], antZaxisY[pid], antZaxisZ[pid],
|
antZaxisX[startpid+pid], antZaxisY[startpid+pid], antZaxisZ[startpid+pid],
|
||||||
antDirectX[pid], antDirectY[pid], antDirectZ[pid],
|
antDirectX[startpid + pid], antDirectY[startpid + pid], antDirectZ[startpid + pid],
|
||||||
Pt,// 增益后发射能量
|
Pt,// 增益后发射能量
|
||||||
refPhaseRange,
|
refPhaseRange,
|
||||||
TransAntpattern,
|
TransAntpattern,
|
||||||
|
|
@ -611,7 +609,6 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
(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);
|
||||||
|
|
||||||
}
|
}
|
||||||
cudaDeviceSynchronize();
|
cudaDeviceSynchronize();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ extern "C" void CUDA_RFPC_MainBlock(
|
||||||
double* antYaxisX, double* antYaxisY, double* antYaxisZ,// 天线坐标系的Y轴
|
double* antYaxisX, double* antYaxisY, double* antYaxisZ,// 天线坐标系的Y轴
|
||||||
double* antZaxisX, double* antZaxisY, double* antZaxisZ,// 天线坐标系的Z轴
|
double* antZaxisX, double* antZaxisY, double* antZaxisZ,// 天线坐标系的Z轴
|
||||||
double* antDirectX, double* antDirectY, double* antDirectZ,// 天线的指向
|
double* antDirectX, double* antDirectY, double* antDirectZ,// 天线的指向
|
||||||
long PRFCount, // 脉冲数
|
long startpid, long PRFCount, // 脉冲数
|
||||||
float f0, float dfreq, long freqnum,// 频率数
|
float f0, float dfreq, long freqnum,// 频率数
|
||||||
double* targetX, double* targetY, double* targetZ, long TargetPixelNumber, // 地面坐标
|
double* targetX, double* targetY, double* targetZ, long TargetPixelNumber, // 地面坐标
|
||||||
long* demCls, // 地表类别
|
long* demCls, // 地表类别
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ void QImageSARRFPC::onBtnaccept()
|
||||||
QString TaskXmlPath = ui.taskXmlPathEdit->text().trimmed();//u8"D:/Programme/vs2022/RasterMergeTest/TestData/GF3_Simulation_Setting.xml";
|
QString TaskXmlPath = ui.taskXmlPathEdit->text().trimmed();//u8"D:/Programme/vs2022/RasterMergeTest/TestData/GF3_Simulation_Setting.xml";
|
||||||
QString demTiffPath = ui.demTiffPathEdit->text().trimmed();//u8"D:/Programme/vs2022/RasterMergeTest/TestData/115E39N_COP30_clip.tif";
|
QString demTiffPath = ui.demTiffPathEdit->text().trimmed();//u8"D:/Programme/vs2022/RasterMergeTest/TestData/115E39N_COP30_clip.tif";
|
||||||
QString landConverPath = ui.landCoverPathEdit->text().trimmed();// u8"D:/Programme/vs2022/RasterMergeTest/TestData/landcover_aligned.tiff";
|
QString landConverPath = ui.landCoverPathEdit->text().trimmed();// u8"D:/Programme/vs2022/RasterMergeTest/TestData/landcover_aligned.tiff";
|
||||||
|
QString demsloperPath = ui.sloperPathEdit->text().trimmed();
|
||||||
QString OutEchoPath = ui.outEchoPathEdit->text().trimmed();// u8"D:/Programme/vs2022/RasterMergeTest/TestData/outData/";
|
QString OutEchoPath = ui.outEchoPathEdit->text().trimmed();// u8"D:/Programme/vs2022/RasterMergeTest/TestData/outData/";
|
||||||
QString simulationtaskName = ui.simulationTaskNameEdit->text().trimmed();// u8"GF3_Simulation";
|
QString simulationtaskName = ui.simulationTaskNameEdit->text().trimmed();// u8"GF3_Simulation";
|
||||||
// ÌìÏß·½Ïòͼ
|
// ÌìÏß·½Ïòͼ
|
||||||
|
|
@ -187,7 +187,9 @@ void QImageSARRFPC::onBtnaccept()
|
||||||
|
|
||||||
long cpucore_num = std::thread::hardware_concurrency();
|
long cpucore_num = std::thread::hardware_concurrency();
|
||||||
|
|
||||||
RFPCProcessMain(cpucore_num, TransAntPatternFilePath, ReceiveAntPatternFilePath, simulationtaskName, OutEchoPath, GPSXmlPath, TaskXmlPath, demTiffPath, landConverPath);
|
RFPCProcessMain(cpucore_num,
|
||||||
|
TransAntPatternFilePath, ReceiveAntPatternFilePath, simulationtaskName,
|
||||||
|
OutEchoPath, GPSXmlPath, TaskXmlPath, demTiffPath, demsloperPath, landConverPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>873</width>
|
<width>873</width>
|
||||||
<height>534</height>
|
<height>686</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>853</width>
|
<width>853</width>
|
||||||
<height>485</height>
|
<height>634</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
|
@ -233,7 +233,7 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/115E39N_COP30_clip.tif</string>
|
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/demdataset/demxyz.bin</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -349,6 +349,9 @@
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>D:/Programme/vs2022/RasterMergeTest/simulationData/demdataset/demsloper.bin</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="2">
|
<item row="8" column="2">
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,10 @@ std::shared_ptr<SatelliteOribtNode[]> RFPCProcessCls::getSatelliteOribtNodes(dou
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RFPCProcessMain(long num_thread, QString TansformPatternFilePath, QString ReceivePatternFilePath, QString simulationtaskName, QString OutEchoPath, QString GPSXmlPath, QString TaskXmlPath,QString demTiffPath, QString sloperPath, QString LandCoverPath)
|
void RFPCProcessMain(long num_thread,
|
||||||
|
QString TansformPatternFilePath, QString ReceivePatternFilePath,
|
||||||
|
QString simulationtaskName, QString OutEchoPath,
|
||||||
|
QString GPSXmlPath, QString TaskXmlPath,QString demTiffPath, QString sloperPath, QString LandCoverPath)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::shared_ptr < AbstractSARSatelliteModel> task = ReadSimulationSettingsXML(TaskXmlPath);
|
std::shared_ptr < AbstractSARSatelliteModel> task = ReadSimulationSettingsXML(TaskXmlPath);
|
||||||
|
|
@ -371,12 +374,63 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
long PlusePoint = this->EchoSimulationData->getPlusePoints();
|
long PlusePoint = this->EchoSimulationData->getPlusePoints();
|
||||||
POLARTYPEENUM polartype = this->TaskSetting->getPolarType();
|
POLARTYPEENUM polartype = this->TaskSetting->getPolarType();
|
||||||
gdalImage echoMaskImg(this->OutEchoMaskPath);
|
gdalImage echoMaskImg(this->OutEchoMaskPath);
|
||||||
|
long echoblockline = Memory1GB / 8 / 2 / PlusePoint * 2;
|
||||||
|
|
||||||
#ifndef __CUDANVCC___
|
#ifndef __CUDANVCC___
|
||||||
QMessageBox::information(this, u8"程序提示", u8"请确定安装了CUDA库");
|
QMessageBox::information(this, u8"程序提示", u8"请确定安装了CUDA库");
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
||||||
|
double* antpx,*antpy,*antpz,
|
||||||
|
*antvx,*antvy,*antvz,
|
||||||
|
*antdirectx,*antdirecty,*antdirectz
|
||||||
|
,*antXaxisX,*antXaxisY,*antXaxisZ,
|
||||||
|
*antYaxisX,*antYaxisY,*antYaxisZ,
|
||||||
|
*antZaxisX,*antZaxisY,*antZaxisZ;
|
||||||
|
{
|
||||||
|
antpx = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antpy = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antpz = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antvx = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antvy = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antvz = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antdirectx = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antdirecty = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antdirectz = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antXaxisX = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antXaxisY = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antXaxisZ = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antYaxisX = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antYaxisY = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antYaxisZ = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antZaxisX = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antZaxisY = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
antZaxisZ = (double*)mallocCUDAHost(sizeof(double) * pluseCount);
|
||||||
|
|
||||||
|
|
||||||
|
for (long tempprfid = 0; tempprfid < pluseCount; tempprfid++) {
|
||||||
|
long prfid = tempprfid;
|
||||||
|
antpx[tempprfid] = sateOirbtNodes[prfid].Px;
|
||||||
|
antpy[tempprfid] = sateOirbtNodes[prfid].Py;
|
||||||
|
antpz[tempprfid] = sateOirbtNodes[prfid].Pz;
|
||||||
|
antvx[tempprfid] = sateOirbtNodes[prfid].Vx;
|
||||||
|
antvy[tempprfid] = sateOirbtNodes[prfid].Vy;
|
||||||
|
antvz[tempprfid] = sateOirbtNodes[prfid].Vz; //6
|
||||||
|
antdirectx[tempprfid] = sateOirbtNodes[prfid].AntDirecX;
|
||||||
|
antdirecty[tempprfid] = sateOirbtNodes[prfid].AntDirecY;
|
||||||
|
antdirectz[tempprfid] = sateOirbtNodes[prfid].AntDirecZ; // 9 天线指向
|
||||||
|
antXaxisX[tempprfid] = sateOirbtNodes[prfid].AntXaxisX;
|
||||||
|
antXaxisY[tempprfid] = sateOirbtNodes[prfid].AntXaxisY;
|
||||||
|
antXaxisZ[tempprfid] = sateOirbtNodes[prfid].AntXaxisZ;//12 天线坐标系
|
||||||
|
antYaxisX[tempprfid] = sateOirbtNodes[prfid].AntYaxisX;
|
||||||
|
antYaxisY[tempprfid] = sateOirbtNodes[prfid].AntYaxisY;
|
||||||
|
antYaxisZ[tempprfid] = sateOirbtNodes[prfid].AntYaxisZ;//15
|
||||||
|
antZaxisX[tempprfid] = sateOirbtNodes[prfid].AntZaxisX;
|
||||||
|
antZaxisY[tempprfid] = sateOirbtNodes[prfid].AntZaxisY;
|
||||||
|
antZaxisZ[tempprfid] = sateOirbtNodes[prfid].AntZaxisZ;//18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// RFPC CUDA版本
|
// RFPC CUDA版本
|
||||||
if (pluseCount * 4 * 18 > Memory1MB * 100) {
|
if (pluseCount * 4 * 18 > Memory1MB * 100) {
|
||||||
long max = Memory1MB * 100 / 4 / 20 / PluseCount;
|
long max = Memory1MB * 100 / 4 / 20 / PluseCount;
|
||||||
|
|
@ -389,7 +443,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
// 参数与分块计算
|
// 参数与分块计算
|
||||||
long demRow = demxyz.height;
|
long demRow = demxyz.height;
|
||||||
long demCol = demxyz.width;
|
long demCol = demxyz.width;
|
||||||
|
|
||||||
long blokline = 100;
|
long blokline = 100;
|
||||||
|
|
||||||
// 每块 250MB*16 = 4GB
|
// 每块 250MB*16 = 4GB
|
||||||
|
|
@ -441,9 +494,11 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
TantPatternDesc.phinum = Tphinum;
|
TantPatternDesc.phinum = Tphinum;
|
||||||
TantPatternDesc.thetanum = Tthetanum;
|
TantPatternDesc.thetanum = Tthetanum;
|
||||||
}
|
}
|
||||||
|
|
||||||
PatternImageDesc RantPatternDesc = {};
|
PatternImageDesc RantPatternDesc = {};
|
||||||
double* h_RantPattern = nullptr;
|
double* h_RantPattern = nullptr;
|
||||||
double* d_RantPattern = nullptr;
|
double* d_RantPattern = nullptr;
|
||||||
|
|
||||||
{
|
{
|
||||||
// 处理接收天线方向图
|
// 处理接收天线方向图
|
||||||
double Rminphi = ReceivePattern->getMinPhi();
|
double Rminphi = ReceivePattern->getMinPhi();
|
||||||
|
|
@ -488,30 +543,31 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
QMap<long, long> clamap;
|
QMap<long, long> clamap;
|
||||||
long clamapid = 0;
|
long clamapid = 0;
|
||||||
long startline = 0;
|
long startline = 0;
|
||||||
|
|
||||||
for (startline = 0; startline < demRow; startline = startline + blokline) {
|
{
|
||||||
Eigen::MatrixXd clsland = demlandcls.getData(startline, 0, blokline, demlandcls.width, 1);
|
for (startline = 0; startline < demRow; startline = startline + blokline) {
|
||||||
long clsrows = clsland.rows();
|
Eigen::MatrixXd clsland = demlandcls.getData(startline, 0, blokline, demlandcls.width, 1);
|
||||||
long clscols = clsland.cols();
|
long clsrows = clsland.rows();
|
||||||
long clsid = 0;
|
long clscols = clsland.cols();
|
||||||
for (long ii = 0; ii < clsrows; ii++) {
|
long clsid = 0;
|
||||||
for (long jj = 0; jj < clscols; jj++) {
|
for (long ii = 0; ii < clsrows; ii++) {
|
||||||
clsid = clsland(ii, jj);
|
for (long jj = 0; jj < clscols; jj++) {
|
||||||
if (clamap.contains(clsid)) {}
|
clsid = clsland(ii, jj);
|
||||||
else {
|
if (clamap.contains(clsid)) {}
|
||||||
clamap.insert(clsid, clamapid);
|
else {
|
||||||
clamapid = clamapid + 1;
|
clamap.insert(clsid, clamapid);
|
||||||
|
clamapid = clamapid + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "class id recoding" << std::endl;
|
std::cout << "class id recoding" << std::endl;
|
||||||
for (long id : clamap.keys()) {
|
for (long id : clamap.keys()) {
|
||||||
std::cout << id << " -> " << clamap[id] << std::endl;
|
std::cout << id << " -> " << clamap[id] << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CUDASigmaParam* h_clsSigmaParam = (CUDASigmaParam*)mallocCUDAHost(sizeof(CUDASigmaParam) * clamapid);
|
CUDASigmaParam* h_clsSigmaParam = (CUDASigmaParam*)mallocCUDAHost(sizeof(CUDASigmaParam) * clamapid);
|
||||||
CUDASigmaParam* d_clsSigmaParam = (CUDASigmaParam*)mallocCUDADevice(sizeof(CUDASigmaParam) * clamapid);
|
CUDASigmaParam* d_clsSigmaParam = (CUDASigmaParam*)mallocCUDADevice(sizeof(CUDASigmaParam) * clamapid);
|
||||||
|
|
||||||
|
|
@ -543,7 +599,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
|
|
||||||
HostToDevice(h_clsSigmaParam, d_clsSigmaParam, sizeof(CUDASigmaParam) * clamapid);
|
HostToDevice(h_clsSigmaParam, d_clsSigmaParam, sizeof(CUDASigmaParam) * clamapid);
|
||||||
|
|
||||||
|
|
||||||
long blockwidth = demxyz.width;
|
long blockwidth = demxyz.width;
|
||||||
#ifdef __PRFDEBUG__
|
#ifdef __PRFDEBUG__
|
||||||
blokline = 1;
|
blokline = 1;
|
||||||
|
|
@ -579,14 +634,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
float* d_R = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
float* d_R = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
||||||
float* h_amp = (float*)mallocCUDAHost(sizeof(float) * blokline * tempDemCols);
|
float* h_amp = (float*)mallocCUDAHost(sizeof(float) * blokline * tempDemCols);
|
||||||
float* d_amp = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
float* d_amp = (float*)mallocCUDADevice(sizeof(float) * blokline * tempDemCols);
|
||||||
//double* h_phi = (double*)mallocCUDAHost(sizeof(double) * blokline * tempDemCols);
|
|
||||||
//double* d_phi = (double*)mallocCUDADevice(sizeof(double) * blokline * tempDemCols);
|
|
||||||
//double* h_real = (double*)mallocCUDAHost(sizeof(double) * blokline * tempDemCols);
|
|
||||||
//double* d_real = (double*)mallocCUDADevice(sizeof(double) * blokline * tempDemCols);
|
|
||||||
//double* h_imag = (double*)mallocCUDAHost(sizeof(double) * blokline * tempDemCols);
|
|
||||||
//double* d_imag = (double*)mallocCUDADevice(sizeof(double) * blokline * tempDemCols);
|
|
||||||
|
|
||||||
long echoblockline = Memory1GB / 8 / 2 / PlusePoint * 2;
|
|
||||||
double* h_PRFEcho_real = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
double* h_PRFEcho_real = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
||||||
double* h_PRFEcho_imag = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
double* h_PRFEcho_imag = (double*)mallocCUDAHost(sizeof(double) * echoblockline * PlusePoint);
|
||||||
double* d_PRFEcho_real = (double*)mallocCUDADevice(sizeof(double) * echoblockline * PlusePoint);
|
double* d_PRFEcho_real = (double*)mallocCUDADevice(sizeof(double) * echoblockline * PlusePoint);
|
||||||
|
|
@ -671,13 +720,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
d_R = (float*)mallocCUDADevice(sizeof(float) * newblokline * tempDemCols);
|
d_R = (float*)mallocCUDADevice(sizeof(float) * newblokline * tempDemCols);
|
||||||
h_amp = (float*)mallocCUDAHost(sizeof(float) * newblokline * tempDemCols);
|
h_amp = (float*)mallocCUDAHost(sizeof(float) * newblokline * tempDemCols);
|
||||||
d_amp = (float*)mallocCUDADevice(sizeof(float) * newblokline * tempDemCols);
|
d_amp = (float*)mallocCUDADevice(sizeof(float) * newblokline * tempDemCols);
|
||||||
//h_phi = (double*)mallocCUDAHost(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
//d_phi = (double*)mallocCUDADevice(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
//h_real = (double*)mallocCUDAHost(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
//d_real = (double*)mallocCUDADevice(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
//h_imag = (double*)mallocCUDAHost(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
//d_imag = (double*)mallocCUDADevice(sizeof(double) * newblokline * tempDemCols);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//# pragma omp parallel for
|
//# pragma omp parallel for
|
||||||
|
|
@ -737,54 +779,13 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
HostToDevice(h_PRFEcho_real, d_PRFEcho_real, sizeof(double) * echoblockline * PlusePoint);
|
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_imag, d_PRFEcho_imag, sizeof(double) * echoblockline * PlusePoint);
|
||||||
|
|
||||||
double* antpx = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antpy = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antpz = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antvx = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antvy = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antvz = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antdirectx = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antdirecty = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antdirectz = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antXaxisX = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antXaxisY = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antXaxisZ = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antYaxisX = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antYaxisY = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antYaxisZ = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antZaxisX = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antZaxisY = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
double* antZaxisZ = (double*)mallocCUDAHost(sizeof(double) * templine);
|
|
||||||
|
|
||||||
for (long tempprfid = 0; tempprfid < templine; tempprfid++) {
|
|
||||||
long prfid = tempprfid + startprfid;
|
|
||||||
antpx[tempprfid] = sateOirbtNodes[prfid].Px;
|
|
||||||
antpy[tempprfid] = sateOirbtNodes[prfid].Py;
|
|
||||||
antpz[tempprfid] = sateOirbtNodes[prfid].Pz;
|
|
||||||
antvx[tempprfid] = sateOirbtNodes[prfid].Vx;
|
|
||||||
antvy[tempprfid] = sateOirbtNodes[prfid].Vy;
|
|
||||||
antvz[tempprfid] = sateOirbtNodes[prfid].Vz; //6
|
|
||||||
antdirectx[tempprfid] = sateOirbtNodes[prfid].AntDirecX;
|
|
||||||
antdirecty[tempprfid] = sateOirbtNodes[prfid].AntDirecY;
|
|
||||||
antdirectz[tempprfid] = sateOirbtNodes[prfid].AntDirecZ; // 9 天线指向
|
|
||||||
antXaxisX[tempprfid] = sateOirbtNodes[prfid].AntXaxisX;
|
|
||||||
antXaxisY[tempprfid] = sateOirbtNodes[prfid].AntXaxisY;
|
|
||||||
antXaxisZ[tempprfid] = sateOirbtNodes[prfid].AntXaxisZ;//12 天线坐标系
|
|
||||||
antYaxisX[tempprfid] = sateOirbtNodes[prfid].AntYaxisX;
|
|
||||||
antYaxisY[tempprfid] = sateOirbtNodes[prfid].AntYaxisY;
|
|
||||||
antYaxisZ[tempprfid] = sateOirbtNodes[prfid].AntYaxisZ;//15
|
|
||||||
antZaxisX[tempprfid] = sateOirbtNodes[prfid].AntZaxisX;
|
|
||||||
antZaxisY[tempprfid] = sateOirbtNodes[prfid].AntZaxisY;
|
|
||||||
antZaxisZ[tempprfid] = sateOirbtNodes[prfid].AntZaxisZ;//18
|
|
||||||
}
|
|
||||||
|
|
||||||
CUDA_RFPC_MainBlock(
|
CUDA_RFPC_MainBlock(
|
||||||
antpx, antpy, antpz, // 天线的坐标
|
antpx, antpy, antpz, // 天线的坐标
|
||||||
antXaxisX, antXaxisY, antXaxisZ, // 天线坐标系的X轴
|
antXaxisX, antXaxisY, antXaxisZ, // 天线坐标系的X轴
|
||||||
antYaxisX, antYaxisY, antYaxisZ,// 天线坐标系的Y轴
|
antYaxisX, antYaxisY, antYaxisZ,// 天线坐标系的Y轴
|
||||||
antZaxisX, antZaxisY, antZaxisZ,// 天线坐标系的Z轴
|
antZaxisX, antZaxisY, antZaxisZ,// 天线坐标系的Z轴
|
||||||
antdirectx, antdirecty, antdirectz,// 天线的指向
|
antdirectx, antdirecty, antdirectz,// 天线的指向
|
||||||
templine, // 脉冲数
|
startprfid,templine, // 脉冲数
|
||||||
//h_freqlist, h_factorj, PlusePoint,// 频率数
|
//h_freqlist, h_factorj, PlusePoint,// 频率数
|
||||||
f0, dfreq, PlusePoint,// 频率数
|
f0, dfreq, PlusePoint,// 频率数
|
||||||
d_dem_x, d_dem_y, d_dem_z, pixelcount, // 地面坐标
|
d_dem_x, d_dem_y, d_dem_z, pixelcount, // 地面坐标
|
||||||
|
|
@ -792,8 +793,8 @@ 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, TstartTheta, TstartPhi, Tdtheta, Tdphi, Tthetanum, Tphinum, // 发射天线方向图
|
d_TantPattern, TantPatternDesc,// TstartTheta, TstartPhi, Tdtheta, Tdphi, Tthetanum, Tphinum, // 发射天线方向图
|
||||||
d_RantPattern, RstartTheta, RstartPhi, Rdtheta, Rdphi, Rthetanum, Rphinum,//接收天线方向图
|
d_RantPattern, RantPatternDesc,// RstartTheta, RstartPhi, Rdtheta, Rdphi, Rthetanum, Rphinum,//接收天线方向图
|
||||||
NearRange, FarRange,
|
NearRange, FarRange,
|
||||||
d_clsSigmaParam, clamapid,
|
d_clsSigmaParam, clamapid,
|
||||||
d_PRFEcho_real, d_PRFEcho_imag,// 输出回波
|
d_PRFEcho_real, d_PRFEcho_imag,// 输出回波
|
||||||
|
|
@ -801,26 +802,6 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
//, d_phi, d_real, d_imag// 临时变量
|
//, d_phi, d_real, d_imag// 临时变量
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
FreeCUDAHost(antpx); // 回收局部数据
|
|
||||||
FreeCUDAHost(antpy);
|
|
||||||
FreeCUDAHost(antpz);
|
|
||||||
FreeCUDAHost(antvx);
|
|
||||||
FreeCUDAHost(antvy);
|
|
||||||
FreeCUDAHost(antvz);
|
|
||||||
FreeCUDAHost(antdirectx);
|
|
||||||
FreeCUDAHost(antdirecty);
|
|
||||||
FreeCUDAHost(antdirectz);
|
|
||||||
FreeCUDAHost(antXaxisX);
|
|
||||||
FreeCUDAHost(antXaxisY);
|
|
||||||
FreeCUDAHost(antXaxisZ);
|
|
||||||
FreeCUDAHost(antYaxisX);
|
|
||||||
FreeCUDAHost(antYaxisY);
|
|
||||||
FreeCUDAHost(antYaxisZ);
|
|
||||||
FreeCUDAHost(antZaxisX);
|
|
||||||
FreeCUDAHost(antZaxisY);
|
|
||||||
FreeCUDAHost(antZaxisZ);
|
|
||||||
|
|
||||||
DeviceToHost(h_PRFEcho_real, d_PRFEcho_real, sizeof(double) * echoblockline * PlusePoint);
|
DeviceToHost(h_PRFEcho_real, d_PRFEcho_real, sizeof(double) * echoblockline * PlusePoint);
|
||||||
DeviceToHost(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(double) * echoblockline * PlusePoint);
|
DeviceToHost(h_PRFEcho_imag, d_PRFEcho_imag, sizeof(double) * echoblockline * PlusePoint);
|
||||||
for (long tempprfid = 0; tempprfid < templine; tempprfid++) {
|
for (long tempprfid = 0; tempprfid < templine; tempprfid++) {
|
||||||
|
|
@ -840,6 +821,12 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
#endif // __PRFDEBUG__
|
#endif // __PRFDEBUG__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
// 地面数据释放
|
// 地面数据释放
|
||||||
|
|
@ -863,6 +850,28 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU()
|
||||||
//FreeCUDAHost(h_real); FreeCUDADevice(d_real);
|
//FreeCUDAHost(h_real); FreeCUDADevice(d_real);
|
||||||
//FreeCUDAHost(h_imag); FreeCUDADevice(d_imag);
|
//FreeCUDAHost(h_imag); FreeCUDADevice(d_imag);
|
||||||
|
|
||||||
|
|
||||||
|
FreeCUDAHost(antpx); // 回收局部数据
|
||||||
|
FreeCUDAHost(antpy);
|
||||||
|
FreeCUDAHost(antpz);
|
||||||
|
FreeCUDAHost(antvx);
|
||||||
|
FreeCUDAHost(antvy);
|
||||||
|
FreeCUDAHost(antvz);
|
||||||
|
FreeCUDAHost(antdirectx);
|
||||||
|
FreeCUDAHost(antdirecty);
|
||||||
|
FreeCUDAHost(antdirectz);
|
||||||
|
FreeCUDAHost(antXaxisX);
|
||||||
|
FreeCUDAHost(antXaxisY);
|
||||||
|
FreeCUDAHost(antXaxisZ);
|
||||||
|
FreeCUDAHost(antYaxisX);
|
||||||
|
FreeCUDAHost(antYaxisY);
|
||||||
|
FreeCUDAHost(antYaxisZ);
|
||||||
|
FreeCUDAHost(antZaxisX);
|
||||||
|
FreeCUDAHost(antZaxisY);
|
||||||
|
FreeCUDAHost(antZaxisZ);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this->EchoSimulationData->saveToXml();
|
this->EchoSimulationData->saveToXml();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue