|
| | View (void) |
| | Initialize empty view.
|
| |
| template<class OtherView > |
| | View (OtherView &src) |
| | Construct from another View or Vector.
|
| |
| template<class InputIterator > |
| | View (InputIterator data, unsigned size) |
| | Construct view from pointer and size.
|
| |
| template<class InputIterator > |
| void | construct (InputIterator data, unsigned size) |
| | Construct view from pointer and size.
|
| |
| pointer | data () const |
| | Constant Reference of the pointer.
|
| |
| iterator | begin () const |
| | Iterator to the beginning.
|
| |
| const_iterator | cbegin () const |
| | const Iterator to the beginning
|
| |
| iterator | end () const |
| | Iterator to the end.
|
| |
| const_iterator | cend () const |
| | const Iterator to the end
|
| |
| unsigned | size () const |
| | Get the size.
|
| |
| void | swap (View &src) |
| | Swap pointer and size with another View.
|
| |
template<class ThrustVector>
struct dg::View< ThrustVector >
A vector view class, usable in dg functions.
The view class holds a pointer and a size. It does not own the pointer. The user is responsible for allocating and deallocating memory. The intention is to use Views in dg::blas1 functions.
The class can be used as a traditional "view" in the sense that it can view part of a larger contiguous chunk of data and thus apply operations to only part of that data. The second use would be to imitate for example a full dg::DVec without allocating or copying memory for it. This might be useful if you want to use the dg::blas1 functions without specializing TensorTraits for your own vector class or deep copying data, like the following example demonstrates:
SomeDeviceVectorClass vector( 1e6, 20.);
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
Definition blas1.h:243
A vector view class, usable in dg functions.
Definition view.h:45
- Attention
- when constructing a View from a pointer the user also promises that the pointer can be dereferenced on the device the View acts on.
- Note
- Cannot be used as a target
to in dg::construct or dg::assign but can be used as the source from
-
You cannot have a
View of an MPI_Vector but you can have an MPI_Vector of View
- Template Parameters
-
- See also
dg::split