use crate::{
server::{Binding, ComputeServer, Handle},
storage::ComputeStorage,
};
use alloc::vec::Vec;
use cubecl_common::{reader::Reader, sync_type::SyncType};
pub trait ComputeChannel<Server: ComputeServer>: Clone + core::fmt::Debug + Send + Sync {
fn read(&self, binding: Binding<Server>) -> Reader;
fn get_resource(
&self,
binding: Binding<Server>,
) -> <Server::Storage as ComputeStorage>::Resource;
fn create(&self, data: &[u8]) -> Handle<Server>;
fn empty(&self, size: usize) -> Handle<Server>;
fn execute(
&self,
kernel: Server::Kernel,
count: Server::DispatchOptions,
bindings: Vec<Binding<Server>>,
);
fn sync(&self, sync_type: SyncType);
}