1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors
//! Dispatch macro used by the optimizer and executor to emit trace events.
//!
//! See [`test_harness::trace`][crate::test_harness::trace] for the harness that consumes the
//! events recorded here.
/// Dispatch a trace event from inside the optimizer or executor.
///
/// This macro is the only call-site interface for the trace harness. It is designed so that
/// release builds (and CodSpeed benchmark builds) compile every invocation away to nothing,
/// while debug-test builds with an active recorder route the call into
/// [`test_harness::trace`][crate::test_harness::trace].
///
/// # Gating
///
/// Each invocation expands to a `cfg`-gated branch:
///
/// - When `test` OR `_test-harness` is on, AND `codspeed` is off, the body is compiled in and
/// guarded by a runtime check for an active recorder.
/// - In all other configurations, the body is replaced with `()`.
///
/// The macro is named `trace_op` because it records *operations* (optimizer rewrites, parent
/// kernels, execution steps, builder activity) rather than array values. The events it emits
/// describe what work the optimizer/executor did, not the contents of any array.
}};
}
pub use trace_op;