Remove GPU timing functions superseded by GpuRegionTimer
authorAleksei Iupinov <a.yupinov@gmail.com>
Thu, 28 Sep 2017 13:22:55 +0000 (15:22 +0200)
committerAleksei Iupinov <a.yupinov@gmail.com>
Wed, 4 Oct 2017 09:21:59 +0000 (11:21 +0200)
Change-Id: I451fdd9263e87a567c8b4942a041de6950c75921

src/gromacs/gpu_utils/cudautils.cu
src/gromacs/gpu_utils/cudautils.cuh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp

index 36ee46f4e8098d1c38cc9431a9da9be1a373ebaa..4f7cff946f1d58c6e7471028005dcdc3b389fe39 100644 (file)
@@ -128,46 +128,6 @@ int cu_copy_H2D_async(void * d_dest, void * h_src, size_t bytes, cudaStream_t s
     return cu_copy_H2D_generic(d_dest, h_src, bytes, true, s);
 }
 
-float cu_event_elapsed(cudaEvent_t start, cudaEvent_t end)
-{
-    float       t = 0.0;
-    cudaError_t stat;
-
-    stat = cudaEventElapsedTime(&t, start, end);
-    CU_RET_ERR(stat, "cudaEventElapsedTime failed in cu_event_elapsed");
-
-    return t;
-}
-
-int cu_wait_event(cudaEvent_t e)
-{
-    cudaError_t s;
-
-    s = cudaEventSynchronize(e);
-    CU_RET_ERR(s, "cudaEventSynchronize failed in cu_wait_event");
-
-    return 0;
-}
-
-/*!
- *  If time != NULL it also calculates the time elapsed between start and end and
- *  return this is milliseconds.
- */
-int cu_wait_event_time(cudaEvent_t end, cudaEvent_t start, float *time)
-{
-    cudaError_t s;
-
-    s = cudaEventSynchronize(end);
-    CU_RET_ERR(s, "cudaEventSynchronize failed in cu_wait_event");
-
-    if (time)
-    {
-        *time = cu_event_elapsed(start, end);
-    }
-
-    return 0;
-}
-
 /**** Operation on buffered arrays (arrays with "over-allocation" in gmx wording) *****/
 
 /*!
index 43b40a93fcd09af7c10bdcd3000be644fe48a93b..3402d20a4aeeb5a1893959119c0a69c7f7795325 100644 (file)
@@ -156,15 +156,6 @@ void cu_realloc_buffered(void **d_dest, void *h_src,
                          cudaStream_t s,
                          bool bAsync);
 
-/*! Waits for event e to complete, */
-int cu_wait_event(cudaEvent_t /*e*/);
-
-/*! Calculates and returns the time elapsed between event start and end. */
-float cu_event_elapsed(cudaEvent_t /*start*/, cudaEvent_t /*end*/);
-
-/*! Waits for event end to complete and calculates the time between start and end. */
-int cu_wait_event_time(cudaEvent_t /*end*/, cudaEvent_t /*begin*/, float * /*time*/);
-
 // TODO: the 2 functions below are pretty much a constructor/destructor of a simple
 // GPU table object. We just need to add a templated __device__ table data fetching to complete it.
 
index 813e0bdcfb124685ff80e6ee8f40f19118dfcb8b..2e1102cef1687302058e2d247733367e86f9f5bf 100644 (file)
@@ -369,44 +369,6 @@ static void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
     *ocl_event = 0;
 }
 
-/*! \brief Returns the duration in milliseconds for the command associated with the event.
- *
- * It then releases the event and sets it to 0.
- * Before calling this function, make sure the command has finished either by
- * calling clFinish or clWaitForEvents.
- * The function returns 0.0 if the input event, *ocl_event, is 0.
- * Don't use this function when more than one wait will be issued for the event.
- * \todo This function, as well as some CUDA counterparts, is superseded by GpuRegionTimer.
- * Delete.
- */
-static inline double ocl_event_elapsed_ms(cl_event *ocl_event)
-{
-    cl_int gmx_unused cl_error;
-    cl_ulong          start_ns, end_ns;
-    double            elapsed_ms;
-
-    elapsed_ms = 0.0;
-    assert(NULL != ocl_event);
-
-    if (*ocl_event)
-    {
-        cl_error = clGetEventProfilingInfo(*ocl_event, CL_PROFILING_COMMAND_START,
-                                           sizeof(cl_ulong), &start_ns, NULL);
-        assert(CL_SUCCESS == cl_error);
-
-        cl_error = clGetEventProfilingInfo(*ocl_event, CL_PROFILING_COMMAND_END,
-                                           sizeof(cl_ulong), &end_ns, NULL);
-        assert(CL_SUCCESS == cl_error);
-
-        clReleaseEvent(*ocl_event);
-        *ocl_event = 0;
-
-        elapsed_ms = (end_ns - start_ns) / 1000000.0;
-    }
-
-    return elapsed_ms;
-}
-
 /*! \brief Launch GPU kernel
 
    As we execute nonbonded workload in separate queues, before launching