Skip to content
Snippets Groups Projects
Commit 000546f7 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Added a method ArrayView::copy for shallow copy.

parent 57de3baa
No related branches found
No related tags found
1 merge request!48Segments
......@@ -237,6 +237,15 @@ public:
typename = std::enable_if_t< std::is_convertible< T, ValueType >::value || IsArrayType< T >::value > >
ArrayView& operator=( const T& array );
/**
* \brief Shallow copy of the array view
*
* \param view Reference to the source array view.
* \return Reference to this array view.
*/
__cuda_callable__
ArrayView& copy( const ArrayView& view );
/**
* \brief Swaps this array view with another.
*
......
......@@ -118,6 +118,19 @@ operator=( const T& data )
return *this;
}
template< typename Value,
typename Device,
typename Index >
__cuda_callable__
ArrayView< Value, Device, Index >&
ArrayView< Value, Device, Index >::
copy( const ArrayView& view )
{
data = view.data;
size = view.size;
return *this;
}
template< typename Value,
typename Device,
typename Index >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment