Skip to content
Snippets Groups Projects
Unverified Commit 2732b8b6 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #1007 from rbberger/fix_memleak_in_gpu_package

Fixes a memory leak when using OpenCL
parents 36081f9f 2eb8d779
No related branches found
No related tags found
No related merge requests found
...@@ -49,8 +49,6 @@ class UCL_Timer { ...@@ -49,8 +49,6 @@ class UCL_Timer {
inline void clear() { inline void clear() {
if (_initialized) { if (_initialized) {
CL_DESTRUCT_CALL(clReleaseCommandQueue(_cq)); CL_DESTRUCT_CALL(clReleaseCommandQueue(_cq));
clReleaseEvent(start_event);
clReleaseEvent(stop_event);
_initialized=false; _initialized=false;
_total_time=0.0; _total_time=0.0;
} }
...@@ -107,6 +105,8 @@ class UCL_Timer { ...@@ -107,6 +105,8 @@ class UCL_Timer {
CL_SAFE_CALL(clGetEventProfilingInfo(start_event, CL_SAFE_CALL(clGetEventProfilingInfo(start_event,
CL_PROFILING_COMMAND_END, CL_PROFILING_COMMAND_END,
sizeof(cl_ulong), &tstart, NULL)); sizeof(cl_ulong), &tstart, NULL));
clReleaseEvent(start_event);
clReleaseEvent(stop_event);
return (tend-tstart)*t_factor; return (tend-tstart)*t_factor;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment