-
Hi all - I've managed to build my algorithm's generator & runner *.cpp sources with a "debug" configuration: using -O0, -g3 clang++ flags. However, when I step into the generator's function call, all I see is native assembly. Thanks, Charles. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, Halide isn't an imperative language, so there's no good correspondence between the lines of code that define your Funcs and the steps taken at runtime. Something that might achieve your aims is the -trace_all Halide target flag, which will print out everything Halide does. If you're getting a crash, the -debug target flag is also useful for verifying your input and output buffers are what you expect. Another option is to compile Halide to c++ with -e c_source, compile and link against that, and single-step through that code instead. Compiling Halide to C++ typically produces code with worse performance than compiling Halide directly to an object file, so I'd only use it for debugging. |
Beta Was this translation helpful? Give feedback.
No, Halide isn't an imperative language, so there's no good correspondence between the lines of code that define your Funcs and the steps taken at runtime. Something that might achieve your aims is the -trace_all Halide target flag, which will print out everything Halide does. If you're getting a crash, the -debug target flag is also useful for verifying your input and output buffers are what you expect.
Another option is to compile Halide to c++ with -e c_source, compile and link against that, and single-step through that code instead. Compiling Halide to C++ typically produces code with worse performance than compiling Halide directly to an object file, so I'd only use it for debugging.