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
61527786
Commit
61527786
authored
Aug 04, 2015
by
peastman
Browse files
Merge pull request #1073 from peastman/memleak
Fixed a memory leak in OpenCL platform on Nvidia GPUs
parents
7dc0a154
7177e2ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+5
-4
No files found.
platforms/opencl/src/OpenCLKernels.cpp
View file @
61527786
...
@@ -1436,10 +1436,11 @@ private:
...
@@ -1436,10 +1436,11 @@ private:
class
OpenCLCalcNonbondedForceKernel
::
SyncQueuePreComputation
:
public
OpenCLContext
::
ForcePreComputation
{
class
OpenCLCalcNonbondedForceKernel
::
SyncQueuePreComputation
:
public
OpenCLContext
::
ForcePreComputation
{
public:
public:
SyncQueuePreComputation(OpenCLContext& cl, cl::CommandQueue queue, int forceGroup) : cl(cl), queue(queue),
events(1),
forceGroup(forceGroup) {
SyncQueuePreComputation
(
OpenCLContext
&
cl
,
cl
::
CommandQueue
queue
,
int
forceGroup
)
:
cl
(
cl
),
queue
(
queue
),
forceGroup
(
forceGroup
)
{
}
}
void
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
void
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
forceGroup
))
!=
0
)
{
if
((
groups
&
(
1
<<
forceGroup
))
!=
0
)
{
vector
<
cl
::
Event
>
events
(
1
);
cl
.
getQueue
().
enqueueMarker
(
&
events
[
0
]);
cl
.
getQueue
().
enqueueMarker
(
&
events
[
0
]);
queue
.
enqueueWaitForEvents
(
events
);
queue
.
enqueueWaitForEvents
(
events
);
}
}
...
@@ -1447,17 +1448,18 @@ public:
...
@@ -1447,17 +1448,18 @@ public:
private:
private:
OpenCLContext
&
cl
;
OpenCLContext
&
cl
;
cl
::
CommandQueue
queue
;
cl
::
CommandQueue
queue
;
vector<cl::Event> events;
int
forceGroup
;
int
forceGroup
;
};
};
class
OpenCLCalcNonbondedForceKernel
::
SyncQueuePostComputation
:
public
OpenCLContext
::
ForcePostComputation
{
class
OpenCLCalcNonbondedForceKernel
::
SyncQueuePostComputation
:
public
OpenCLContext
::
ForcePostComputation
{
public:
public:
SyncQueuePostComputation(OpenCLContext& cl, cl::Event& event, int forceGroup) : cl(cl), event(event),
events(1),
forceGroup(forceGroup) {
SyncQueuePostComputation
(
OpenCLContext
&
cl
,
cl
::
Event
&
event
,
int
forceGroup
)
:
cl
(
cl
),
event
(
event
),
forceGroup
(
forceGroup
)
{
}
}
double
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
double
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
{
if
((
groups
&
(
1
<<
forceGroup
))
!=
0
)
{
if
((
groups
&
(
1
<<
forceGroup
))
!=
0
)
{
vector
<
cl
::
Event
>
events
(
1
);
events
[
0
]
=
event
;
events
[
0
]
=
event
;
event
=
cl
::
Event
();
cl
.
getQueue
().
enqueueWaitForEvents
(
events
);
cl
.
getQueue
().
enqueueWaitForEvents
(
events
);
}
}
return
0.0
;
return
0.0
;
...
@@ -1465,7 +1467,6 @@ public:
...
@@ -1465,7 +1467,6 @@ public:
private:
private:
OpenCLContext
&
cl
;
OpenCLContext
&
cl
;
cl
::
Event
&
event
;
cl
::
Event
&
event
;
vector<cl::Event> events;
int
forceGroup
;
int
forceGroup
;
};
};
...
...
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