use core::future::Future;
use cubecl_common::benchmark::TimestampsResult;
use crate::{
server::{Binding, ComputeServer, CubeCount, Handle},
storage::BindingResource,
ExecutionMode,
};
use alloc::vec::Vec;
pub trait ComputeChannel<Server: ComputeServer>: Clone + core::fmt::Debug + Send + Sync {
fn read(&self, bindings: Vec<Binding>) -> impl Future<Output = Vec<Vec<u8>>> + Send;
fn get_resource(&self, binding: Binding) -> BindingResource<Server>;
fn create(&self, data: &[u8]) -> Handle;
fn empty(&self, size: usize) -> Handle;
unsafe fn execute(
&self,
kernel: Server::Kernel,
count: CubeCount,
bindings: Vec<Binding>,
mode: ExecutionMode,
);
fn flush(&self);
fn sync(&self) -> impl Future<Output = ()> + Send;
fn sync_elapsed(&self) -> impl Future<Output = TimestampsResult> + Send;
fn memory_usage(&self) -> crate::memory_management::MemoryUsage;
fn enable_timestamps(&self);
fn disable_timestamps(&self);
}