OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
vector_dist_key.hpp
1/*
2 * vector_dist_key.hpp
3 *
4 * Created on: Mar 10, 2015
5 * Author: i-bird
6 */
7
8#ifndef VECTOR_DIST_KEY_HPP_
9#define VECTOR_DIST_KEY_HPP_
10
11
12
20{
22
23 size_t key;
24
25public:
26
32 __device__ __host__ inline void setKey(size_t key)
33 {
34 this->key = key;
35 }
36
42 __device__ __host__ inline size_t getKey() const
43 {
44 return key;
45 }
46
52 std::string to_string()
53 {
54 std::stringstream ts;
55
56 ts << "x[0]=" << key;
57
58 return ts.str();
59 }
60
62 __device__ __host__ inline vect_dist_key_dx()
63 {
64 /* coverity[uninit_member] */
65 }
66
67 __device__ __host__ inline vect_dist_key_dx(size_t key)
68 :key(key)
69 {
70 }
71};
72
73
74
75#endif /* VECTOR_DIST_KEY_HPP_ */
Grid key for a distributed grid.
__device__ __host__ size_t getKey() const
Get the key.
__device__ __host__ vect_dist_key_dx()
Default constructor.
size_t key
Local grid iterator.
std::string to_string()
Convert the key into a string message.
__device__ __host__ void setKey(size_t key)
set the key