Loading...
Searching...
No Matches
Profiling.h
Go to the documentation of this file.
#ifndef HALIDE_PROFILING_H
#define HALIDE_PROFILING_H
/** \file
* Defines the lowering pass that injects print statements when profiling is turned on.
* The profiler will print out per-pipeline and per-func stats, such as total time
* spent and heap/stack allocation information. To turn on the profiler, set
* HL_TARGET/HL_JIT_TARGET flags to 'host-profile'.
*
* Output format:
* <pipeline_name>
* <total time spent in this pipeline> <# of samples taken> <# of runs> <avg time/run>
* <# of heap allocations> <peak heap allocation>
* <func_name> <total time spent in this func> <percentage of time spent>
* (<peak heap alloc by this func> <num of allocs> <average alloc size> |
* <worst-case peak stack alloc by this func>)?
*
* Sample output:
* memory_profiler_mandelbrot
* total time: 59.832336 ms samples: 43 runs: 1000 time/run: 0.059832 ms
* heap allocations: 104000 peak heap usage: 505344 bytes
* f0: 0.025673ms (42%)
* mandelbrot: 0.006444ms (10%) peak: 505344 num: 104000 avg: 5376
* argmin: 0.027715ms (46%) stack: 20
*/
#include <map>
#include <string>
#include "Expr.h"
namespace Halide {
namespace Internal {
class Function;
/** Take a statement representing a halide pipeline insert
* high-resolution timing into the generated code (via spawning a
* thread that acts as a sampling profiler); summaries of execution
* times and counts will be logged at the end. Should be done before
* storage flattening, but after all bounds inference.
*
*/
Stmt inject_profiling(const Stmt &, const std::string &, const std::map<std::string, Function> &env);
} // namespace Internal
} // namespace Halide
#endif
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt).
Halide::Internal::Function
A reference-counted handle to Halide's internal representation of a function.
Definition Function.h:39
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::inject_profiling
Stmt inject_profiling(const Stmt &, const std::string &, const std::map< std::string, Function > &env)
Take a statement representing a halide pipeline insert high-resolution timing into the generated code...
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427