use cubecl_common::profile::Duration;
use crate::driver::DriverError;
pub trait EventApi: Send + Sync + 'static {
type Event: Send + Sync;
type Stream: Copy;
const BACKEND: &'static str;
fn event_create() -> Result<Self::Event, DriverError>;
fn event_destroy(event: &mut Self::Event) -> Result<(), DriverError>;
fn event_record(event: &Self::Event, stream: Self::Stream) -> Result<(), DriverError>;
fn event_wait(event: &Self::Event) -> Result<(), DriverError>;
fn event_elapsed(start: &Self::Event, end: &Self::Event) -> Result<Duration, DriverError>;
fn stream_wait_event(stream: Self::Stream, event: &Self::Event) -> Result<(), DriverError>;
fn stream_create_non_blocking() -> Result<Self::Stream, DriverError>;
fn stream_destroy(stream: Self::Stream) -> Result<(), DriverError>;
}