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
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