Commit 575d1b6a authored by incardon's avatar incardon

Fixing hostToDevice for tensor object

parent bde44d6e
......@@ -353,9 +353,11 @@ struct host_to_device_impl
template<typename T>
inline void operator()(T& t) const
{
typedef decltype(boost::fusion::at_c<boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type::value>(dst).mem_r) mem_r_type;
typedef typename boost::mpl::at<v_prp,boost::mpl::int_<T::value>>::type ele_type;
typedef typename boost::mpl::at<typename T_type::type,boost::mpl::int_<T::value>>::type type_prp;
typedef decltype(boost::fusion::at_c<ele_type::value>(dst).mem_r) mem_r_type;
typedef typename boost::mpl::at<typename T_type::type,ele_type>::type type_prp;
typedef typename toKernel_transform<layout_base,typename mem_r_type::value_type>::type kernel_type;
......
......@@ -894,7 +894,10 @@ public:
Mem_type::swap(static_cast<Mem_type &>(cl));
static_cast<CellDecomposer_sm<dim,T,transform> &>(*this) = static_cast<const CellDecomposer_sm<dim,T,transform> &>(cl);
static_cast<CellDecomposer_sm<dim,T,transform> &>(*this).swap(static_cast<CellDecomposer_sm<dim,T,transform> &>(cl));
n_dec = cl.n_dec;
from_cd = cl.from_cd;
}
/*! \brief Get the Cell iterator
......
......@@ -245,6 +245,14 @@ public:
part_ids.resize(pl.size());
if (ite_gpu.wthr.x == 0)
{
// no particles
starts.resize(cl_n.size());
starts.template fill<0>(0);
return;
}
CUDA_LAUNCH((subindex<dim,T,cnt_type,ids_type>),ite_gpu,div_c,
spacing_c,
off,
......
......@@ -241,7 +241,7 @@ template<unsigned int dim ,typename T> class Point
* \return the distance
*
*/
T distance(const Point<dim,T> & q)
__device__ __host__ T distance(const Point<dim,T> & q)
{
T tot = 0.0;
......
......@@ -66,6 +66,35 @@ public:
return base.size();
}
/*! \brief Get an element of the vector
*
* Get an element of the vector
*
* \tparam p Property to get
* \param id Element to get
*
* \return the element value requested
*
*/
__device__ inline auto at(size_t id) const -> decltype(base.template get<0>(0))
{
return base.template get<0>(id);
}
/*! \brief Get an element of the vector
*
* Get an element of the vector
*
* \tparam p Property to get
* \param id Element to get
*
* \return the element value requested
*
*/
__device__ inline auto at(size_t id) -> decltype(base.template get<0>(0))
{
return base.template get<0>(id);
}
/*! \brief Get an element of the vector
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment