These are chat archives for halide/Halide

11th
Nov 2018
Nikita Glukhov
@ghost-luck
Nov 11 12:37
Hi, guys! I still can't figure it out how to profile generators. In my case profiling works only in a jit-compile scenario. If I manually run:
%name% -g %name% -f %name% -x .s=.s.txt,.cpp=.generated.cpp target=host-profile-no_runtime auto_schedule=false
then as a result halide_profiler_set_current_func() and others are inside generated lib, but nothing happens at program run stage. If I trying adding target=profile to the generator which creates halide_rt_host.lib too, this will lead to linking errors.
Nikita Glukhov
@ghost-luck
Nov 11 13:28

I was able to finally find a solution by myself. I removed no_runtime from the generator line. And added the following code to the application:

  static void *const user_context = nullptr;
  halide_profiler_report(user_context);

If this is a standard solution, then maybe it's worth adding this to tutorials.