Commit d0bdb3bb authored by Tomáš Oberhuber's avatar Tomáš Oberhuber

Added types documentation to Array and ArrayView.

parent fa20f0e2
......@@ -74,15 +74,51 @@ class Array
{
public:
/**
* \brief Type of elements stored in this array.
*/
using ValueType = Value;
/**
* \brief Device where the array is allocated.
*
* See \ref Devices::Host or \ref Devices::Cuda.
*/
using DeviceType = Device;
/**
* \brief Type being used for the array elements indexing.
*/
using IndexType = Index;
/**
* \brief Allocator type used for allocating this array.
*
* See \ref Allocators::Cuda, \ref Allocators::CudaHost, \ref Allocators::CudaManaged, \ref Allocators::Host or \ref Allocators:Default.
*/
using AllocatorType = Allocator;
using HostType = Containers::Array< Value, Devices::Host, Index >;
using CudaType = Containers::Array< Value, Devices::Cuda, Index >;
/**
* \brief Defines the same array type but allocated on host (CPU).
*/
using HostType = Array< Value, TNL::Devices::Host, Index >;
/**
* \brief Defines the same array type but allocated on CUDA device (GPU).
*/
using CudaType = Array< Value, TNL::Devices::Cuda, Index >;
/**
* \brief Compatible ArrayView type.
*/
using ViewType = ArrayView< Value, Device, Index >;
/**
* \brief Compatible constant ArrayView type.
*/
using ConstViewType = ArrayView< std::add_const_t< Value >, Device, Index >;
/**
* \brief Constructs an empty array with zero size.
*/
......
......@@ -63,12 +63,41 @@ template< typename Value,
class ArrayView
{
public:
/**
* \brief Type of elements stored in this array.
*/
using ValueType = Value;
/**
* \brief Device where the array is allocated.
*
* See \ref Devices::Host or \ref Devices::Cuda.
*/
using DeviceType = Device;
/**
* \brief Type being used for the array elements indexing.
*/
using IndexType = Index;
using HostType = ArrayView< Value, Devices::Host, Index >;
using CudaType = ArrayView< Value, Devices::Cuda, Index >;
/**
* \brief Defines the same array type but allocated on host (CPU).
*/
using HostType = ArrayView< Value, TNL::Devices::Host, Index >;
/**
* \brief Defines the same array type but allocated on CUDA device (GPU).
*/
using CudaType = ArrayView< Value, TNL::Devices::Cuda, Index >;
/**
* \brief Compatible ArrayView type.
*/
using ViewType = ArrayView< Value, Device, Index >;
/**
* \brief Compatible constant ArrayView type.
*/
using ConstViewType = ArrayView< std::add_const_t< Value >, Device, Index >;
/**
......
......@@ -76,7 +76,15 @@ public:
* \brief Defines the same vector type but allocated on CUDA device (GPU).
*/
using CudaType = Vector< Real, TNL::Devices::Cuda, Index >;
/**
* \brief Compatible VectorView type.
*/
using ViewType = VectorView< Real, Device, Index >;
/**
* \brief Compatible constant VectorView type.
*/
using ConstViewType = VectorView< std::add_const_t< Real >, Device, Index >;
// constructors and assignment operators inherited from the class Array
......
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