Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BioEM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPIBP-Hummer
BioEM
Commits
461cf12a
Commit
461cf12a
authored
Apr 19, 2014
by
David Rohr
Browse files
Options
Downloads
Patches
Plain Diff
fix double precision mode
parent
fbf4c844
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
bioem_algorithm.h
+1
-3
1 addition, 3 deletions
bioem_algorithm.h
bioem_cuda.cu
+41
-3
41 additions, 3 deletions
bioem_cuda.cu
include/defs.h
+3
-1
3 additions, 1 deletion
include/defs.h
include/param.h
+1
-1
1 addition, 1 deletion
include/param.h
param.cpp
+5
-3
5 additions, 3 deletions
param.cpp
with
51 additions
and
11 deletions
bioem_algorithm.h
+
1
−
3
View file @
461cf12a
...
...
@@ -70,7 +70,7 @@ __device__ static inline myfloat_t calc_logpro(const bioem_param_device& param,
return
(
logpro
);
}
__device__
static
inline
void
calProb
(
int
iRefMap
,
int
iOrient
,
int
iConv
,
myfloat_t
sumC
,
myfloat_t
sumsquareC
,
float
value
,
int
disx
,
int
disy
,
bioem_Probability
*
pProb
,
const
bioem_param_device
&
param
,
const
bioem_RefMap
&
RefMap
)
__device__
static
inline
void
calProb
(
int
iRefMap
,
int
iOrient
,
int
iConv
,
myfloat_t
sumC
,
myfloat_t
sumsquareC
,
my
float
_t
value
,
int
disx
,
int
disy
,
bioem_Probability
*
pProb
,
const
bioem_param_device
&
param
,
const
bioem_RefMap
&
RefMap
)
{
// ********************************************************
// *********** Calculates the BioEM probability ***********
...
...
@@ -379,8 +379,6 @@ __device__ static inline void compareRefMap(const int iRefMap, const int iOrient
}
else
#endif
// Summing & Storing total/Orientation Probabilites for each map
{
update_prob
<
-
1
>
(
logpro
,
iRefMap
,
iOrient
,
iConv
,
cent_x
,
cent_y
,
pProb
);
}
...
...
...
...
This diff is collapsed.
Click to expand it.
bioem_cuda.cu
+
41
−
3
View file @
461cf12a
...
...
@@ -19,6 +19,43 @@ using namespace std;
} \
}
static
const
char
*
cufftGetErrorStrung
(
cufftResult
error
)
{
switch
(
error
)
{
case
CUFFT_SUCCESS
:
return
"CUFFT_SUCCESS"
;
case
CUFFT_INVALID_PLAN
:
return
"CUFFT_INVALID_PLAN"
;
case
CUFFT_ALLOC_FAILED
:
return
"CUFFT_ALLOC_FAILED"
;
case
CUFFT_INVALID_TYPE
:
return
"CUFFT_INVALID_TYPE"
;
case
CUFFT_INVALID_VALUE
:
return
"CUFFT_INVALID_VALUE"
;
case
CUFFT_INTERNAL_ERROR
:
return
"CUFFT_INTERNAL_ERROR"
;
case
CUFFT_EXEC_FAILED
:
return
"CUFFT_EXEC_FAILED"
;
case
CUFFT_SETUP_FAILED
:
return
"CUFFT_SETUP_FAILED"
;
case
CUFFT_INVALID_SIZE
:
return
"CUFFT_INVALID_SIZE"
;
case
CUFFT_UNALIGNED_DATA
:
return
"CUFFT_UNALIGNED_DATA"
;
}
return
"UNKNOWN"
;
}
bioem_cuda
::
bioem_cuda
()
{
deviceInitialized
=
0
;
...
...
@@ -127,9 +164,10 @@ int bioem_cuda::compareRefMaps(int iProjectionOut, int iConv, const myfloat_t* c
{
const
int
num
=
min
(
CUDA_FFTS_AT_ONCE
,
maxRef
-
i
);
multComplexMap
<<<
num
,
CUDA_THREAD_COUNT
,
0
,
cudaStream
>>>
(
&
pConvMapFFT
[(
iConv
&
1
)
*
param
.
FFTMapSize
],
pRefMapsFFT
,
pFFTtmp2
,
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberFFTPixels1D
,
param
.
FFTMapSize
,
num
,
i
);
if
(
mycufftExecC2R
(
i
+
CUDA_FFTS_AT_ONCE
>
maxRef
?
plan
[
1
]
:
plan
[
0
],
pFFTtmp2
,
pFFTtmp
)
!=
CUFFT_SUCCESS
)
cufftResult
err
=
mycufftExecC2R
(
i
+
CUDA_FFTS_AT_ONCE
>
maxRef
?
plan
[
1
]
:
plan
[
0
],
pFFTtmp2
,
pFFTtmp
);
if
(
err
!=
CUFFT_SUCCESS
)
{
cout
<<
"Error running CUFFT
\n
"
;
cout
<<
"Error running CUFFT
"
<<
cufftGetErrorStrung
(
err
)
<<
"
\n
"
;
exit
(
1
);
}
cuDoRefMapsFFT
<<<
divup
(
num
,
CUDA_THREAD_COUNT
),
CUDA_THREAD_COUNT
,
0
,
cudaStream
>>>
(
iProjectionOut
,
iConv
,
pFFTtmp
,
sumC
,
sumsquareC
,
pProb_device
,
param
.
param_device
,
*
gpumap
,
num
,
i
);
...
...
@@ -301,7 +339,7 @@ int bioem_cuda::deviceStartRun()
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
int
n
[
2
]
=
{
param
.
param_device
.
NumberPixels
,
param
.
param_device
.
NumberPixels
};
if
(
cufftPlanMany
(
&
plan
[
i
],
2
,
n
,
NULL
,
1
,
0
,
NULL
,
1
,
0
,
CUFFT_C2R
,
i
?
(
maxRef
%
CUDA_FFTS_AT_ONCE
)
:
CUDA_FFTS_AT_ONCE
)
!=
CUFFT_SUCCESS
)
if
(
cufftPlanMany
(
&
plan
[
i
],
2
,
n
,
NULL
,
1
,
0
,
NULL
,
1
,
0
,
MY_
CUFFT_C2R
,
i
?
(
maxRef
%
CUDA_FFTS_AT_ONCE
)
:
CUDA_FFTS_AT_ONCE
)
!=
CUFFT_SUCCESS
)
{
cout
<<
"Error planning CUFFT
\n
"
;
exit
(
1
);
...
...
...
...
This diff is collapsed.
Click to expand it.
include/defs.h
+
3
−
1
View file @
461cf12a
#ifndef BIOEM_DEFS_H
#define BIOEM_DEFS_H
//
#define BIOEM_USE_DOUBLE
#define BIOEM_USE_DOUBLE
#ifndef BIOEM_USE_DOUBLE
typedef
float
myfloat_t
;
...
...
@@ -16,6 +16,7 @@ typedef float myfloat_t;
#define myfftw_plan_dft_r2c_2d fftwf_plan_dft_r2c_2d
#define myfftw_plan_dft_c2r_2d fftwf_plan_dft_c2r_2d
#define myfftw_plan fftwf_plan
#define MY_CUFFT_C2R CUFFT_C2R
#define mycufftExecC2R cufftExecC2R
#define mycuComplex_t cuComplex
#else
...
...
@@ -33,6 +34,7 @@ typedef double myfloat_t;
#define myfftw_plan fftw_plan
#define mycufftExecC2R cufftExecZ2D
#define mycuComplex_t cuDoubleComplex
#define MY_CUFFT_C2R CUFFT_Z2D
#endif
typedef
myfloat_t
mycomplex_t
[
2
];
...
...
...
...
This diff is collapsed.
Click to expand it.
include/param.h
+
1
−
1
View file @
461cf12a
...
...
@@ -64,7 +64,7 @@ public:
myfloat_t
gridCTF_amp
;
// Others
//myfloat_t volu;//in device class
myfloat3_t
angles
[
MAX_ORIENT
]
;
myfloat3_t
*
angles
;
int
nTotGridAngles
;
int
nTotCTFs
;
//myfloat_t Ntotpi;//in device class
...
...
...
...
This diff is collapsed.
Click to expand it.
param.cpp
+
5
−
3
View file @
461cf12a
...
...
@@ -33,6 +33,7 @@ bioem_param::bioem_param()
refCTF
=
NULL
;
CtfParam
=
NULL
;
angles
=
NULL
;
}
int
bioem_param
::
readParameters
()
...
...
@@ -235,6 +236,7 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
cos_grid_beta
=
2.f
/
(
myfloat_t
)
angleGridPointsBeta
;
// Euler Angle Array
angles
=
new
myfloat3_t
[
angleGridPointsAlpha
*
angleGridPointsBeta
*
angleGridPointsAlpha
];
for
(
int
ialpha
=
0
;
ialpha
<
angleGridPointsAlpha
;
ialpha
++
)
{
for
(
int
ibeta
=
0
;
ibeta
<
angleGridPointsBeta
;
ibeta
++
)
...
...
@@ -344,7 +346,6 @@ int bioem_param::CalculateRefCTF()
return
(
0
);
}
bioem_param
::~
bioem_param
()
{
releaseFFTPlans
();
...
...
@@ -356,6 +357,7 @@ bioem_param::~bioem_param()
numberGridPointsCTF_phase
=
0
;
param_device
.
maxDisplaceCenter
=
0
;
numberGridPointsDisplaceCenter
=
0
;
delete
[]
refCTF
;
delete
[]
CtfParam
;
if
(
refCTF
)
delete
[]
refCTF
;
if
(
CtfParam
)
delete
[]
CtfParam
;
if
(
angles
)
delete
[]
angles
;
}
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
sign in
to comment