feat: Add cuda function in getTransmission and detection.

This commit is contained in:
sunwen
2024-12-25 11:11:31 +08:00
parent 20ca7f0ce5
commit 4daf8e0c0b
3 changed files with 60 additions and 91 deletions

View File

@@ -10,6 +10,7 @@
#include "common/getMeasurementMetaData.h"
#include "config/config.h"
#include "transmissionReconstruction/detection/detection.cuh"
//remove detectTofAndAttMex function, use detectTofAndAtt function instead of
//保留函数和函数申明备忘以防以后再次使用以下头文件从动态库中映入了detectTofAndAttMex的核心函数
@@ -417,18 +418,17 @@ namespace Recon {
// return result;
// }
DetectResult transmissionDetection(const Aurora::Matrix &AscanBlock,
const Aurora::Matrix &AscanRefBlock,
const Aurora::Matrix &distBlock,
const Aurora::Matrix &distRefBlock,
DetectResult transmissionDetection(const Aurora::CudaMatrix &AscanBlock,
const Aurora::CudaMatrix &AscanRefBlock,
const Aurora::CudaMatrix &distBlock,
const Aurora::CudaMatrix &distRefBlock,
const Aurora::Matrix &sosWaterBlock,
const Aurora::Matrix &sosWaterRefBlock,
float expectedSOSWater) {
auto _sosWaterBlock = temperatureToSoundSpeed(sosWaterBlock, "marczak");
auto _sosWaterRefBlock = temperatureToSoundSpeed(sosWaterRefBlock, "marczak");
auto _sosWaterBlock = temperatureToSoundSpeed(sosWaterBlock, "marczak").toDeviceMatrix();
auto _sosWaterRefBlock = temperatureToSoundSpeed(sosWaterRefBlock, "marczak").toDeviceMatrix();
switch (Recon::transParams::version) {
//remove detectTofAndAttMex function, use detectTofAndAtt function instead of
//保留函数和函数申明备忘,以防以后再次使用
// case 1: {
// return detectTofAndAttMex(
// AscanBlock, AscanRefBlock, distBlock, distRefBlock,
@@ -440,13 +440,18 @@ namespace Recon {
// }
// case 2:
default:
return detectTofAndAtt(
auto r = detectTofAndAtt(
AscanBlock, AscanRefBlock, distBlock, distRefBlock,
_sosWaterBlock, _sosWaterRefBlock, Recon::transParams::resampleFactor, Recon::transParams::nThreads,
expectedSOSWater, Recon::transParams::useTimeWindowing,
Recon::transParams::aScanReconstructionFrequency, Recon::transParams::detectionWindowATT,
Recon::transParams::offsetElectronic, Recon::transParams::detectionWindowSOS, Recon::transParams::minSpeedOfSound,
Recon::transParams::maxSpeedOfSound, Recon::transParams::gaussWindow);
DetectResult ret;
ret.att = r.att.toHostMatrix();
ret.sosValue = r.sosValue.toHostMatrix();
ret.tof = r.tof.toHostMatrix();
return ret;
}
}
}