← Back

Module lib

fn init() -> Result<(), GpuError>

Source: gpu/lib.joule:28

fn list_devices() -> Vec<GpuDevice>

Source: gpu/lib.joule:43

fn default_device() -> Option<GpuDevice>

Source: gpu/lib.joule:60

fn most_efficient_device() -> Option<GpuDevice>

Source: gpu/lib.joule:74

struct GpuEnergyResult

Source: gpu/lib.joule:103

fn launch(

Source: gpu/lib.joule:136

fn launch_on_queue(

Source: gpu/lib.joule:180

struct GpuEnergyMonitor

Continuous GPU energy monitor that samples power in the background. Start the monitor before a sequence of GPU operations, then stop it to get an aggregate energy report covering the entire span.

Source: gpu/lib.joule:225

fn start(device: &GpuDevice, interval: std::time::Duration) -> Self

Source: gpu/lib.joule:243

fn stop(&mut self) -> GpuEnergyReport

Stop monitoring and return an aggregate energy report.

Source: gpu/lib.joule:273

fn drop(&mut self)

Source: gpu/lib.joule:330

struct GpuEnergyReport

Source: gpu/lib.joule:340

fn estimated_co2_kg(&self, carbon_intensity_kg_per_kwh: f64) -> f64

Estimated CO2 emissions in kilograms. Uses the given carbon intensity (kg CO2 / kWh). Global average is ~0.5.

Source: gpu/lib.joule:358

fn print(&self)

Print a human-readable summary.

Source: gpu/lib.joule:364

fn sample_device_power(kernel: &GpuKernel) -> Option<f64>

Sample power from the device using backend-specific management APIs. Returns watts if available.

Source: gpu/lib.joule:385

fn read_device_power(device: &GpuDevice) -> Option<f64>

Read power from a device handle using the appropriate management library.

Source: gpu/lib.joule:391

fn estimate_idle_power(device: &GpuDevice) -> f64

Estimate idle power for a device based on its backend and capabilities.

Source: gpu/lib.joule:415

fn compute_energy(

Compute energy from timing and optional power readings. Returns (energy_joules, avg_power_watts, peak_power_watts).

Source: gpu/lib.joule:426

enum GpuError

Source: gpu/lib.joule:463

fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result

Source: gpu/lib.joule:489

fn launch_with_budget(

Source: gpu/lib.joule:524

fn device_power_profile(device: &GpuDevice) -> (f64, f64, f64)

Convenience: get a device's backend-specific energy cost model parameters. Returns (estimated_idle_watts, estimated_active_watts, estimated_peak_watts).

Source: gpu/lib.joule:551