Visible to Intel only — GUID: GUID-8442670A-CC14-4EFF-B22D-19F32B829B7C
Visible to Intel only — GUID: GUID-8442670A-CC14-4EFF-B22D-19F32B829B7C
extent_d template function
template<int DimensionT, typename ObjT>
auto extent_d(const ObjT &a_obj)
The template function offers a consistent way to determine the extent of a dimension for a multi-dimensional object. It can avoid extracting an entire n_extent_t<…> when only the extent of a single dimension is needed.
Template Argument | Description |
---|---|
int DimensionT |
0 based index starting at the leftmost dimension indicating which n-dimensions to query the extent of. Requirements: DimensionT >=0 and DimensionT < ObjT::rank |
typename ObjT |
The type of n-dimensional object from which to retrieve the extent. Requirements: ObtT is one of: n_container<…> n_extent_t<…> n_extent_generator<…> |
Returns
The correctly typed extent corresponding to the requested DimensionT of a_obj.
Example
template <typename VolumeT>
void foo(const VolumeT & a_volume)
{
int extent_z = extent_d<0>(volume);
int extent_y = extent_d<1>(volume);
int extent_x = extent_d<2>(volume);
/…
}