|
libMesh
|
Non-owning handle to one vector entry of a Kokkos storage view. More...
#include <kokkos_linalg_base.h>
Public Types | |
| using | view_type = ViewType |
| using | value_type = detail::vector_view_value_t< ViewType > |
Public Member Functions | |
| LIBMESH_DEVICE_INLINE | vector_ref (ViewType view, const unsigned int index) |
Constructs a reference to entry index of view. | |
| LIBMESH_DEVICE_INLINE decltype(auto) | operator() (const unsigned int component) const |
| LIBMESH_DEVICE_INLINE decltype(auto) | operator() (const unsigned int component) |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE void | assign (const RightVector &right) |
Assigns right 's components to the referenced entry. | |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE void | add (const RightVector &right) |
Adds right to the referenced entry, in place. | |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE void | add_scaled (const RightVector &right, const value_type &factor) |
Adds factor times right to the referenced entry, in place. | |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE void | subtract (const RightVector &right) |
Subtracts right from the referenced entry, in place. | |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE void | subtract_scaled (const RightVector &right, const value_type &factor) |
Subtracts factor times right from the referenced entry, in place. | |
| LIBMESH_DEVICE_INLINE void | zero () |
| Sets every component of the referenced entry to zero. | |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE auto | contract (const RightVector &right) const |
| LIBMESH_DEVICE_INLINE auto | norm () const |
| LIBMESH_DEVICE_INLINE auto | norm_sq () const |
| LIBMESH_DEVICE_INLINE auto | l1_norm () const |
| LIBMESH_DEVICE_INLINE bool | is_zero () const |
| LIBMESH_DEVICE_INLINE auto | unit () const |
| template<typename RightVector > | |
| LIBMESH_DEVICE_INLINE auto | cross (const RightVector &right) const |
| LIBMESH_DEVICE_INLINE unsigned int | index () const |
Private Attributes | |
| ViewType | _view |
| unsigned int | _index |
Non-owning handle to one vector entry of a Kokkos storage view.
A vector_ref pairs a view with an entry index and exposes the entry's components through operator(), so it can be used wherever a vector-like object is expected. Component writes go directly to the underlying view; the arithmetic methods below (defined out-of-line in kokkos_vector_ops.h) either update the view in place or return owning results, mirroring the TypeVector interface.
Refs are cheap to construct and copy (a view handle plus an index) and are intended to be created on the fly inside kernels via make_vector_ref().
Definition at line 193 of file kokkos_linalg_base.h.
| using libMesh::Kokkos::vector_ref< ViewType >::value_type = detail::vector_view_value_t<ViewType> |
Definition at line 198 of file kokkos_linalg_base.h.
| using libMesh::Kokkos::vector_ref< ViewType >::view_type = ViewType |
Definition at line 197 of file kokkos_linalg_base.h.
|
inline |
Constructs a reference to entry index of view.
Definition at line 204 of file kokkos_linalg_base.h.
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::add | ( | const RightVector & | right | ) |
Adds right to the referenced entry, in place.
Definition at line 409 of file kokkos_vector_ops.h.
References libMesh::Kokkos::operator+=().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::add_scaled | ( | const RightVector & | right, |
| const value_type & | factor | ||
| ) |
Adds factor times right to the referenced entry, in place.
Definition at line 417 of file kokkos_vector_ops.h.
References libMesh::Kokkos::detail::update_vector_components().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::assign | ( | const RightVector & | right | ) |
Assigns right 's components to the referenced entry.
Definition at line 401 of file kokkos_vector_ops.h.
References libMesh::Kokkos::detail::assign_vector_components().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::contract | ( | const RightVector & | right | ) | const |
right. Definition at line 448 of file kokkos_vector_ops.h.
References libMesh::Kokkos::contract().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::cross | ( | const RightVector & | right | ) | const |
right, as an owning vector. Definition at line 510 of file kokkos_vector_ops.h.
References libMesh::Kokkos::vector_cross().
|
inline |
Definition at line 320 of file kokkos_linalg_base.h.
References libMesh::Kokkos::vector_ref< ViewType >::_index.
| LIBMESH_DEVICE_INLINE bool libMesh::Kokkos::vector_ref< ViewType >::is_zero | ( | ) | const |
true if every component of the referenced entry is exactly zero, false otherwise. Definition at line 491 of file kokkos_vector_ops.h.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::l1_norm | ( | ) | const |
Definition at line 477 of file kokkos_vector_ops.h.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::norm | ( | ) | const |
Definition at line 455 of file kokkos_vector_ops.h.
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::norm_sq | ( | ) | const |
Definition at line 463 of file kokkos_vector_ops.h.
References libMesh::TensorTools::norm_sq().
|
inline |
Definition at line 220 of file kokkos_linalg_base.h.
References libMesh::Kokkos::vector_ref< ViewType >::_index, and libMesh::Kokkos::vector_ref< ViewType >::_view.
|
inline |
component of the referenced entry. Writes through it land directly in the underlying view; since Kokkos view constness is shallow, even the const overload yields a writable reference when the view's data type is non-const. Definition at line 214 of file kokkos_linalg_base.h.
References libMesh::Kokkos::vector_ref< ViewType >::_index, and libMesh::Kokkos::vector_ref< ViewType >::_view.
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::subtract | ( | const RightVector & | right | ) |
Subtracts right from the referenced entry, in place.
Definition at line 425 of file kokkos_vector_ops.h.
References libMesh::Kokkos::operator-=().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::subtract_scaled | ( | const RightVector & | right, |
| const value_type & | factor | ||
| ) |
Subtracts factor times right from the referenced entry, in place.
Definition at line 433 of file kokkos_vector_ops.h.
References libMesh::Kokkos::detail::update_vector_components().
| LIBMESH_DEVICE_INLINE auto libMesh::Kokkos::vector_ref< ViewType >::unit | ( | ) | const |
Definition at line 502 of file kokkos_vector_ops.h.
References libMesh::Kokkos::vector_unit().
| LIBMESH_DEVICE_INLINE void libMesh::Kokkos::vector_ref< ViewType >::zero | ( | ) |
Sets every component of the referenced entry to zero.
Definition at line 440 of file kokkos_vector_ops.h.
References libMesh::Kokkos::detail::fill_vector_components().
|
private |
Definition at line 327 of file kokkos_linalg_base.h.
Referenced by libMesh::Kokkos::vector_ref< ViewType >::index(), libMesh::Kokkos::vector_ref< ViewType >::operator()(), and libMesh::Kokkos::vector_ref< ViewType >::operator()().
|
private |
Definition at line 326 of file kokkos_linalg_base.h.
Referenced by libMesh::Kokkos::vector_ref< ViewType >::operator()(), and libMesh::Kokkos::vector_ref< ViewType >::operator()().