cubecl_runtime/config/
profiling.rs

1use super::logger::{LogLevel, LoggerConfig};
2
3/// Configuration for profiling settings in CubeCL.
4#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
5pub struct ProfilingConfig {
6    /// Logger configuration for profiling logs, using profiling-specific log levels.
7    #[serde(default)]
8    pub logger: LoggerConfig<ProfilingLogLevel>,
9}
10
11/// Log levels for profiling in CubeCL.
12#[derive(Default, Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
13pub enum ProfilingLogLevel {
14    /// Profiling logging is disabled.
15    #[default]
16    #[serde(rename = "disabled")]
17    Disabled,
18
19    /// Only the kernels that run are logged without timing.
20    #[serde(rename = "minimal")]
21    Minimal,
22
23    /// Basic profiling information is logged.
24    #[serde(rename = "basic")]
25    Basic,
26
27    /// Medium level of profiling details is logged.
28    #[serde(rename = "medium")]
29    Medium,
30
31    /// Full profiling details are logged.
32    #[serde(rename = "full")]
33    Full,
34}
35
36impl LogLevel for ProfilingLogLevel {}