Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPC_Imaging
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Claudio Gheller
HPC_Imaging
Commits
f1efc03a
Commit
f1efc03a
authored
Sep 8, 2023
by
Giovanni Lacopo
Browse files
Options
Downloads
Patches
Plain Diff
cufftMP working with CUDA and OpenMP
parent
ea94cf82
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cuda_fft.cu
+101
-87
101 additions, 87 deletions
cuda_fft.cu
with
101 additions
and
87 deletions
cuda_fft.cu
+
101
−
87
View file @
f1efc03a
...
...
@@ -5,10 +5,11 @@
#include
<cuda_runtime.h>
#include
<complex.h>
#include
"cuComplex.h"
#include
"w-stacking.h"
#include
"proto.h"
#include
"errcodes.h"
#include
<time.h>
#if defined(CUFFTMP) &&
!
defined(USE_FFTW)
#if defined(CUFFTMP) && defined(USE_FFTW)
void
cuda_fft
(
int
num_w_planes
,
...
...
@@ -18,9 +19,22 @@ void cuda_fft(
int
yaxis
,
double
*
grid
,
double
*
gridss
,
int
rank
,
MPI_Comm
comm
)
{
#ifdef __CUDACC__
#if !defined __CUDACC__
int
ndevices
;
cudaGetDeviceCount
(
&
ndevices
);
cudaSetDevice
(
rank
%
ndevices
);
if
(
rank
==
0
)
{
if
(
0
==
ndevices
)
{
shutdown_wstacking
(
NO_ACCELERATORS_FOUND
,
"No accelerators found"
,
__FILE__
,
__LINE__
);
}
}
#endif
cudaError_t
mmm
;
cufftResult_t
status
;
...
...
@@ -53,8 +67,8 @@ void cuda_fft(
long
fftwindex
=
0
;
long
fftwindex2D
=
0
;
uint
fftwindex
=
0
;
uint
fftwindex2D
=
0
;
double
norm
=
1.0
/
(
double
)(
grid_size_x
*
grid_size_y
);
...
...
@@ -64,7 +78,7 @@ void cuda_fft(
for
(
int
iw
=
0
;
iw
<
num_w_planes
;
iw
++
)
{
printf
(
"select the %d w-plane to transform
\n
"
,
iw
);
//
printf("select the %d w-plane to transform\n", iw);
for
(
int
iv
=
0
;
iv
<
yaxis
;
iv
++
)
{
for
(
int
iu
=
0
;
iu
<
xaxis
;
iu
++
)
...
...
@@ -143,6 +157,6 @@ void cuda_fft(
cudaStreamDestroy
(
stream
);
cudaDeviceSynchronize
();
#endif // __CUDACC__
}
#endif
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