cuda::experimental::stf::shape_of< mdspan< T, P… > >#
-
template<typename T, typename ...P>
class shape_of<mdspan<T, P...>> : public cuda::experimental::stf::shape_of<T># Specialization of the
shapetemplate formdspanCopies a shape.
All
shape_ofspecializations must define this constructor.-
shape_of(const shape_of&) = default#
Extracts the shape from a given slice.
All
shape_ofspecializations must define this constructor.- Parameters:
x – object to get the shape from
-
inline explicit shape_of(const described_type &x)#
Extracts the shape from a given slice.
All
shape_ofspecializations must define this constructor.- Parameters:
x – object to get the shape from
-
inline explicit shape_of(const coords_t &sizes)#
Create a new
shape_ofobject from acoords_tobject.Initializes dimensions to
size0,sizes.... This constructor is optional.- Template Parameters:
Sizes – Types (all must convert to
size_timplicitly)- Parameters:
size0 – Size for the first dimension (
sizes – Sizes of data for the other dimensions, one per dimension
-
template<typename ...Sizes>
inline explicit shape_of( - size_t size0,
- Sizes&&... sizes
Create a new
shape_ofobject taking exactlydimensionsizes.Initializes dimensions to
size0,sizes.... This constructor is optional.- Template Parameters:
Sizes – Types (all must convert to
size_timplicitly)- Parameters:
size0 – Size for the first dimension (
sizes – Sizes of data for the other dimensions, one per dimension
Constructors
Public Types
-
using coords_t = array_tuple<size_t, described_type::rank()>#
Public Functions
-
inline auto begin()#
-
inline auto end()#
-
shape_of() = default#
The default constructor builds a shape with size 0 in all dimensions.
All
shape_ofspecializations must define this constructor.
-
inline constexpr size_t extent(size_t dim) const#
Returns the size of a slice in a given dimension (run-time version)
This member function is optional.
- Template Parameters:
dim – The dimension to get the size for. Must be
< dimensions- Returns:
size_t The size
-
inline constexpr size_t stride(size_t dim) const#
Get the stride for a specified dimension.
- Parameters:
dim – The dimension for which to get the stride.
- Returns:
The stride for the specified dimension.
-
inline size_t size() const#
Total size of the slice in all dimensions (product of the sizes)
This member function is optional.
- Returns:
size_t The total size
-
inline ::std::array<size_t, rank()> get_sizes() const#
Returns an array with sizes in all dimensions.
- Returns:
const std::array<size_t, dimensions>&
- void set_contiguous_strides(
- const ::std::array<size_t, rank()> &sizes
Set contiguous strides based on the provided sizes.
Note
This function should not be called (calling it will engender a link-time error).
- Parameters:
sizes – The sizes to set the contiguous strides.
-
inline described_type create(T *base) const#
Create a new
described_typeobject with the given base pointer.- Parameters:
base – Base pointer to create the described_type object.
- Returns:
described_type Newly created described_type object.
Public Static Functions
-
static inline constexpr size_t rank()#
Dimensionality of the slice.
-
shape_of(const shape_of&) = default#