pub struct ServerUtilities {
pub service: ServiceId,
pub name: &'static str,
pub properties: Arc<DeviceProperties>,
pub properties_hash: u64,
pub target_properties: Arc<TargetProperties>,
pub logger: Arc<ServerLogger>,
pub layout_policy: Box<dyn MemoryLayoutPolicy>,
pub server_comm_enabled: bool,
pub check_mode: BoundsCheckMode,
pub initialized_comms: RwLock<HashSet<CommunicationId>>,
}Expand description
Contains many different types that are useful for server implementations and compute clients.
Fields§
§service: ServiceIdThe service these utilities belong to: what the handles it allocates are stamped with, and what a client compares them against.
name: &'static strThe runtime name on this device, as logs and cache keys show it:
cuda, wgpu<spirv>.
properties: Arc<DeviceProperties>Information shared between all servers.
properties_hash: u64Stable hash of the device properties
target_properties: Arc<TargetProperties>What the target the server compiles for guarantees about its own
instructions — Runtime::target_properties
resolved once, when the device came up, rather than on every launch.
A kernel keeps a clone of this Arc so it can expand itself on the
device thread without naming a runtime, so building it per launch
would put a TargetProperties construction — and the allocations
inside it — on the hot path of every already-compiled kernel.
logger: Arc<ServerLogger>The logger based on global cubecl configs.
layout_policy: Box<dyn MemoryLayoutPolicy>How to create the allocation.
server_comm_enabled: boolWhether the server can move data to a peer server of the same runtime
directly, without a round trip through the host: the device transport
Client::has_device_transport reports. Off unless the backend turns it
on at init.
check_mode: BoundsCheckModeHow to enforce bounds checking on kernels.
initialized_comms: RwLock<HashSet<CommunicationId>>A set containing the ids for which the inter-device communication has already been initialized.
Implementations§
Source§impl ServerUtilities
impl ServerUtilities
Sourcepub fn new(
service: ServiceId,
name: &'static str,
properties: DeviceProperties,
target_properties: TargetProperties,
logger: Arc<ServerLogger>,
allocator: impl MemoryLayoutPolicy,
) -> Self
pub fn new( service: ServiceId, name: &'static str, properties: DeviceProperties, target_properties: TargetProperties, logger: Arc<ServerLogger>, allocator: impl MemoryLayoutPolicy, ) -> Self
Creates a new server utilities.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServerUtilities
impl !RefUnwindSafe for ServerUtilities
impl !UnwindSafe for ServerUtilities
impl Send for ServerUtilities
impl Sync for ServerUtilities
impl Unpin for ServerUtilities
impl UnsafeUnpin for ServerUtilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more