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...
template<typename T>
class xpu::h_view< T >
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.
◆ value_type
◆ h_view() [1/3]
◆ h_view() [2/3]
Create a view from a buffer.
◆ h_view() [3/3]
◆ at() [1/2]
- Returns
- Reference to the element at index i.
- Note
- This call is always bounds checked. Use unsafe_at() instead if no bounds checking is needed. Equivalent to []-operator.
◆ at() [2/2]
◆ back() [1/2]
◆ back() [2/2]
◆ begin() [1/2]
◆ begin() [2/2]
◆ data() [1/2]
- Returns
- Pointer to the underlying data.
◆ data() [2/2]
◆ empty()
Check if the view is empty.
◆ end() [1/2]
◆ end() [2/2]
◆ front() [1/2]
◆ front() [2/2]
◆ operator[]() [1/2]
- Returns
- Reference to the element at index i.
- Note
- This call is always bounds checked. Use instead unsafe_at() if no bounds check are needed. Equivalent to calling at(i).
◆ operator[]() [2/2]
template<typename T >
const T& xpu::h_view< T >::operator[] |
( |
size_t |
i | ) |
const |
◆ size()
- Returns
- Size of the view in number of elements.
◆ size_bytes()
- Returns
- Size of the view in bytes.
◆ unsafe_at() [1/2]
- Returns
- Reference to the element at index i.
- Note
- No bounds checking is performed. Usually you will want to use at() instead.
◆ unsafe_at() [2/2]
The documentation for this class was generated from the following file: