Skip to content
Snippets Groups Projects
Commit 87b058d4 authored by Moises Fernandez's avatar Moises Fernandez
Browse files

Delete unnecessary params in Samples Record-Save

parent 37080b64
No related branches found
No related tags found
No related merge requests found
......@@ -288,7 +288,6 @@ void runmcmc_record( //INPUT
double seed,
string output_file,
//OUTPUT
thrust::device_vector<int>& multirecords_gpu,
thrust::device_vector<float>& rf0_gpu,
thrust::device_vector<float>& rtau_gpu,
thrust::device_vector<float>& rs0_gpu,
......@@ -296,8 +295,7 @@ void runmcmc_record( //INPUT
thrust::device_vector<float>& rdstd_gpu,
thrust::device_vector<float>& rth_gpu,
thrust::device_vector<float>& rph_gpu,
thrust::device_vector<float>& rf_gpu,
thrust::device_vector<float>& rlikelihood_energy_gpu)
thrust::device_vector<float>& rf_gpu)
{
xfibresOptions& opts = xfibresOptions::getInstance();
......@@ -397,7 +395,6 @@ void runmcmc_record( //INPUT
double *signals_ptr = thrust::raw_pointer_cast(signals_gpu.data());
double *isosignals_ptr = thrust::raw_pointer_cast(isosignals_gpu.data());
int *multirecords_ptr = thrust::raw_pointer_cast(multirecords_gpu.data());
float *rf0_ptr = thrust::raw_pointer_cast(rf0_gpu.data());
float *rtau_ptr = thrust::raw_pointer_cast(rtau_gpu.data());
float *rs0_ptr = thrust::raw_pointer_cast(rs0_gpu.data());
......@@ -406,7 +403,6 @@ void runmcmc_record( //INPUT
float *rth_ptr = thrust::raw_pointer_cast(rth_gpu.data());
float *rph_ptr = thrust::raw_pointer_cast(rph_gpu.data());
float *rf_ptr = thrust::raw_pointer_cast(rf_gpu.data());
float *rlikelihood_energy_ptr = thrust::raw_pointer_cast(rlikelihood_energy_gpu.data());
int amount_shared = (THREADS_BLOCK_MCMC+1)*sizeof(double) + (10*nfib + 2*nparams + 24)*sizeof(float) + (7*nfib + 18)*sizeof(int);
......@@ -434,7 +430,7 @@ void runmcmc_record( //INPUT
gettimeofday(&t1,NULL);
runmcmc_record_kernel<<< Dim_Grid, Dim_Block, amount_shared >>>(datam_ptr, bvals_ptr, alpha_ptr, beta_ptr, fibres_ptr, multifibres_ptr, signals_ptr, isosignals_ptr, randomsN_ptr, randomsU_ptr, ndirections, nfib, nparams, opts.modelnum.value(), opts.fudge.value(), opts.f0.value(), opts.ardf0.value(), !opts.no_ard.value(), opts.rician.value(), opts.updateproposalevery.value(), iters_step, (i*iters_step), opts.nburn.value(), opts.sampleevery.value(), totalrecords, multirecords_ptr, rf0_ptr, rtau_ptr, rs0_ptr, rd_ptr, rdstd_ptr, rth_ptr, rph_ptr, rf_ptr, rlikelihood_energy_ptr);
runmcmc_record_kernel<<< Dim_Grid, Dim_Block, amount_shared >>>(datam_ptr, bvals_ptr, alpha_ptr, beta_ptr, fibres_ptr, multifibres_ptr, signals_ptr, isosignals_ptr, randomsN_ptr, randomsU_ptr, ndirections, nfib, nparams, opts.modelnum.value(), opts.fudge.value(), opts.f0.value(), opts.ardf0.value(), !opts.no_ard.value(), opts.rician.value(), opts.updateproposalevery.value(), iters_step, (i*iters_step), opts.nburn.value(), opts.sampleevery.value(), totalrecords, rf0_ptr, rtau_ptr, rs0_ptr, rd_ptr, rdstd_ptr, rth_ptr, rph_ptr, rf_ptr);
sync_check("runmcmc_record_kernel");
gettimeofday(&t2,NULL);
......@@ -464,7 +460,7 @@ void runmcmc_record( //INPUT
gettimeofday(&t1,NULL);
if(nvox!=0){
runmcmc_record_kernel<<< Dim_Grid, Dim_Block, amount_shared >>>(datam_ptr, bvals_ptr, alpha_ptr, beta_ptr, fibres_ptr, multifibres_ptr, signals_ptr, isosignals_ptr, randomsN_ptr, randomsU_ptr, ndirections, nfib, nparams, opts.modelnum.value(), opts.fudge.value(), opts.f0.value(), opts.ardf0.value(), !opts.no_ard.value(), opts.rician.value(), opts.updateproposalevery.value(), last_step, (steps*iters_step), opts.nburn.value(), opts.sampleevery.value(), totalrecords, multirecords_ptr, rf0_ptr, rtau_ptr, rs0_ptr, rd_ptr, rdstd_ptr, rth_ptr, rph_ptr, rf_ptr, rlikelihood_energy_ptr);
runmcmc_record_kernel<<< Dim_Grid, Dim_Block, amount_shared >>>(datam_ptr, bvals_ptr, alpha_ptr, beta_ptr, fibres_ptr, multifibres_ptr, signals_ptr, isosignals_ptr, randomsN_ptr, randomsU_ptr, ndirections, nfib, nparams, opts.modelnum.value(), opts.fudge.value(), opts.f0.value(), opts.ardf0.value(), !opts.no_ard.value(), opts.rician.value(), opts.updateproposalevery.value(), last_step, (steps*iters_step), opts.nburn.value(), opts.sampleevery.value(), totalrecords,rf0_ptr, rtau_ptr, rs0_ptr, rd_ptr, rdstd_ptr, rth_ptr, rph_ptr, rf_ptr);
sync_check("runmcmc_record_kernel");
}
......
......@@ -53,7 +53,6 @@ void runmcmc_record( //INPUT
double seed,
string output_file,
//OUTPUT
thrust::device_vector<int>& multirecords_gpu,
thrust::device_vector<float>& rf0_gpu,
thrust::device_vector<float>& rtau_gpu,
thrust::device_vector<float>& rs0_gpu,
......@@ -61,5 +60,4 @@ void runmcmc_record( //INPUT
thrust::device_vector<float>& rdstd_gpu,
thrust::device_vector<float>& rth_gpu,
thrust::device_vector<float>& rph_gpu,
thrust::device_vector<float>& rf_gpu,
thrust::device_vector<float>& rlikelihood_energy_gpu);
thrust::device_vector<float>& rf_gpu);
......@@ -17,7 +17,7 @@ using namespace Xfibres;
// MCMC SAMPLE STORAGE
////////////////////////////////////////////
Samples::Samples(int nvoxels,int nmeasures):
Samples::Samples(int nvoxels,int nsamples):
opts(xfibresOptions::getInstance()){
/////////////// GPU version /////////////////////
......@@ -33,23 +33,11 @@ opts(xfibresOptions::getInstance()){
m_sum_lam=new vector<float> [nvoxels];
////////////////////////////////////////////////
//m_beenhere=m_vol2matrixkey*0;
int count=0;
int nsamples=0;
for(int i=0;i<opts.njumps.value();i++){
count++;
if(count==opts.sampleevery.value()){
count=0;nsamples++;
}
}
m_dsamples.ReSize(nsamples,nvoxels);
m_dsamples=0;
m_S0samples.ReSize(nsamples,nvoxels);
m_S0samples=0;
m_lik_energy.ReSize(nsamples,nvoxels);
m_mean_dsamples.ReSize(nvoxels);
m_mean_dsamples=0;
m_mean_S0samples.ReSize(nvoxels);
......@@ -133,7 +121,7 @@ opts(xfibresOptions::getInstance()){
}
//new version for GPU
void Samples::record(float rd,float rf0,float rtau,float rdstd,float rs0,float rlikelihood_energy, float *rth,float *rph, float *rf, int vox, int samp){
void Samples::record(float rd,float rf0,float rtau,float rdstd,float rs0,float *rth,float *rph, float *rf, int vox, int samp){
m_dsamples(samp,vox)=rd;
m_sum_d[vox-1]+=rd;
......@@ -151,7 +139,7 @@ void Samples::record(float rd,float rf0,float rtau,float rdstd,float rs0,float r
m_S0samples(samp,vox)=rs0;
m_sum_S0[vox-1]+=rs0;
m_lik_energy(samp,vox)=rlikelihood_energy;
for(int f=0;f<opts.nfibres.value();f++){
float th=rth[f];
float ph=rph[f];
......
......@@ -23,7 +23,6 @@ class Samples{
Matrix m_d_stdsamples;
Matrix m_S0samples;
Matrix m_f0samples;
Matrix m_lik_energy;
// // storing signal
// Matrix m_mean_sig;
......@@ -74,7 +73,7 @@ class Samples{
Samples(int nvoxels,int nmeasures);
void record(float rd,float rf0,float rtau,float rdstd,float rs0,float rlikelihood_energy, float *rth,float *rph, float *rf, int vox, int samp);
void record(float rd,float rf0,float rtau,float rdstd,float rs0,float *rth,float *rph, float *rf, int vox, int samp);
void finish_voxel(int vox);
......
......@@ -91,7 +91,6 @@ void prepare_data_gpu_MCMC( //INPUT
void prepare_data_gpu_MCMC_record( //INPUT
int nvox,
//OUTPUT
thrust::device_vector<int>& multirecords_gpu,
thrust::device_vector<float>& rf0_gpu,
thrust::device_vector<float>& rtau_gpu,
thrust::device_vector<float>& rs0_gpu,
......@@ -99,12 +98,10 @@ void prepare_data_gpu_MCMC_record( //INPUT
thrust::device_vector<float>& rdstd_gpu,
thrust::device_vector<float>& rth_gpu,
thrust::device_vector<float>& rph_gpu,
thrust::device_vector<float>& rf_gpu,
thrust::device_vector<float>& rlikelihood_energy_gpu);
thrust::device_vector<float>& rf_gpu);
//implemented and used in xfibres_gpu.cu
void record_finish_voxels( //INPUT
thrust::device_vector<int>& multirecords_gpu,
thrust::device_vector<float>& rf0_gpu,
thrust::device_vector<float>& rtau_gpu,
thrust::device_vector<float>& rs0_gpu,
......@@ -113,8 +110,6 @@ void record_finish_voxels( //INPUT
thrust::device_vector<float>& rth_gpu,
thrust::device_vector<float>& rph_gpu,
thrust::device_vector<float>& rf_gpu,
thrust::device_vector<float>& rlikelihood_energy_gpu,
int nvox,
int ndirections,
int idpart);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment