I have been exploring the possibilities of Halide for a couple of weeks, and to better understand what Halide is doing I would like to try and use the halide profiler. Lets say I have a Func test. (For ease of reading I left out the variable declarations and such.)
f=Func(test);
f(x,y)=some_image(x,y)*2;
If I want to run this i call f.realize(some_image.width(),some_image.height())
. Now if I understand correctly, when want to profile this I need to use the class halide_profiler_func_stats. But I cannot find any way to access this and/or another way to get the profiling data.
Until now I have been running a separate timer in my software but I want to see the capabilities of the profiler from Halide itself. How do I do this?
The usual way to use the profile is to add "-profile" to HL_TARGET or HL_JIT_TARGET, or use to build an equivalent Target object and pass it to realize. This prints out all the profiling info after each run.
You would need to worry about the stuff in HalideRuntime.h if you're compiling AOT and want to report the profiling info in some special way or inspect it with code.