Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
pi
Commits
efbf078d
Commit
efbf078d
authored
Feb 10, 2020
by
Neil Gershenfeld
Browse files
wip
parent
e300c310
Pipeline
#4937
passed with stage
in 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Python/numbapig.py
View file @
efbf078d
...
...
@@ -112,4 +112,17 @@ mflops = NPTS*5.0/(1.0e6*(end_time-start_time))
print
(
"both with CUDA kernel reduction:"
)
print
(
" NPTS = %d, pi = %f"
%
(
NPTS
,
pi
[
0
]))
print
(
" time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
))
#
# both with CUDA kernel reduction and transfer
#
start_time
=
time
.
time
()
init
[
grid_size
,
block_size
](
arr
)
CUDA_reduce
(
arr
,
NPTS
)
CUDA_result
(
arr
,
result
)
pi
=
result
.
copy_to_host
()
end_time
=
time
.
time
()
mflops
=
NPTS
*
5.0
/
(
1.0e6
*
(
end_time
-
start_time
))
print
(
"both with CUDA kernel reduction and transfer:"
)
print
(
" NPTS = %d, pi = %f"
%
(
NPTS
,
pi
[
0
]))
print
(
" time = %f, estimated MFlops = %f"
%
(
end_time
-
start_time
,
mflops
))
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment