Make TVAL GPU executeable
This commit is contained in:
@@ -309,7 +309,7 @@ namespace Recon
|
||||
result.hitmap[linearIndices[i]]+=1;
|
||||
}
|
||||
}
|
||||
printf("Progress: %f (%zu of %zu)\r\n",(double)rayCount*100/(double)nTotalRays,rayCount,nTotalRays);
|
||||
// printf("Progress: %f (%zu of %zu)\r\n",(double)rayCount*100/(double)nTotalRays,rayCount,nTotalRays);
|
||||
cnt = cnt + pathLenDisc;
|
||||
|
||||
if (cnt < safesize)
|
||||
|
||||
@@ -129,10 +129,10 @@ namespace Recon {
|
||||
for (size_t i = 0; i < transParams::gpuSelectionList.getDataSize(); i++)
|
||||
{
|
||||
std::string msg;
|
||||
// if (!resetGPUDevice((int)transParams::gpuSelectionList[i],msg))
|
||||
// {
|
||||
// std::cerr<<msg<<std::endl;
|
||||
// }
|
||||
if (!resetGPUDevice((int)transParams::gpuSelectionList[i],msg))
|
||||
{
|
||||
std::cerr<<msg<<std::endl;
|
||||
}
|
||||
}
|
||||
std::vector<int> potentialMapDataDims = {1,1,1};
|
||||
for(size_t i=0; i<dims.getDataSize(); ++i)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "TVAL.h"
|
||||
|
||||
#include "Function2D.h"
|
||||
#include "Matrix.h"
|
||||
#include "tval3gpu3d.h"
|
||||
|
||||
#include "mkl_spblas.h"
|
||||
@@ -153,10 +154,10 @@ namespace Recon
|
||||
Aurora::Matrix callTval3(Aurora::Sparse& M, Aurora::Matrix& b,const Aurora::Matrix& dims,int device, TVALOptions& opt)
|
||||
{
|
||||
checkAndScale(M,b,(size_t)Aurora::prod(dims).getScalar());
|
||||
int * xIdxs = new int[M.getColVector().getDataSize()];
|
||||
std::copy(M.getColVector().getData(),M.getColVector().getData()+M.getColVector().getDataSize(),xIdxs);
|
||||
int * yIdxs = new int[M.getRowVector().getDataSize()];
|
||||
std::copy(M.getRowVector().getData(),M.getRowVector().getData()+M.getRowVector().getDataSize(),yIdxs);
|
||||
int * yIdxs = new int[M.getColVector().getDataSize()];
|
||||
std::copy(M.getColVector().getData(),M.getColVector().getData()+M.getColVector().getDataSize(),yIdxs);
|
||||
int * xIdxs = new int[M.getRowVector().getDataSize()];
|
||||
std::copy(M.getRowVector().getData(),M.getRowVector().getData()+M.getRowVector().getDataSize(),xIdxs);
|
||||
Aurora::Matrix values = M.getValVector();
|
||||
int nz = std::max(M.getColVector().getDataSize(),std::max(M.getRowVector().getDataSize(),M.getValVector().getDataSize()));
|
||||
float* bData = new float[b.getDataSize()];
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Recon
|
||||
{
|
||||
//callTval3
|
||||
TVALOptions opt;
|
||||
opt.nonneg = solverOptions.nonNeg;
|
||||
opt.bent = false;
|
||||
opt.tol = 1E-10;
|
||||
opt.maxit = niter;
|
||||
|
||||
@@ -23,6 +23,9 @@ inline double fourDecimalRound(double src){
|
||||
#define EXPECT_DOUBLE_AE(valueA,valueB)\
|
||||
EXPECT_DOUBLE_EQ(fourDecimalRound(valueA),fourDecimalRound(valueB))
|
||||
|
||||
#define ASSERT_DOUBLE_AE(valueA,valueB)\
|
||||
ASSERT_DOUBLE_EQ(fourDecimalRound(valueA),fourDecimalRound(valueB))
|
||||
|
||||
class Reconstruction_Test : public ::testing::Test {
|
||||
protected:
|
||||
static void SetUpReconstructionTester() {
|
||||
@@ -48,11 +51,13 @@ TEST_F(Reconstruction_Test, reconstructArt) {
|
||||
auto res = m.read("res");
|
||||
auto senderList = m.read("senderList");
|
||||
auto SOS_IN_WATER = m.read("SOS_IN_WATER");
|
||||
auto f1 = m.read("f1");
|
||||
|
||||
MatlabReader m2("/home/krad/TestData/gpuresult.mat");
|
||||
auto f1 = m2.read("out");
|
||||
auto result = Recon::reconstructArt(data, dataAtt, dims, senderList, receiverList, res, SOS_IN_WATER[0]);
|
||||
for(size_t i=0; i<f1.getDataSize(); ++i)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(f1[i], result.outSOS[i]);
|
||||
ASSERT_DOUBLE_AE(f1[i], result.outSOS[i])<<"index:"<<i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user