Make TVAL GPU executeable

This commit is contained in:
kradchen
2023-06-02 09:35:37 +08:00
parent f96b9366b5
commit d8fe36f48c
5 changed files with 18 additions and 11 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()];

View File

@@ -29,6 +29,7 @@ namespace Recon
{
//callTval3
TVALOptions opt;
opt.nonneg = solverOptions.nonNeg;
opt.bent = false;
opt.tol = 1E-10;
opt.maxit = niter;