Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Henning Fehrmann
NVidia_AMD_Bench
Commits
5a66c9c4
Commit
5a66c9c4
authored
Jan 29, 2021
by
Henning Fehrmann
Committed by
Henning Fehrmann
Jan 29, 2021
Browse files
make fftw platform agnostic
parent
2d650dd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
fftw.c
View file @
5a66c9c4
...
...
@@ -46,10 +46,9 @@ run_test
}
// Copy data to device
hipMemcpy
(
A
,
hA
,
sizeof
(
*
hA
)
*
N
,
hipMemcpyHostToDevice
);
__ASSERT
(
__PREFIX
(
Memcpy
)(
A
,
hA
,
sizeof
(
*
hA
)
*
N
,
__PREFIX
(
MemcpyHostToDevice
)));
// Create FFT plan
__FFTW_PLAN
plan
=
NULL
;
__FFTW_PLAN
plan
;
size_t
length
=
N
;
char
mes
[
128
];
...
...
@@ -80,14 +79,16 @@ run_test
#ifdef ROC
rocfft_execute
(
plan
,
(
void
**
)
&
A
,
NULL
,
NULL
);
#elif CUDA
cufftExecC2C
(
plan
,
A
,
A
);
cufftExecC2C
(
plan
,
A
,
A
,
CUFFT_FORWARD
);
#endif
timer_stop
(
timer
);
// Wait for execution to finish
sprintf
(
mes
,
"dim: %zu
\t
Synchronize round %d."
,
N
,
r
);
timer_start
(
timer
,
mes
);
#ifdef ROC
hipDeviceSynchronize
();
#endif
timer_stop
(
timer
);
}
// Destroy plan
...
...
@@ -96,7 +97,7 @@ run_test
__DESTROY_PLAN
(
plan
);
timer_stop
(
timer
);
__ASSERT
(
__PREFIX
(
Memcpy
)(
hB
,
A
,
sizeof
(
*
A
)
*
N
,
hip
MemcpyDeviceToHost
));
__ASSERT
(
__PREFIX
(
Memcpy
)(
hB
,
A
,
sizeof
(
*
A
)
*
N
,
__PREFIX
(
MemcpyDeviceToHost
))
)
;
__ASSERT
(
__PREFIX
(
Free
)(
A
));
free
(
hA
);
...
...
@@ -111,7 +112,7 @@ main
)
{
int
rep
=
1
;
int
min_dim
=
12
;
int
min_dim
=
8
;
int
max_dim
=
28
;
int
nofftws
=
128
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment