|
xpu
|
Create a view from a buffer. Create a view from a buffer to access the underlying data on the host. The view is a lightweight wrapper around the buffer and does not own the data. If the underlying buffer can't be accessed on the host, an runtime_error is thrown. Note that no synchronization with the device is performed, so the data may be out of date. More...
#include <host.h>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| h_view () | |
| Create an empty view. | |
| h_view (buffer< T > &) | |
| Create a view from a buffer. | |
| T * | data () |
| const T * | data () const |
| size_t | size () const |
| size_t | size_bytes () const |
| bool | empty () const |
| T * | begin () |
| const T * | begin () const |
| T * | end () |
| const T * | end () const |
| T & | front () |
| const T & | front () const |
| T & | back () |
| const T & | back () const |
| T & | operator[] (size_t i) |
| const T & | operator[] (size_t i) const |
| T & | at (size_t i) |
| const T & | at (size_t i) const |
| T & | unsafe_at (size_t i) |
| const T & | unsafe_at (size_t i) const |
| h_view (T *data, size_t size) | |
Create a view from a buffer. Create a view from a buffer to access the underlying data on the host. The view is a lightweight wrapper around the buffer and does not own the data. If the underlying buffer can't be accessed on the host, an runtime_error is thrown. Note that no synchronization with the device is performed, so the data may be out of date.
| using xpu::h_view< T >::value_type = T |
|
inline |
Create an empty view.
|
explicit |
Create a view from a buffer.
|
inline |
| T & xpu::h_view< T >::at | ( | size_t | i | ) |
| const T & xpu::h_view< T >::at | ( | size_t | i | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Check if the view is empty.
|
inline |
|
inline |
|
inline |
|
inline |
| T & xpu::h_view< T >::operator[] | ( | size_t | i | ) |
| const T & xpu::h_view< T >::operator[] | ( | size_t | i | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |