Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
halide_profiler_state Struct Reference

The global state of the profiler. More...

#include <HalideRuntime.h>

Public Attributes

struct halide_mutex lock
 Guards access to the fields below.
 
struct halide_profiler_pipeline_stats * pipelines
 A linked list of stats gathered for each pipeline.
 
struct halide_thread * sampling_thread
 Retrieve remote profiler state.
 
struct halide_profiler_instance_state * instances
 The running instances of Halide pipelines.
 
void(* get_remote_profiler_state )(int *func, int *active_workers)
 If this callback is defined, the profiler asserts that there is a single live instance, and then uses it to get the current func and number of active threads insted of reading the fields in the instance.
 
int sleep_time
 The amount of time the profiler thread sleeps between samples in microseconds.
 
int shutdown
 Set to 1 when you want the profiler to wait for all running instances to finish and then stop gracefully.
 

Detailed Description

The global state of the profiler.

Definition at line 1965 of file HalideRuntime.h.

Member Data Documentation

◆ lock

struct halide_mutex halide_profiler_state::lock

Guards access to the fields below.

If not locked, the sampling profiler thread is free to modify things below (including reordering the linked list of pipeline stats).

Definition at line 1969 of file HalideRuntime.h.

◆ pipelines

struct halide_profiler_pipeline_stats* halide_profiler_state::pipelines

A linked list of stats gathered for each pipeline.

Definition at line 1972 of file HalideRuntime.h.

◆ sampling_thread

struct halide_thread* halide_profiler_state::sampling_thread

Retrieve remote profiler state.

Used so that the sampling profiler can follow along with execution that occurs elsewhere, e.g. on a DSP. If null, it reads from the int above instead. Sampling thread reference to be joined at shutdown.

Definition at line 1979 of file HalideRuntime.h.

◆ instances

struct halide_profiler_instance_state* halide_profiler_state::instances

The running instances of Halide pipelines.

Definition at line 1982 of file HalideRuntime.h.

◆ get_remote_profiler_state

void(* halide_profiler_state::get_remote_profiler_state) (int *func, int *active_workers)

If this callback is defined, the profiler asserts that there is a single live instance, and then uses it to get the current func and number of active threads insted of reading the fields in the instance.

This is used so that the profiler can follow along with execution that occurs elsewhere (e.g. on an accelerator).

Definition at line 1989 of file HalideRuntime.h.

◆ sleep_time

int halide_profiler_state::sleep_time

The amount of time the profiler thread sleeps between samples in microseconds.

Defaults to 1000. To change it call halide_profiler_get_state and mutate this field.

Definition at line 1994 of file HalideRuntime.h.

◆ shutdown

int halide_profiler_state::shutdown

Set to 1 when you want the profiler to wait for all running instances to finish and then stop gracefully.

Definition at line 1998 of file HalideRuntime.h.


The documentation for this struct was generated from the following file: