Extended CUDA Library (ecuda)
2.0
|
A fixed-size array stored in device memory. More...
#include <array.hpp>
Public Types | |
typedef base_type::value_type | value_type |
cell data type More... | |
typedef base_type::size_type | size_type |
unsigned integral type More... | |
typedef base_type::difference_type | difference_type |
signed integral type More... | |
typedef base_type::reference | reference |
cell reference type More... | |
typedef base_type::const_reference | const_reference |
cell const reference type More... | |
typedef base_type::pointer | pointer |
cell pointer type More... | |
typedef make_const< pointer >::type | const_pointer |
cell const pointer type More... | |
typedef base_type::iterator | iterator |
iterator type More... | |
typedef base_type::const_iterator | const_iterator |
const iterator type More... | |
typedef base_type::reverse_iterator | reverse_iterator |
reverse iterator type More... | |
typedef base_type::const_reverse_iterator | const_reverse_iterator |
const reverse iterator type More... | |
typedef impl::array_kernel_argument< T, N > | kernel_argument |
kernel argument type More... | |
typedef const impl::array_kernel_argument< T, N > | const_kernel_argument |
const kernel argument type More... | |
Public Member Functions | |
__HOST__ | array () |
Constructs a fixed-size array with N elements. More... | |
__HOST__ | array (const array &src) |
Copy constructor. More... | |
__HOST__ array & | operator= (const array &other) |
Assignment operator. More... | |
__DEVICE__ reference | at (size_type index) |
Returns a reference to the element at specified location index, with bounds checking. More... | |
__DEVICE__ const_reference | at (size_type index) const |
Returns a reference to the element at specified location index, with bounds checking. More... | |
__DEVICE__ reference | operator[] (size_type index) |
Returns a reference to the element at specified location index. No bounds checking is performed. More... | |
__DEVICE__ const_reference | operator[] (size_type index) const |
Returns a reference to the element at specified location index. No bounds checking is performed. More... | |
__DEVICE__ reference | operator() (const size_type index) |
Returns a reference to the element at specified location index. No bounds checking is performed. More... | |
__DEVICE__ const_reference | operator() (const size_type index) const |
Returns a reference to the element at specified location index. No bounds checking is performed. More... | |
__DEVICE__ reference | front () |
Returns a reference to the first element in the container. More... | |
__DEVICE__ reference | back () |
Returns a reference to the last element in the container. More... | |
__DEVICE__ const_reference | front () const |
Returns a reference to the first element in the container. More... | |
__DEVICE__ const_reference | back () const |
Returns a reference to the last element in the container. More... | |
__HOST__ __DEVICE__ pointer | data () __NOEXCEPT__ |
Returns pointer to the underlying array serving as element storage. More... | |
__HOST__ __DEVICE__ const_pointer | data () const __NOEXCEPT__ |
Returns pointer to the underlying array serving as element storage. More... | |
__HOST__ __DEVICE__ iterator | begin () __NOEXCEPT__ |
Returns an iterator to the first element of the container. More... | |
__HOST__ __DEVICE__ iterator | end () __NOEXCEPT__ |
Returns an iterator to the element following the last element of the container. More... | |
__HOST__ __DEVICE__ const_iterator | begin () const __NOEXCEPT__ |
Returns a const_iterator to the first element of the container. More... | |
__HOST__ __DEVICE__ const_iterator | end () const __NOEXCEPT__ |
Returns a const_iterator to the element following the last element of the container. More... | |
__HOST__ __DEVICE__ reverse_iterator | rbegin () __NOEXCEPT__ |
Returns a reverse iterator to the first element of the reversed container. More... | |
__HOST__ __DEVICE__ reverse_iterator | rend () __NOEXCEPT__ |
Returns a reverse iterator to the element following the last element of the reversed container. More... | |
__HOST__ __DEVICE__ const_reverse_iterator | rbegin () const __NOEXCEPT__ |
Returns a const_reverse_iterator to the first element of the reversed container. More... | |
__HOST__ __DEVICE__ const_reverse_iterator | rend () const __NOEXCEPT__ |
Returns a const_reverse_iterator to the element following the last element of the reversed container. More... | |
__HOST__ __DEVICE__ __CONSTEXPR__ bool | empty () const __NOEXCEPT__ |
Checks if the container has no elements. More... | |
__HOST__ __DEVICE__ __CONSTEXPR__ size_type | size () const __NOEXCEPT__ |
Returns the number of elements in the container. More... | |
__HOST__ __CONSTEXPR__ size_type | max_size () const __NOEXCEPT__ |
Returns the maximum number of elements the container is able to hold. More... | |
__HOST__ __DEVICE__ void | fill (const value_type &value) |
Assigns a given value to all elements in the container. More... | |
__HOST__ __DEVICE__ void | swap (array &other) |
Exchanges the contents of the container with those of the other. More... | |
__HOST__ __DEVICE__ bool | operator== (const array &other) const |
Checks if the contents of two arrays are equal. More... | |
__HOST__ __DEVICE__ bool | operator!= (const array &other) const |
Checks if the contents of two arrays are not equal. More... | |
__HOST__ __DEVICE__ bool | operator< (const array &other) const |
Compares the contents of two arrays lexicographically. More... | |
__HOST__ __DEVICE__ bool | operator> (const array &other) const |
Compares the contents of two arrays lexicographically. More... | |
__HOST__ __DEVICE__ bool | operator<= (const array &other) const |
Compares the contents of two arrays lexicographically. More... | |
__HOST__ __DEVICE__ bool | operator>= (const array &other) const |
Compares the contents of two arrays lexicographically. More... | |
Friends | |
template<typename U , std::size_t M, class Q > | |
class | array |
A fixed-size array stored in device memory.
Creates a fixed size array in GPU memory. Redeclares most of the STL methods on the equivalent C++11 std::array (although this implementation works with C98 compilers).
Methods are prefaced with appropriate keywords to declare them as host and/or device capable. In general: operations requiring memory allocation/deallocation are host only, operations to access the values of specific elements are device only, and copy operations on ranges of data and accessors of general information can be performed on both the host and device.
typedef base_type::const_iterator ecuda::array< T, N, P >::const_iterator |
typedef const impl::array_kernel_argument<T,N> ecuda::array< T, N, P >::const_kernel_argument |
typedef make_const<pointer>::type ecuda::array< T, N, P >::const_pointer |
typedef base_type::const_reference ecuda::array< T, N, P >::const_reference |
typedef base_type::const_reverse_iterator ecuda::array< T, N, P >::const_reverse_iterator |
typedef base_type::difference_type ecuda::array< T, N, P >::difference_type |
typedef base_type::iterator ecuda::array< T, N, P >::iterator |
typedef impl::array_kernel_argument<T,N> ecuda::array< T, N, P >::kernel_argument |
typedef base_type::pointer ecuda::array< T, N, P >::pointer |
typedef base_type::reference ecuda::array< T, N, P >::reference |
typedef base_type::reverse_iterator ecuda::array< T, N, P >::reverse_iterator |
typedef base_type::size_type ecuda::array< T, N, P >::size_type |
typedef base_type::value_type ecuda::array< T, N, P >::value_type |
|
inline |
|
inline |
|
inline |
Returns a reference to the element at specified location index, with bounds checking.
If index is not within the range of the container, the current kernel will exit and cudaGetLastError will return cudaErrorUnknown.
index | position of the element to return |
|
inline |
Returns a reference to the element at specified location index, with bounds checking.
If index is not within the range of the container, the current kernel will exit and cudaGetLastError will return cudaErrorUnknown.
index | position of the element to return |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Checks if the contents of two arrays are not equal.
That is, whether any element in the this array does not compare equal with the element in another array at the same position.
other | container to compare contents with |
|
inline |
Returns a reference to the element at specified location index. No bounds checking is performed.
This is identical to operator[] but is present for consistency with higher-dimensional containers.
index | position of the element to return |
|
inline |
Returns a reference to the element at specified location index. No bounds checking is performed.
This is identical to operator[] but is present for consistency with higher-dimensional containers.
index | position of the element to return |
|
inline |
|
inline |
|
inline |
|
inline |
Checks if the contents of two arrays are equal.
That is, whether each element in the this array compares equal with the element in another array at the same position.
other | container to compare contents with |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns a reverse iterator to the element following the last element of the reversed container.
It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behaviour.
|
inline |
Returns a const_reverse_iterator to the element following the last element of the reversed container.
It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behaviour.
|
inline |
|
inline |
|
friend |