diff --git a/openfpm_data b/openfpm_data index e30dfdc101bba9f28aaef428bf5d11993feea92e..193451ddb8ded1923d9fe32db5fc99c527ffa28c 160000 --- a/openfpm_data +++ b/openfpm_data @@ -1 +1 @@ -Subproject commit e30dfdc101bba9f28aaef428bf5d11993feea92e +Subproject commit 193451ddb8ded1923d9fe32db5fc99c527ffa28c diff --git a/openfpm_numerics b/openfpm_numerics index 95f209ff1342376341d3ee1c99296c0976186186..37a39c223136e1d8b2e8a943380e025507bcdd35 160000 --- a/openfpm_numerics +++ b/openfpm_numerics @@ -1 +1 @@ -Subproject commit 95f209ff1342376341d3ee1c99296c0976186186 +Subproject commit 37a39c223136e1d8b2e8a943380e025507bcdd35 diff --git a/src/Vector/vector_dist_kernel.hpp b/src/Vector/vector_dist_kernel.hpp index b06a0a98c23f50c681a2f77788b01d56aa8535f4..89250e0f8db34708fbee45548875ffbced750a6b 100644 --- a/src/Vector/vector_dist_kernel.hpp +++ b/src/Vector/vector_dist_kernel.hpp @@ -167,6 +167,62 @@ public: return v_pos.template get<0>(vec_key.getKey()); } + /*! \brief Get the position of an element + * + * see the vector_dist iterator usage to get an element key + * + * \param vec_key element + * + * \return the position of the element in space + * + */ + __device__ __host__ inline auto getPosOrig(int vec_key) -> decltype(v_pos.template get<0>(vec_key)) + { + return v_pos.template get<0>(vec_key); + } + + /*! \brief Get the position of an element + * + * see the vector_dist iterator usage to get an element key + * + * \param vec_key element + * + * \return the position of the element in space + * + */ + __device__ __host__ inline auto getPosOrig(const vect_dist_key_dx & vec_key) -> decltype(v_pos.template get<0>(vec_key.getKey())) + { + return v_pos.template get<0>(vec_key.getKey()); + } + + /*! \brief Get the position of an element + * + * see the vector_dist iterator usage to get an element key + * + * \param vec_key element + * + * \return the position of the element in space + * + */ + __device__ __host__ inline auto getPosOrig(int vec_key) const -> decltype(v_pos.template get<0>(vec_key)) + { + return v_pos.template get<0>(vec_key); + } + + /*! \brief Get the position of an element + * + * see the vector_dist iterator usage to get an element key + * + * \param vec_key element + * + * \return the position of the element in space + * + */ + __device__ __host__ inline auto getPosOrig(const vect_dist_key_dx & vec_key) const -> decltype(v_pos.template get<0>(vec_key.getKey())) + { + return v_pos.template get<0>(vec_key.getKey()); + } + /*! \brief Get the property of an element * * see the vector_dist iterator usage to get an element key diff --git a/src/Vector/vector_dist_subset.hpp b/src/Vector/vector_dist_subset.hpp index dec6e94641b98e0b006c5c4ea566fc8578e62b7e..a674b70561b5258d05735cc991fd97e09d08c0c7 100644 --- a/src/Vector/vector_dist_subset.hpp +++ b/src/Vector/vector_dist_subset.hpp @@ -283,6 +283,27 @@ public: return vd.getPos(vect_dist_key_dx(pid.template get<0>(vec_key.getKey()))); } + /*! \brief Move the memory from the device to host memory + * + * \tparam property to move use POS_PROP for position property + * + */ + template<unsigned int ... prp> + inline void hostToDeviceProp() + { + vd.template hostToDeviceProp<prp ...>(); + } + + /*! \brief Move the memory from the device to host memory + * + * \tparam property to move use POS_PROP for position property + * + */ + inline void hostToDevicePos() + { + vd.template hostToDevicePos<0>(); + } + /*! \brief Get the position of an element * * see the vector_dist iterator usage to get an element key