Using the PIPE_CONTROL to implement get time stamp in gen backend
authorJunyan He <junyan.he@linux.intel.com>
Fri, 18 Oct 2013 02:19:51 +0000 (10:19 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 18 Oct 2013 02:57:35 +0000 (10:57 +0800)
commit2e3563456907193e042f9122c3ee33013dd2a9b1
tree055e4b1b57f3e914fdd22a8687df4c54f138d4f2
parent8e054547c78ba37a87ef0b43457a777c87879431
Using the PIPE_CONTROL to implement get time stamp in gen backend

We use PIPE_CONTROL to get the time stamps from GPU just after batch
start and before batch flush. Using the first one the caculate the
CL_PROFILING_COMMAND_START time and uing the second one to caculate
the CL_PROFILING_COMMAND_END time.
There are 2 limitations here:
1. Then end time stamp is just before the FLUSH, so the Flush time
   is not included, which will cause to lose the accuracy. Because
   the we do not know which event will be used to do the profling
   when it is created, adding another flush for end time stamp may
   add some overload.
2. The time of CPU and GPU can not be sync correctly now. So the
   time of CL_PROFILING_COMMAND_QUEUED and CL_PROFILING_COMMAND_SUBMIT
   which happens on CPU side can not be caculated correctly with the
   same base time of GPU. So we just simplely set them to
   CL_PROFILING_COMMAND_START now. For the Event not involving GPU
   operations such as ReadBuffer, all the times are 0 now.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
src/cl_command_queue_gen7.c
src/cl_driver.h
src/cl_driver_defs.c
src/cl_event.c
src/cl_event.h
src/intel/intel_defines.h
src/intel/intel_gpgpu.c