doProfile checks the corresponding profileName against query parameter and do cuda profiling for this action if name matches.
(action func(), profileName string, stream unsafe.Pointer)
| 789 | // doProfile checks the corresponding profileName against query parameter |
| 790 | // and do cuda profiling for this action if name matches. |
| 791 | func (qc *AQLQueryContext) doProfile(action func(), profileName string, stream unsafe.Pointer) { |
| 792 | if qc.Profiling == profileName { |
| 793 | // explicit waiting for cuda stream to avoid profiling previous actions. |
| 794 | cgoutils.WaitForCudaStream(stream, qc.Device) |
| 795 | utils.GetQueryLogger().Infof("Starting cuda profiler for %s", profileName) |
| 796 | cgoutils.CudaProfilerStart() |
| 797 | defer func() { |
| 798 | // explicit waiting for cuda stream to wait for completion of current action. |
| 799 | cgoutils.WaitForCudaStream(stream, qc.Device) |
| 800 | utils.GetQueryLogger().Infof("Stopping cuda profiler for %s", profileName) |
| 801 | cgoutils.CudaProfilerStop() |
| 802 | }() |
| 803 | } |
| 804 | action() |
| 805 | } |
| 806 | |
| 807 | // processBatch allocates device memory and starts async input data |
| 808 | // transferring to device memory. It then invokes previousBatchExecutor |
no test coverage detected