HCC
HCC is a single-source, C/C++ compiler for heterogeneous computing. It's optimized with HSA (http://www.hsafoundation.com/).
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
Concurrency::tiled_index< D0, D1, D2 > Class Template Reference

Represents a set of related indices subdivided into 1-, 2-, or 3-dimensional tiles. More...

#include <amp.h>

Collaboration diagram for Concurrency::tiled_index< D0, D1, D2 >:
Collaboration graph

Public Member Functions

 tiled_index (const tiled_index< D0, D1, D2 > &o)
 Copy constructor. More...
 
 operator const index< 3 > () const
 Implicit conversion operator that converts a tiled_index<D0,D1,D2> into an index<N>. More...
 
 tiled_index (const index< 3 > &g)
 

Public Attributes

const index< 3 > global
 An index of rank 1, 2, or 3 that represents the global index within an extent.
 
const index< 3 > local
 An index of rank 1, 2, or 3 that represents the relative index within the current tile of a tiled extent.
 
const index< 3 > tile
 An index of rank 1, 2, or 3 that represents the coordinates of the current tile of a tiled extent.
 
const index< 3 > tile_origin
 An index of rank 1, 2, or 3 that represents the global coordinates of the origin of the current tile within a tiled extent.
 
const tile_barrier barrier
 An object which represents a barrier within the current tile of threads.
 

Static Public Attributes

static const int rank = 3
 A static member of tiled_index that contains the rank of this tiled extent, and is either 1, 2, or 3 depending on the specialization used.
 
static const int tile_dim0 = D0
 These constants allow access to the template arguments of tiled_index.
 
static const int tile_dim1 = D1
 These constants allow access to the template arguments of tiled_index.
 
static const int tile_dim2 = D2
 These constants allow access to the template arguments of tiled_index.
 

Friends

template<int D0_, int D1_, int D2_, typename K >
void parallel_for_each (const accelerator_view &, tiled_extent< D0_, D1_, D2_ >, const K &)
 
const Concurrency::extent< 3 > tile_extent
 Returns an instance of an extent<N> that captures the values of the tiled_index template arguments D0, D1, and D2. More...
 
Concurrency::extent< 3 > get_tile_extent () const
 Returns an instance of an extent<N> that captures the values of the tiled_index template arguments D0, D1, and D2. More...
 

Detailed Description

template<int D0, int D1 = 0, int D2 = 0>
class Concurrency::tiled_index< D0, D1, D2 >

Represents a set of related indices subdivided into 1-, 2-, or 3-dimensional tiles.

Template Parameters
D0,D1,D2The length of the tile in each specified dimension, where D0 is the most-significant dimension and D2 is the least-significant.

Constructor & Destructor Documentation

template<int D0, int D1 = 0, int D2 = 0>
Concurrency::tiled_index< D0, D1, D2 >::tiled_index ( const tiled_index< D0, D1, D2 > &  o)
inline

Copy constructor.

Constructs a new tiled_index from the supplied argument "other".

Parameters
[in]otherAn object of type tiled_index from which to initialize this.

Member Function Documentation

template<int D0, int D1 = 0, int D2 = 0>
Concurrency::extent<3> Concurrency::tiled_index< D0, D1, D2 >::get_tile_extent ( ) const
inline

Returns an instance of an extent<N> that captures the values of the tiled_index template arguments D0, D1, and D2.

For example:

index<3> zero;
tiled_index<64,16,4> ti(index<3>(256,256,256), zero, zero, zero, mybarrier);
extent<3> myTileExtent = ti.tile_extent;
assert(myTileExtent.tile_dim0 == 64);
assert(myTileExtent.tile_dim1 == 16);
assert(myTileExtent.tile_dim2 == 4);
template<int D0, int D1 = 0, int D2 = 0>
Concurrency::tiled_index< D0, D1, D2 >::operator const index< 3 > ( ) const
inline

Implicit conversion operator that converts a tiled_index<D0,D1,D2> into an index<N>.

The implicit conversion converts to the .global index member.

Member Data Documentation

template<int D0, int D1 = 0, int D2 = 0>
const Concurrency::extent<3> Concurrency::tiled_index< D0, D1, D2 >::tile_extent

Returns an instance of an extent<N> that captures the values of the tiled_index template arguments D0, D1, and D2.

For example:

index<3> zero;
tiled_index<64,16,4> ti(index<3>(256,256,256), zero, zero, zero, mybarrier);
extent<3> myTileExtent = ti.tile_extent;
assert(myTileExtent.tile_dim0 == 64);
assert(myTileExtent.tile_dim1 == 16);
assert(myTileExtent.tile_dim2 == 4);

The documentation for this class was generated from the following file: