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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -49,8 +49,6 @@ class UCL_Timer {
  inline void clear() {
    if (_initialized) {
      CL_DESTRUCT_CALL(clReleaseCommandQueue(_cq));
      clReleaseEvent(start_event);
      clReleaseEvent(stop_event);
      _initialized=false;
      _total_time=0.0;
    }
@@ -107,6 +105,8 @@ class UCL_Timer {
    CL_SAFE_CALL(clGetEventProfilingInfo(start_event,
                                         CL_PROFILING_COMMAND_END,
                                         sizeof(cl_ulong), &tstart, NULL));
    clReleaseEvent(start_event);
    clReleaseEvent(stop_event);
    return (tend-tstart)*t_factor;
  }