The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable. More...
#include <KokkosScalar.h>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| Scalar (T &value) | |
| Constructor. More... | |
| Scalar (const Scalar &object) | |
| Copy constructor. More... | |
| auto & | operator= (const Scalar &value) |
| Assign a scalar value to the underlying host reference. More... | |
| template<typename U > | |
| auto | operator= (const U &value) -> decltype(std::declval< T &>()=value, std::declval< Scalar &>()) |
| Assign an arithmetic value to the underlying host reference. More... | |
| KOKKOS_SCALAR_FUNCTION auto | operator+ () const -> decltype(+std::declval< const T &>()) |
| Get the positive value of the scalar. More... | |
| KOKKOS_SCALAR_FUNCTION auto | operator- () const -> decltype(-std::declval< const T &>()) |
| Get the negated value of the scalar. More... | |
| template<typename U > | |
| auto | operator+= (const U &value) -> decltype(std::declval< T &>()+=value, std::declval< Scalar &>()) |
| Add another value to the underlying host reference. More... | |
| template<typename U > | |
| auto | operator-= (const U &value) -> decltype(std::declval< T &>() -=value, std::declval< Scalar &>()) |
| Subtract another value from the underlying host reference. More... | |
| template<typename U > | |
| auto | operator*= (const U &value) -> decltype(std::declval< T &>() *=value, std::declval< Scalar &>()) |
| Multiply the underlying host reference by another value. More... | |
| template<typename U > | |
| auto | operator/= (const U &value) -> decltype(std::declval< T &>()/=value, std::declval< Scalar &>()) |
| Divide the underlying host reference by another value. More... | |
| template<typename U > | |
| auto | operator%= (const U &value) -> decltype(std::declval< T &>() %=value, std::declval< Scalar &>()) |
| Assign the remainder after division by another value to the underlying host reference. More... | |
| template<typename U = T> | |
| auto | operator++ () -> decltype(++std::declval< U &>(), std::declval< Scalar &>()) |
| Prefix increment the underlying host reference. More... | |
| template<typename U = T> | |
| auto | operator++ (int) -> decltype(std::declval< U &>()++) |
| Postfix increment the underlying host reference. More... | |
| template<typename U = T> | |
| auto | operator-- () -> decltype(--std::declval< U &>(), std::declval< Scalar &>()) |
| Prefix decrement the underlying host reference. More... | |
| template<typename U = T> | |
| auto | operator-- (int) -> decltype(std::declval< U &>() --) |
| Postfix decrement the underlying host reference. More... | |
| template<typename U > | |
| KOKKOS_SCALAR_FUNCTION auto | operator+ (const U &value) const -> decltype(std::declval< const T &>()+value) |
| Add another value to this scalar. More... | |
| template<typename U > | |
| KOKKOS_SCALAR_FUNCTION auto | operator- (const U &value) const -> decltype(std::declval< const T &>() - value) |
| Subtract another value from this scalar. More... | |
| template<typename U > | |
| KOKKOS_SCALAR_FUNCTION auto | operator* (const U &value) const -> decltype(std::declval< const T &>() *value) |
| Multiply this scalar by another value. More... | |
| template<typename U > | |
| KOKKOS_SCALAR_FUNCTION auto | operator/ (const U &value) const -> decltype(std::declval< const T &>()/value) |
| Divide this scalar by another value. More... | |
| template<typename U > | |
| KOKKOS_SCALAR_FUNCTION auto | operator% (const U &value) const -> decltype(std::declval< const T &>() % value) |
| Get the remainder after division by another value. More... | |
| KOKKOS_FUNCTION | operator const T & () const |
| Get the const reference of the stored variable. More... | |
| operator const T & () const | |
| Get the const reference of the stored host reference. More... | |
| KOKKOS_FUNCTION const T & | operator* () const |
| Get the const reference of the stored variable. More... | |
| T & | operator* () |
| Get the writeable reference of the stored host reference. More... | |
| KOKKOS_FUNCTION const T * | operator-> () const |
| Get the const pointer to the stored variable. More... | |
| const T * | operator-> () const |
| Get the const pointer of the stored host reference. More... | |
| T * | operator-> () |
| Get the writeable pointer of the stored host reference. More... | |
| template<typename... Args> | |
| KOKKOS_FUNCTION auto | operator() (Args &&... args) const -> decltype(auto) |
| Forward arguments to the stored variable's const operator() depending on the architecture this function is being called on. More... | |
| template<typename... Args> | |
| auto | operator() (Args &&... args) const -> decltype(auto) |
| Forward arguments to the stored host reference's const operator() More... | |
| template<typename... Args> | |
| auto | operator() (Args &&... args) -> decltype(auto) |
| Forward arguments to the stored host reference's operator() More... | |
| operator T& () | |
| Get the writeable reference of the stored host reference. More... | |
Protected Attributes | |
| T & | _reference |
| Writeable host reference of the variable. More... | |
| const T | _copy |
| Device copy of the variable. More... | |
Private Member Functions | |
| KOKKOS_SCALAR_FUNCTION const T & | value () const |
The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable.
Definition at line 30 of file KokkosScalar.h.
| using Moose::Kokkos::Scalar< T, typename >::value_type = T |
Definition at line 33 of file KokkosScalar.h.
|
inline |
Constructor.
| value | The writeable reference of the arithmetic scalar variable to store |
Definition at line 39 of file KokkosScalar.h.
|
inline |
|
inlineinherited |
Get the const reference of the stored variable.
Definition at line 53 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the const reference of the stored host reference.
Definition at line 98 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the writeable reference of the stored host reference.
Definition at line 123 of file KokkosReferenceWrapper.h.
|
inline |
Get the remainder after division by another value.
| value | The divisor value |
Definition at line 236 of file KokkosScalar.h.
|
inline |
Assign the remainder after division by another value to the underlying host reference.
| value | The divisor value |
Definition at line 137 of file KokkosScalar.h.
|
inlineinherited |
Forward arguments to the stored variable's const operator() depending on the architecture this function is being called on.
| args | The variadic arguments to be forwarded |
Definition at line 87 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Forward arguments to the stored host reference's const operator()
| args | The variadic arguments to be forwarded |
Definition at line 114 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Forward arguments to the stored host reference's operator()
| args | The variadic arguments to be forwarded |
Definition at line 139 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the const reference of the stored variable.
Definition at line 64 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the writeable reference of the stored host reference.
Definition at line 128 of file KokkosReferenceWrapper.h.
|
inline |
Multiply this scalar by another value.
| value | The value to multiply by |
Definition at line 214 of file KokkosScalar.h.
|
inline |
Multiply the underlying host reference by another value.
| value | The value to multiply by |
Definition at line 113 of file KokkosScalar.h.
|
inline |
Get the positive value of the scalar.
Definition at line 71 of file KokkosScalar.h.
|
inline |
Add another value to this scalar.
| value | The value to add |
Definition at line 192 of file KokkosScalar.h.
|
inline |
Prefix increment the underlying host reference.
Definition at line 150 of file KokkosScalar.h.
|
inline |
Postfix increment the underlying host reference.
Definition at line 161 of file KokkosScalar.h.
|
inline |
Add another value to the underlying host reference.
| value | The value to add |
Definition at line 89 of file KokkosScalar.h.
|
inline |
Get the negated value of the scalar.
Definition at line 79 of file KokkosScalar.h.
|
inline |
Subtract another value from this scalar.
| value | The value to subtract |
Definition at line 203 of file KokkosScalar.h.
|
inline |
Prefix decrement the underlying host reference.
Definition at line 170 of file KokkosScalar.h.
|
inline |
Postfix decrement the underlying host reference.
Definition at line 181 of file KokkosScalar.h.
|
inline |
Subtract another value from the underlying host reference.
| value | The value to subtract |
Definition at line 101 of file KokkosScalar.h.
|
inlineinherited |
Get the const pointer to the stored variable.
Definition at line 75 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the const pointer of the stored host reference.
Definition at line 108 of file KokkosReferenceWrapper.h.
|
inlineinherited |
Get the writeable pointer of the stored host reference.
Definition at line 133 of file KokkosReferenceWrapper.h.
|
inline |
Divide this scalar by another value.
| value | The value to divide by |
Definition at line 225 of file KokkosScalar.h.
|
inline |
Divide the underlying host reference by another value.
| value | The value to divide by |
Definition at line 125 of file KokkosScalar.h.
|
inline |
Assign a scalar value to the underlying host reference.
| value | The scalar value to be assigned |
Definition at line 49 of file KokkosScalar.h.
|
inline |
Assign an arithmetic value to the underlying host reference.
| value | The scalar value to be assigned |
Definition at line 60 of file KokkosScalar.h.
|
inlineprivate |
Definition at line 243 of file KokkosScalar.h.
Referenced by Moose::Kokkos::Scalar< Real >::operator%(), Moose::Kokkos::Scalar< Real >::operator%=(), Moose::Kokkos::Scalar< Real >::operator*(), Moose::Kokkos::Scalar< Real >::operator*=(), Moose::Kokkos::Scalar< Real >::operator+(), Moose::Kokkos::Scalar< Real >::operator+=(), Moose::Kokkos::Scalar< Real >::operator-(), Moose::Kokkos::Scalar< Real >::operator-=(), Moose::Kokkos::Scalar< Real >::operator/(), Moose::Kokkos::Scalar< Real >::operator/=(), and Moose::Kokkos::Scalar< Real >::operator=().
|
protectedinherited |
Device copy of the variable.
Definition at line 152 of file KokkosReferenceWrapper.h.
Referenced by Moose::Kokkos::ReferenceWrapper< T >::operator const T &(), Moose::Kokkos::ReferenceWrapper< Real >::operator()(), Moose::Kokkos::ReferenceWrapper< Real >::operator*(), and Moose::Kokkos::ReferenceWrapper< Real >::operator->().
|
protectedinherited |
Writeable host reference of the variable.
Definition at line 148 of file KokkosReferenceWrapper.h.
Referenced by Moose::Kokkos::ReferenceWrapper< T >::operator const T &(), Moose::Kokkos::ReferenceWrapper< T >::operator T&(), Moose::Kokkos::Scalar< Real >::operator%=(), Moose::Kokkos::ReferenceWrapper< Real >::operator()(), Moose::Kokkos::ReferenceWrapper< Real >::operator*(), Moose::Kokkos::Scalar< Real >::operator*=(), Moose::Kokkos::Scalar< Real >::operator++(), Moose::Kokkos::Scalar< Real >::operator+=(), Moose::Kokkos::Scalar< Real >::operator--(), Moose::Kokkos::Scalar< Real >::operator-=(), Moose::Kokkos::ReferenceWrapper< Real >::operator->(), Moose::Kokkos::Scalar< Real >::operator/=(), and Moose::Kokkos::Scalar< Real >::operator=().
1.8.14