pub enum BufferIOAttr {
ReadOnly,
WriteOnly,
ReadWrite,
Dead,
}Expand description
What a compiled kernel does with each buffer binding, by buffer position.
The IR owns this concept — the visibility analysis stamps it on the entry
function’s arguments — so the launch path reads that enum rather than a
copy of it that could drift. Re-exported here because a backend reaching
for it is holding a CompiledKernel (in cubecl-server), not an IR
context.
What a compiled kernel does with one buffer binding, stamped on the entry
function’s arguments by the visibility analysis and carried to the launch
site, where the write scope stages exactly what the kernel writes and
checks exactly what it reads.
Four states because the launch path asks two independent questions. Writable decides what a failure taints; readable decides what is checked before launching. An aliased or accumulating argument answers yes to both, a pure output answers only the first — which is what lets a relaunch repair a tainted buffer — and a buffer the kernel never touches answers neither.
Variants§
ReadOnly
Read, never written: checked before launch, never claimed by a failure.
WriteOnly
Written, never read: claimed by a failure, never checked.
ReadWrite
Both — the aliased and accumulator cases included.
Dead
Neither: no check on the way in, no claim on the way out.
Implementations§
Source§impl BufferIOAttr
impl BufferIOAttr
Sourcepub fn new_read_only() -> BufferIOAttr
pub fn new_read_only() -> BufferIOAttr
Constructs a new BufferIOAttr::ReadOnly.
Source§impl BufferIOAttr
impl BufferIOAttr
Sourcepub fn new_write_only() -> BufferIOAttr
pub fn new_write_only() -> BufferIOAttr
Constructs a new BufferIOAttr::WriteOnly.
Source§impl BufferIOAttr
impl BufferIOAttr
Sourcepub fn new_read_write() -> BufferIOAttr
pub fn new_read_write() -> BufferIOAttr
Constructs a new BufferIOAttr::ReadWrite.
Source§impl BufferIOAttr
impl BufferIOAttr
Sourcepub fn new_dead() -> BufferIOAttr
pub fn new_dead() -> BufferIOAttr
Constructs a new BufferIOAttr::Dead.
Source§impl BufferIOAttr
impl BufferIOAttr
Sourcepub fn is_readable(&self) -> bool
pub fn is_readable(&self) -> bool
Whether the kernel reads the buffer, so its contents have to be trustworthy before the launch runs.
Sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Whether the kernel writes the buffer, so a failed launch leaves it carrying the failure.
Trait Implementations§
Source§impl Attribute for BufferIOAttr
impl Attribute for BufferIOAttr
Source§fn hash_attr(&self) -> TypeValueHash
fn hash_attr(&self) -> TypeValueHash
Source§fn eq_attr(&self, other: &(dyn Attribute + 'static)) -> bool
fn eq_attr(&self, other: &(dyn Attribute + 'static)) -> bool
Source§fn get_attr_id(&self) -> AttrId
fn get_attr_id(&self) -> AttrId
Source§fn get_attr_id_static() -> AttrId
fn get_attr_id_static() -> AttrId
Source§impl Clone for BufferIOAttr
impl Clone for BufferIOAttr
Source§fn clone(&self) -> BufferIOAttr
fn clone(&self) -> BufferIOAttr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BufferIOAttr
Source§impl Debug for BufferIOAttr
impl Debug for BufferIOAttr
Source§impl<'de> Deserialize<'de> for BufferIOAttr
impl<'de> Deserialize<'de> for BufferIOAttr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BufferIOAttr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BufferIOAttr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for BufferIOAttr
Source§impl Hash for BufferIOAttr
impl Hash for BufferIOAttr
Source§impl Parsable for BufferIOAttr
impl Parsable for BufferIOAttr
Source§type Parsed = BufferIOAttr
type Parsed = BufferIOAttr
Source§fn parse<'__pliron_parse>(
state_stream: &mut Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'__pliron_parse>>, SourcePosition>>>, State<'__pliron_parse>>,
arg: <BufferIOAttr as Parsable>::Arg,
) -> Result<(<BufferIOAttr as Parsable>::Parsed, Commit<()>), Commit<Tracked<<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'__pliron_parse>>, SourcePosition>>>, State<'__pliron_parse>> as StreamOnce>::Error>>>
fn parse<'__pliron_parse>( state_stream: &mut Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'__pliron_parse>>, SourcePosition>>>, State<'__pliron_parse>>, arg: <BufferIOAttr as Parsable>::Arg, ) -> Result<(<BufferIOAttr as Parsable>::Parsed, Commit<()>), Commit<Tracked<<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'__pliron_parse>>, SourcePosition>>>, State<'__pliron_parse>> as StreamOnce>::Error>>>
into on Parser::parse_stream to get the final ParseResult.
Use state_stream.state as necessary.Source§fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>where
Self::Parsed: 'a,
fn parser<'a>(
arg: Self::Arg,
) -> Box<dyn Parser<Stream<Stream<Stream<Stream<IteratorStream<CharIterator<'a>>, SourcePosition>>>, State<'a>>, PartialState = (), Output = Self::Parsed> + 'a>where
Self::Parsed: 'a,
Source§impl PartialEq for BufferIOAttr
impl PartialEq for BufferIOAttr
Source§impl Printable for BufferIOAttr
impl Printable for BufferIOAttr
Source§impl Serialize for BufferIOAttr
impl Serialize for BufferIOAttr
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for BufferIOAttr
Auto Trait Implementations§
impl Freeze for BufferIOAttr
impl RefUnwindSafe for BufferIOAttr
impl Send for BufferIOAttr
impl Sync for BufferIOAttr
impl Unpin for BufferIOAttr
impl UnsafeUnpin for BufferIOAttr
impl UnwindSafe for BufferIOAttr
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.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