Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
sim_profiler.h
Go to the documentation of this file.
1
5#ifndef OAKFIELD_SIM_PROFILER_H
6#define OAKFIELD_SIM_PROFILER_H
7
8#include <stdbool.h>
9#include <stddef.h>
10#include <stdint.h>
11
12#include "field.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
27
37
48
56SimResult sim_profiler_init(SimProfiler *profiler, size_t operators);
57
64
71
78
86void sim_profiler_record_operator(SimProfiler *profiler, size_t operator_index,
87 uint64_t duration_ns);
88
97void sim_profiler_record_operator_delta(SimProfiler *profiler, size_t operator_index,
98 double delta_rms, uint64_t sample_count);
99
108
109#ifdef __cplusplus
110}
111#endif
112
113#endif /* OAKFIELD_SIM_PROFILER_H */
Multidimensional contiguous field abstraction with configurable layout.
SimResult
Return codes shared by libsimcore modules.
Definition field.h:29
SimResult sim_profiler_init(SimProfiler *profiler, size_t operators)
Initialize the profiler for operators tracked counters.
void sim_profiler_end_frame(SimProfiler *profiler)
Complete the active profiling frame.
void sim_profiler_begin_frame(SimProfiler *profiler)
Begin a new profiling frame.
void sim_profiler_record_operator(SimProfiler *profiler, size_t operator_index, uint64_t duration_ns)
Record the execution time for an operator.
void sim_profiler_record_operator_delta(SimProfiler *profiler, size_t operator_index, double delta_rms, uint64_t sample_count)
Record a delta RMS contribution for an operator.
SimResult sim_profiler_snapshot(const SimProfiler *profiler, SimProfilerSnapshot *out_snapshot)
Populate a snapshot of the most recent frame statistics.
void sim_profiler_destroy(SimProfiler *profiler)
Release resources held by the profiler.
Per-operator statistics tracked during profiling.
Definition sim_profiler.h:31
uint64_t inclusive_ns
Definition sim_profiler.h:32
uint64_t delta_sample_count
Definition sim_profiler.h:35
uint64_t invocations
Definition sim_profiler.h:33
double delta_rms_sum
Definition sim_profiler.h:34
Snapshot of accumulated frame statistics.
Definition sim_profiler.h:21
uint64_t frame_start_ns
Definition sim_profiler.h:22
uint64_t frame_end_ns
Definition sim_profiler.h:23
uint64_t total_ns
Definition sim_profiler.h:24
double average_operator_ns
Definition sim_profiler.h:25
Profiler state used by the runtime scheduler.
Definition sim_profiler.h:41
uint64_t frame_end_ns
Definition sim_profiler.h:46
size_t counter_count
Definition sim_profiler.h:43
uint64_t frame_start_ns
Definition sim_profiler.h:45
SimProfilerCounter * counters
Definition sim_profiler.h:42
bool frame_active
Definition sim_profiler.h:44