Interface concept for objects describing a multidimensional data source.
More...
#include <IDataSource.hpp>
template<typename T>
typename T::value_type;
typename T::index_type;
requires std::movable<std::remove_const_t<T>>;
Check whether the specified data type T_To can be assigned to T_From.
Interface concept for objects describing a multidimensional data source.
The bool operator returns true if the access operator returns valid values.
For example, memory access may be invalid after moving the DataSource.
static_cast<bool>(t);
{ T::dim() } -> std::same_as<uint32_t>;
requires (!requires { typename T::reference; } &&
requires { { t[vec] } -> std::same_as<typename T::value_type>;})
|| requires { typename T::reference; };
requires
(T::dim() != 1u) ||
(T::dim() == 1u && !requires { typename T::reference; } &&
requires {{ t[0] } -> std::same_as<typename T::value_type>; })
|| requires { typename T::reference; };
{ t.getAlignment() } -> alpaka::concepts::Alignment;
- Todo
- implement concept alpaka::concepts::Extents and use it as return value
- Todo
- implement concept alpaka::concepts::Pitches and use it as return value
Interface concept for objects describing a multidimensional data source.
An object that implements the interface returns a value for a multidimensional index. Therefore, it behaves like multidimensional memory that can only be read. It is not permitted to write a new value to an index position. An IDataSource object has an immutable, fixed multidimensional size. The IDataSource object is not required to reference the storage. It may create or calculate the data instead of reading it from memory.
The immutable extent is required for algorithms such as alpaka::onHost::transform.
- Parameters
-
| t | Object that implements the IDataSource interface. May or may not have a const modifier. |
| vec | Vector with the same number of elements as the dimension of the IDataSource like object. Used to call the access operator. |
Member types
- T::value_type: The element type. May or may not be const.
- T::index_type: The index type of the pitch.
- Note
- The access operator [] with an integral as an argument is only available if the dimension is one.
Definition at line 43 of file IDataSource.hpp.