Implementation of 1-D std::vector like structure. More...
Implementation of 1-D std::vector like structure.
this implementation is just a wrapper for the std::vector in the case of data where the members cannot be parsed see openFPM_data wiki for more information
T | base type |
Definition at line 25 of file map_vector_std_cuda.hpp.
#include <map_vector_std_cuda.hpp>
Data Structures | |
struct | layout_base__ |
Public Types | |
typedef int | yes_i_am_vector |
it define that it is a vector | |
typedef memory_traits_inte< T > | layout_base_ |
typedef vector_key_iterator | iterator_key |
iterator for the vector | |
typedef T | value_type |
Type of the value the vector is storing. | |
typedef void | base_to_copy |
typedef grow_policy_double | grow_policy |
growing policy of this vector | |
Public Member Functions | |
size_t | size () const |
return the size of the vector | |
void | resize (size_t slot) |
void | clear () |
Remove all the element from the vector. | |
void | add (const T &v) |
It insert a new object on the vector, eventually it reallocate the grid. | |
void | add (T &&v) |
It insert a new object on the vector, eventually it reallocate the grid. | |
void | add () |
Add an empty object (it call the default constructor () ) at the end of the vector. | |
T & | last () |
Get the last element. | |
const T & | last () const |
Get the last element. | |
void | swap (vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > &&v) |
swap the memory between the two vector | |
T & | at (int i) |
T & | operator[] (int id) |
Get an element of the vector. | |
T & | get (int id) |
Get an element of the vector. | |
const T & | get (int id) const |
Get an element of the vector. | |
T & | get (size_t id) |
Get an element of the vector. | |
const T & | get (size_t id) const |
Get an element of the vector. | |
void | reserve (size_t ns) |
reserve a memory space in advance to avoid reallocation | |
vector () noexcept | |
Constructor, vector of size 0. | |
vector (size_t sz) noexcept | |
Constructor, vector of size sz. | |
vector (const vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > &v) noexcept | |
Constructor from another vector. | |
vector (const std::initializer_list< T > &v) | |
Initializer from constructor. | |
vector (vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > &&v) noexcept | |
Constructor from another vector. | |
template<class InputIt > | |
vector (InputIt first, InputIt last) | |
Constructor from iterators. | |
~vector () noexcept | |
destructor | |
void | swap (vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > &v) |
vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > & | operator= (const vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR > &v) |
Operator= copy the vector into another. | |
vector_key_iterator | getIterator () const |
Get an iterator over all the elements of the vector. | |
vector_key_iterator | getIteratorTo (size_t k) const |
Get iterator until a specified element. | |
void * | getPointer () |
Return the pointer to the chunk of memory. | |
const void * | getPointer () const |
Return the pointer to the chunk of memory. | |
template<unsigned int ... prp> | |
void | hostToDevice () |
Do nothing. | |
template<unsigned int ... prp> | |
void | deviceToHost () |
Do nothing. | |
template<unsigned int ... prp> | |
void | deviceToHost (size_t start, size_t stop) |
Do nothing. | |
template<unsigned int ... prp> | |
void | hostToDevice (size_t start, size_t stop) |
Do nothing. | |
vector_custd_ker< typename apply_transform< memory_traits_inte, aggregate< T > >::type, memory_traits_inte > | toKernel () |
Convert the grid into a data-structure compatible for computing into GPU. | |
size_t | getLastError () |
Return the last error. | |
void | vector_overflow (size_t v1) const |
check that the id does not overflow the buffer | |
Static Public Member Functions | |
static bool | noPointers () |
This class has pointer inside. | |
Private Types | |
typedef memory_traits_inte< aggregate< T > >::type | layout |
Private Attributes | |
vector< aggregate< T >, CudaMemory, memory_traits_inte, grow_policy_double > | base |
1-D static grid | |
size_t | err_code = 0 |
Error code. | |
typedef void vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::base_to_copy |
Definition at line 48 of file map_vector_std_cuda.hpp.
typedef grow_policy_double vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::grow_policy |
growing policy of this vector
Definition at line 51 of file map_vector_std_cuda.hpp.
typedef vector_key_iterator vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::iterator_key |
iterator for the vector
Definition at line 44 of file map_vector_std_cuda.hpp.
|
private |
Definition at line 28 of file map_vector_std_cuda.hpp.
typedef memory_traits_inte<T> vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::layout_base_ |
Definition at line 41 of file map_vector_std_cuda.hpp.
typedef T vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::value_type |
Type of the value the vector is storing.
Definition at line 46 of file map_vector_std_cuda.hpp.
typedef int vector< T, CudaMemory, memory_traits_inte, grow_policy_double, STD_VECTOR >::yes_i_am_vector |
it define that it is a vector
Definition at line 39 of file map_vector_std_cuda.hpp.
|
inlinenoexcept |
Constructor, vector of size 0.
Definition at line 256 of file map_vector_std_cuda.hpp.
|
inlinenoexcept |
Constructor, vector of size sz.
Definition at line 262 of file map_vector_std_cuda.hpp.
|
inlinenoexcept |
Constructor from another vector.
Definition at line 268 of file map_vector_std_cuda.hpp.
|
inline |
Initializer from constructor.
v | Initializer list |
Definition at line 279 of file map_vector_std_cuda.hpp.
|
inlinenoexcept |
Constructor from another vector.
Definition at line 288 of file map_vector_std_cuda.hpp.
|
inline |
Constructor from iterators.
Definition at line 296 of file map_vector_std_cuda.hpp.
|
inlinenoexcept |
destructor
Definition at line 305 of file map_vector_std_cuda.hpp.
|
inline |
Add an empty object (it call the default constructor () ) at the end of the vector.
Definition at line 117 of file map_vector_std_cuda.hpp.
|
inline |
It insert a new object on the vector, eventually it reallocate the grid.
v | element to add |
vector_isel<T>::value
Definition at line 93 of file map_vector_std_cuda.hpp.
|
inline |
It insert a new object on the vector, eventually it reallocate the grid.
v | element to add |
vector_isel<T>::value
Definition at line 108 of file map_vector_std_cuda.hpp.
|
inline |
Definition at line 160 of file map_vector_std_cuda.hpp.
|
inline |
Remove all the element from the vector.
Definition at line 79 of file map_vector_std_cuda.hpp.
|
inline |
Do nothing.
Definition at line 387 of file map_vector_std_cuda.hpp.
|
inline |
Do nothing.
Definition at line 396 of file map_vector_std_cuda.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 188 of file map_vector_std_cuda.hpp.
|
inline |
Get an element of the vector.
p | must be 0 |
id | element to get |
Definition at line 206 of file map_vector_std_cuda.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 222 of file map_vector_std_cuda.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 237 of file map_vector_std_cuda.hpp.
|
inline |
Get an iterator over all the elements of the vector.
Definition at line 339 of file map_vector_std_cuda.hpp.
|
inline |
Get iterator until a specified element.
k | key |
Definition at line 351 of file map_vector_std_cuda.hpp.
|
inline |
|
inline |
Return the pointer to the chunk of memory.
Definition at line 361 of file map_vector_std_cuda.hpp.
|
inline |
Return the pointer to the chunk of memory.
Definition at line 371 of file map_vector_std_cuda.hpp.
|
inline |
Do nothing.
Definition at line 379 of file map_vector_std_cuda.hpp.
|
inline |
Do nothing.
Definition at line 405 of file map_vector_std_cuda.hpp.
|
inline |
Get the last element.
Definition at line 127 of file map_vector_std_cuda.hpp.
|
inline |
Get the last element.
Definition at line 141 of file map_vector_std_cuda.hpp.
|
inlinestatic |
|
inline |
Operator= copy the vector into another.
v | vector to copy |
Definition at line 327 of file map_vector_std_cuda.hpp.
|
inline |
Get an element of the vector.
id | element to get |
Definition at line 172 of file map_vector_std_cuda.hpp.
|
inline |
reserve a memory space in advance to avoid reallocation
ns | number of element the memory has to store |
Definition at line 250 of file map_vector_std_cuda.hpp.
|
inline |
\ brief Resize the vector to contain n elements
slot | number of elements |
Definition at line 71 of file map_vector_std_cuda.hpp.
|
inline |
return the size of the vector
Definition at line 60 of file map_vector_std_cuda.hpp.
|
inline |
swap the memory between the two vector
v | vector to swap |
Definition at line 155 of file map_vector_std_cuda.hpp.
|
inline |
swap the content of the vector
v | vector to be swapped with |
Definition at line 314 of file map_vector_std_cuda.hpp.
|
inline |
Convert the grid into a data-structure compatible for computing into GPU.
The object created can be considered like a reference of the original
Definition at line 417 of file map_vector_std_cuda.hpp.
|
inline |
check that the id does not overflow the buffer
v1 | id to check |
Definition at line 449 of file map_vector_std_cuda.hpp.
|
private |
1-D static grid
Definition at line 31 of file map_vector_std_cuda.hpp.
|
private |
Error code.
Definition at line 34 of file map_vector_std_cuda.hpp.