pub enum DiffActivity {
None,
Const,
Active,
ActiveOnly,
Dual,
DualOnly,
Duplicated,
DuplicatedOnly,
FakeActivitySize,
}
Expand description
Dual and Duplicated (and their Only variants) are getting lowered to the same Enzyme Activity. However, under forward mode we overwrite the previous shadow value, while for reverse mode we add to the previous shadow value. To not surprise users, we picked different names. Dual numbers is also a quite well known name for forward mode AD types.
Variants§
None
Implicit or Explicit () return type, so a special case of Const.
Const
Don’t compute derivatives with respect to this input/output.
Active
Reverse Mode, Compute derivatives for this scalar input/output.
ActiveOnly
Reverse Mode, Compute derivatives for this scalar output, but don’t compute the original return value.
Dual
Forward Mode, Compute derivatives for this input/output and overwrite the shadow argument with it.
DualOnly
Forward Mode, Compute derivatives for this input/output and overwrite the shadow argument with it. Drop the code which updates the original input/output for maximum performance.
Duplicated
Reverse Mode, Compute derivatives for this &T or *T input and add it to the shadow argument.
DuplicatedOnly
Reverse Mode, Compute derivatives for this &T or *T input and add it to the shadow argument. Drop the code which updates the original input for maximum performance.
FakeActivitySize
All Integers must be Const, but these are used to mark the integer which represents the length of a slice/vec. This is used for safety checks on slices.
Trait Implementations§
Source§impl Clone for DiffActivity
impl Clone for DiffActivity
Source§fn clone(&self) -> DiffActivity
fn clone(&self) -> DiffActivity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DiffActivity
impl Debug for DiffActivity
Source§impl<__D: SpanDecoder> Decodable<__D> for DiffActivity
impl<__D: SpanDecoder> Decodable<__D> for DiffActivity
Source§impl Display for DiffActivity
impl Display for DiffActivity
Source§impl<__E: SpanEncoder> Encodable<__E> for DiffActivity
impl<__E: SpanEncoder> Encodable<__E> for DiffActivity
Source§impl FromStr for DiffActivity
impl FromStr for DiffActivity
Source§impl<__CTX> HashStable<__CTX> for DiffActivitywhere
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for DiffActivitywhere
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
Source§impl PartialEq for DiffActivity
impl PartialEq for DiffActivity
impl Copy for DiffActivity
impl Eq for DiffActivity
impl StructuralPartialEq for DiffActivity
Auto Trait Implementations§
impl DynSend for DiffActivity
impl DynSync for DiffActivity
impl Freeze for DiffActivity
impl RefUnwindSafe for DiffActivity
impl Send for DiffActivity
impl Sync for DiffActivity
impl Unpin for DiffActivity
impl UnwindSafe for DiffActivity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
None
: 0 bytesConst
: 0 bytesActive
: 0 bytesActiveOnly
: 0 bytesDual
: 0 bytesDualOnly
: 0 bytesDuplicated
: 0 bytesDuplicatedOnly
: 0 bytesFakeActivitySize
: 0 bytes