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
904a9c10
Commit
904a9c10
authored
Sep 08, 2014
by
peastman
Browse files
Fixed bug in CustomManyParticleForce that caused crash
parent
d8be3efd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+4
-0
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+4
-0
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
904a9c10
...
@@ -5024,6 +5024,10 @@ double CudaCalcCustomManyParticleForceKernel::execute(ContextImpl& context, bool
...
@@ -5024,6 +5024,10 @@ double CudaCalcCustomManyParticleForceKernel::execute(ContextImpl& context, bool
maxNeighborPairs
=
(
int
)
(
1.1
*
(
*
numPairs
));
maxNeighborPairs
=
(
int
)
(
1.1
*
(
*
numPairs
));
neighborPairs
=
CudaArray
::
create
<
int2
>
(
cu
,
maxNeighborPairs
,
"customManyParticleNeighborPairs"
);
neighborPairs
=
CudaArray
::
create
<
int2
>
(
cu
,
maxNeighborPairs
,
"customManyParticleNeighborPairs"
);
neighbors
=
CudaArray
::
create
<
int
>
(
cu
,
maxNeighborPairs
,
"customManyParticleNeighbors"
);
neighbors
=
CudaArray
::
create
<
int
>
(
cu
,
maxNeighborPairs
,
"customManyParticleNeighbors"
);
forceArgs
[
5
]
=
&
neighbors
->
getDevicePointer
();
neighborsArgs
[
5
]
=
&
neighborPairs
->
getDevicePointer
();
copyPairsArgs
[
0
]
=
&
neighborPairs
->
getDevicePointer
();
copyPairsArgs
[
1
]
=
&
neighbors
->
getDevicePointer
();
continue
;
continue
;
}
}
}
}
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
904a9c10
...
@@ -5190,6 +5190,10 @@ double OpenCLCalcCustomManyParticleForceKernel::execute(ContextImpl& context, bo
...
@@ -5190,6 +5190,10 @@ double OpenCLCalcCustomManyParticleForceKernel::execute(ContextImpl& context, bo
maxNeighborPairs
=
(
int
)
(
1.1
*
(
*
numPairs
));
maxNeighborPairs
=
(
int
)
(
1.1
*
(
*
numPairs
));
neighborPairs
=
OpenCLArray
::
create
<
mm_int2
>
(
cl
,
maxNeighborPairs
,
"customManyParticleNeighborPairs"
);
neighborPairs
=
OpenCLArray
::
create
<
mm_int2
>
(
cl
,
maxNeighborPairs
,
"customManyParticleNeighborPairs"
);
neighbors
=
OpenCLArray
::
create
<
int
>
(
cl
,
maxNeighborPairs
,
"customManyParticleNeighbors"
);
neighbors
=
OpenCLArray
::
create
<
int
>
(
cl
,
maxNeighborPairs
,
"customManyParticleNeighbors"
);
forceKernel
.
setArg
<
cl
::
Buffer
>
(
5
,
neighbors
->
getDeviceBuffer
());
neighborsKernel
.
setArg
<
cl
::
Buffer
>
(
5
,
neighborPairs
->
getDeviceBuffer
());
copyPairsKernel
.
setArg
<
cl
::
Buffer
>
(
0
,
neighborPairs
->
getDeviceBuffer
());
copyPairsKernel
.
setArg
<
cl
::
Buffer
>
(
1
,
neighbors
->
getDeviceBuffer
());
continue
;
continue
;
}
}
}
}
...
...
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