Tpetra parallel linear algebra
Version of the Day
|
Declaration of access intent for a global object. More...
#include <Tpetra_withLocalAccess.hpp>
Public Types | |
using | function_argument_type = with_local_access_function_argument_type< canonical_this_type > |
Type that users see, that's an argument to the function that they give to withLocalAccess. More... | |
Public Member Functions | |
LocalAccess (global_object_type &G, memory_space space=memory_space(), const bool isValid=true) | |
Constructor. More... | |
LocalAccess< GlobalObjectType, MemorySpace, am > | valid (const bool isValid) const |
Declare at run time whether you actually want to access the object. More... | |
template<class NewMemorySpace > | |
LocalAccess< GlobalObjectType, NewMemorySpace, am > | on (NewMemorySpace space) const |
Declare intent to access this object's local data in a specific (Kokkos) memory space (instance). More... | |
bool | isValid () const |
Is access supposed to be valid? (See valid() above.) More... | |
memory_space | getSpace () const |
Memory space instance in which the user will access local data. More... | |
Public Attributes | |
global_object_type & | G_ |
Reference to the global object whose data the user will access. More... | |
memory_space | space_ |
Memory space instance in which the user will access local data. More... | |
bool | valid_ |
Will I actually need to access this object? More... | |
Declaration of access intent for a global object.
Users aren't supposed to make instances of this class. They should use readOnly, writeOnly, or readWrite instead, then call instance methods like on() and valid() on the resulting LocalAccess instance.
Definition at line 265 of file Tpetra_withLocalAccess.hpp.
using Tpetra::Details::LocalAccess< GlobalObjectType, MemorySpace, am >::function_argument_type = with_local_access_function_argument_type<canonical_this_type> |
Type that users see, that's an argument to the function that they give to withLocalAccess.
Definition at line 304 of file Tpetra_withLocalAccess.hpp.
|
inline |
Constructor.
Users must NOT call the LocalAccess constructor directly. They should instead start by calling readOnly, writeOnly, or readWrite above. They may then use instance methods like on() or valid() (see below).
G is a reference, because we only access it in a delimited scope. G is nonconst, because even read-only local access may modify G. For example, G may give access to its local data via lazy allocation of a data structure that differs from its normal internal storage format.
Memory spaces should behave like Kokkos memory spaces. Default construction should work and should get the default instance of the space. Otherwise, it may make sense to get the default memory space from G.
Definition at line 293 of file Tpetra_withLocalAccess.hpp.
|
inline |
Declare at run time whether you actually want to access the object.
isValid | [in] If false, then the caller promises that they won't actually access the object. |
If isValid is false, implementations should not spend any effort getting the master local object. This may save time on allocating temporary space, copying from device to host, etc. This implies that implementations must be able to construct "null" / empty master local objects.
Definition at line 319 of file Tpetra_withLocalAccess.hpp.
|
inline |
Declare intent to access this object's local data in a specific (Kokkos) memory space (instance).
Definition at line 327 of file Tpetra_withLocalAccess.hpp.
|
inline |
Is access supposed to be valid? (See valid() above.)
Definition at line 332 of file Tpetra_withLocalAccess.hpp.
|
inline |
Memory space instance in which the user will access local data.
Definition at line 336 of file Tpetra_withLocalAccess.hpp.
global_object_type& Tpetra::Details::LocalAccess< GlobalObjectType, MemorySpace, am >::G_ |
Reference to the global object whose data the user will access.
Keep by reference, because this struct is only valid in a delimited scope.
Definition at line 344 of file Tpetra_withLocalAccess.hpp.
memory_space Tpetra::Details::LocalAccess< GlobalObjectType, MemorySpace, am >::space_ |
Memory space instance in which the user will access local data.
We assume that Kokkos memory spaces have shallow-copy semantics.
Definition at line 351 of file Tpetra_withLocalAccess.hpp.
bool Tpetra::Details::LocalAccess< GlobalObjectType, MemorySpace, am >::valid_ |
Will I actually need to access this object?
Definition at line 353 of file Tpetra_withLocalAccess.hpp.