halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.91k stars 1.07k forks source link

Fix profiler to report time spent on GPU kernels again instead of on 'wait for parallel tasks'. #8453

Closed mcourteaux closed 2 weeks ago

mcourteaux commented 2 weeks ago

So instead of suspend_thread() while waiting for a GPU kernel to complete, which decrements the active thread count and sets the current func to "wait for parallel tasks", this PR now only decrements the active number of threads, such that the current function is still the Func that the kernel is actually producing. As such, you can see the time spent on that kernel, but still see that it was done by 0 threads, indicating it was the GPU that took care of it.

Also don't report the "wait for parallel tasks" if it doesn't contain any time, like for overhead.

Additional drive-by typo fix.

steven-johnson commented 2 weeks ago

We should extract the LLVM fix and land it separately

mcourteaux commented 2 weeks ago

I'll make separate PR. It's here: #8454. @steven-johnson