Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fdt
Commits
87b058d4
Commit
87b058d4
authored
11 years ago
by
Moises Fernandez
Browse files
Options
Downloads
Patches
Plain Diff
Delete unnecessary params in Samples Record-Save
parent
37080b64
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CUDA/runmcmc.cu
+3
-7
3 additions, 7 deletions
CUDA/runmcmc.cu
CUDA/runmcmc.h
+1
-3
1 addition, 3 deletions
CUDA/runmcmc.h
CUDA/samples.cu
+4
-16
4 additions, 16 deletions
CUDA/samples.cu
CUDA/samples.h
+1
-2
1 addition, 2 deletions
CUDA/samples.h
CUDA/xfibres_gpu.cuh
+1
-6
1 addition, 6 deletions
CUDA/xfibres_gpu.cuh
with
10 additions
and
34 deletions
CUDA/runmcmc.cu
+
3
−
7
View file @
87b058d4
...
...
@@ -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"
);
}
...
...
This diff is collapsed.
Click to expand it.
CUDA/runmcmc.h
+
1
−
3
View file @
87b058d4
...
...
@@ -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
);
This diff is collapsed.
Click to expand it.
CUDA/samples.cu
+
4
−
16
View file @
87b058d4
...
...
@@ -17,7 +17,7 @@ using namespace Xfibres;
// MCMC SAMPLE STORAGE
////////////////////////////////////////////
Samples
::
Samples
(
int
nvoxels
,
int
n
measur
es
)
:
Samples
::
Samples
(
int
nvoxels
,
int
n
sampl
es
)
:
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
];
...
...
This diff is collapsed.
Click to expand it.
CUDA/samples.h
+
1
−
2
View file @
87b058d4
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
CUDA/xfibres_gpu.cuh
+
1
−
6
View file @
87b058d4
...
...
@@ -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
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment