Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
de666e30
Commit
de666e30
authored
Feb 07, 2018
by
peastman
Browse files
Fixed race condition
parent
b849c856
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
platforms/cuda/src/kernels/rmsd.cu
platforms/cuda/src/kernels/rmsd.cu
+1
-0
platforms/opencl/src/kernels/rmsd.cl
platforms/opencl/src/kernels/rmsd.cl
+1
-0
No files found.
platforms/cuda/src/kernels/rmsd.cu
View file @
de666e30
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
*/
*/
__device__
real
reduceValue
(
real
value
,
volatile
real
*
temp
)
{
__device__
real
reduceValue
(
real
value
,
volatile
real
*
temp
)
{
const
int
thread
=
threadIdx
.
x
;
const
int
thread
=
threadIdx
.
x
;
__syncthreads
();
temp
[
thread
]
=
value
;
temp
[
thread
]
=
value
;
__syncthreads
();
__syncthreads
();
for
(
uint
step
=
1
;
step
<
32
;
step
*=
2
)
{
for
(
uint
step
=
1
;
step
<
32
;
step
*=
2
)
{
...
...
platforms/opencl/src/kernels/rmsd.cl
View file @
de666e30
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
*/
*/
real
reduceValue
(
real
value,
__local
volatile
real*
temp
)
{
real
reduceValue
(
real
value,
__local
volatile
real*
temp
)
{
const
int
thread
=
get_local_id
(
0
)
;
const
int
thread
=
get_local_id
(
0
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
temp[thread]
=
value
;
temp[thread]
=
value
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
for
(
uint
step
=
1
; step < 32; step *= 2) {
for
(
uint
step
=
1
; step < 32; step *= 2) {
...
...
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