Skip to content

Commit

Permalink
fix bug (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
DX990307 authored Jul 5, 2024
1 parent b26ab38 commit 5d49f87
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions samples/runner/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,21 @@ func (r *Runner) defineMetrics() {
}

func (r *Runner) addKernelTimeTracer() {
r.kernelTimeCounter = tracing.NewBusyTimeTracer(
r.platform.Engine,
func(task tracing.Task) bool {
return task.What == "*driver.LaunchKernelCommand"
})
tracing.CollectTrace(r.platform.Driver, r.kernelTimeCounter)
if *unifiedGPUFlag != "" {
r.kernelTimeCounter = tracing.NewBusyTimeTracer(
r.platform.Engine,
func(task tracing.Task) bool {
return task.What == "*driver.LaunchUnifiedMultiGPUKernelCommand"
})
tracing.CollectTrace(r.platform.Driver, r.kernelTimeCounter)
} else {
r.kernelTimeCounter = tracing.NewBusyTimeTracer(
r.platform.Engine,
func(task tracing.Task) bool {
return task.What == "*driver.LaunchKernelCommand"
})
tracing.CollectTrace(r.platform.Driver, r.kernelTimeCounter)
}

for _, gpu := range r.platform.GPUs {
gpuKernelTimeCounter := tracing.NewBusyTimeTracer(
Expand Down

0 comments on commit 5d49f87

Please sign in to comment.