STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Concurrency::array< _Value_type, _Rank > Class Template Reference

An array is a multi-dimensional data aggregate on a accelerator_view. More...

#include <amp.h>

Public Types

typedef _Value_type value_type
 

Public Member Functions

 array (const Concurrency::extent< _Rank > &_Extent) __CPU_ONLY
 Construct an array from extents More...
 
 array (int _E0) __CPU_ONLY
 Construct array<T,1> with the extent _E0 More...
 
 array (int _E0, int _E1) __CPU_ONLY
 Construct an array<T,2> from two integer extents. More...
 
 array (int _E0, int _E1, int _E2) __CPU_ONLY
 Construct an array<T,3> from three integer extents. More...
 
 array (const Concurrency::extent< _Rank > &_Extent, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array from extents, bound to a specific accelerator_view. More...
 
 array (int _E0, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct array<T,1> with the extent _E0, bound to a specific accelerator_view. More...
 
 array (int _E0, int _E1, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array<T,2> from two integer extents, bound to a specific accelerator_view. More...
 
 array (int _E0, int _E1, int _E2, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array<T,3> from three integer extents, bound to a specific accelerator_view. More...
 
 array (const Concurrency::extent< _Rank > &_Extent, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view. More...
 
 array (int _E0, accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view. More...
 
 array (int _E0, int _E1, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view. More...
 
 array (int _E0, int _E1, int _E2, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first, _InputIterator _Src_last) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first) __CPU_ONLY
 Construct an array initialized from an iterator. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first, _InputIterator _Src_last) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first) __CPU_ONLY
 Construct an array initialized from an iterator. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first, _InputIterator _Src_last) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first) __CPU_ONLY
 Construct an array initialized from an iterator. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first, _InputIterator _Src_last) __CPU_ONLY
 Construct an array initialized from an iterator. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first) __CPU_ONLY
 Construct an array initialized from an iterator. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from an iterator into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from an iterator into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from an iterator into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first, Concurrency::accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from an iterator into a container, bound to a specific accelerator_view. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (const Concurrency::extent< _Rank > &_Extent, _InputIterator _Src_first, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from an iterator into a container. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (int _E0, _InputIterator _Src_first, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av)
 Construct a staging array between two associated accelerator_view, initialized from an iterator into a container. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, _InputIterator _Src_first, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from an iterator into a container. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first, _InputIterator _Src_last, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container. More...
 
template<typename _InputIterator >
 array (int _E0, int _E1, int _E2, _InputIterator _Src_first, Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_view, initialized from an iterator into a container. More...
 
 array (const array_view< const _Value_type, _Rank > &_Src) __CPU_ONLY
 Construct an array initialized from an array_view. More...
 
 array (const array_view< const _Value_type, _Rank > &_Src, accelerator_view _Av, access_type _Cpu_access_type=access_type_auto) __CPU_ONLY
 Construct an array initialized from an array_view, bound to a specific accelerator_view. More...
 
 array (const array_view< const _Value_type, _Rank > &_Src, accelerator_view _Av, accelerator_view _Associated_Av) __CPU_ONLY
 Construct a staging array between two associated accelerator_views, initialized from an array_view. More...
 
 array (const array &_Other) __CPU_ONLY
 Copy constructor. Deep copy. More...
 
 array (array &&_Other) __CPU_ONLY
 Move constructor. More...
 
arrayoperator= (const array &_Other) __CPU_ONLY
 Copy Assignment operator. Deep copy. More...
 
arrayoperator= (array &&_Other) __CPU_ONLY
 Move Assignment operator. More...
 
arrayoperator= (const array_view< const _Value_type, _Rank > &_Src) __CPU_ONLY
 Assignment operator from an array_view More...
 
void copy_to (array< _Value_type, _Rank > &_Dest) const __CPU_ONLY
 Copies elements from this array to the destination array. More...
 
void copy_to (const array_view< _Value_type, _Rank > &_Dest) const __CPU_ONLY
 Copies elements from this array to the destination array_view. More...
 
__declspec(property(get=get_extent)) Concurrency Concurrency::extent< _Rank > get_extent () const __GPU
 Returns the extent that defines the shape of this array. More...
 
__declspec(property(get=get_accelerator_view)) Concurrency Concurrency::accelerator_view get_accelerator_view () const __CPU_ONLY
 Returns the accelerator_view where this array is located. More...
 
__declspec(property(get=get_associated_accelerator_view)) Concurrency Concurrency::accelerator_view get_associated_accelerator_view () const __CPU_ONLY
 Returns the accelerator_view that is the preferred target where this array can be copied. More...
 
 __declspec (property(get=get_cpu_access_type)) access_type cpu_access_type
 Returns the CPU access_type allowed for this array. More...
 
access_type get_cpu_access_type () const __CPU_ONLY
 
value_typeoperator[] (const index< _Rank > &_Index) __GPU
 Get the element value indexed by _I More...
 
const value_typeoperator[] (const index< _Rank > &_Index) const __GPU
 Get the element value indexed by _I More...
 
details::_Projection_result_type< _Value_type, _Rank >::_Result_type operator[] (int _I) __GPU
 Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions. More...
 
details::_Projection_result_type< _Value_type, _Rank >::_Const_result_type operator[] (int _I) const __GPU
 Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions. More...
 
value_typeoperator() (const index< _Rank > &_Index) __GPU
 Get the element value indexed by _I More...
 
const value_typeoperator() (const index< _Rank > &_Index) const __GPU
 Get the element value indexed by _Index More...
 
value_typeoperator() (int _I0, int _I1) __GPU
 Get the element value indexed by (_I0,_I1) More...
 
const value_typeoperator() (int _I0, int _I1) const __GPU
 Get the element value indexed by (_I0,_I1) More...
 
value_typeoperator() (int _I0, int _I1, int _I2) __GPU
 Get the element value indexed by (_I0,_I1,_I2) More...
 
const value_typeoperator() (int _I0, int _I1, int _I2) const __GPU
 Get the element value indexed by (_I0,_I1,_I2) More...
 
details::_Projection_result_type< _Value_type, _Rank >::_Result_type operator() (int _I) __GPU
 Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions. More...
 
details::_Projection_result_type< _Value_type, _Rank >::_Const_result_type operator() (int _I) const __GPU
 Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions. More...
 
array_view< _Value_type, _Rank > section (const Concurrency::index< _Rank > &_Section_origin, const Concurrency::extent< _Rank > &_Section_extent) __GPU
 Produces a subsection of the source array at the given origin and extent. More...
 
array_view< const _Value_type, _Rank > section (const Concurrency::index< _Rank > &_Section_origin, const Concurrency::extent< _Rank > &_Section_extent) const __GPU
 Produces a subsection of the source array at the given origin and extent. More...
 
array_view< _Value_type, _Rank > section (const Concurrency::extent< _Rank > &_Ext) __GPU
 Produces a subsection of the source array_view with origin of zero, with an extent of _Ext. More...
 
array_view< const _Value_type, _Rank > section (const Concurrency::extent< _Rank > &_Ext) const __GPU
 Produces a subsection of the source array_view with origin of zero, with an extent of _Ext. More...
 
array_view< _Value_type, _Rank > section (const index< _Rank > &_Idx) __GPU
 Produces a subsection of the source array with origin specified by an index, with an extent of (this->exent - _Idx). More...
 
array_view< const _Value_type, _Rank > section (const index< _Rank > &_Idx) const __GPU
 Produces a subsection of the source array with origin specified by an index, with an extent of (this->exent - _Idx). More...
 
array_view< _Value_type, 1 > section (int _I0, int _E0) __GPU
 Produces a one-dimensional subsection of the source array with origin specified by the index components _I0, with extent _E0. More...
 
array_view< const _Value_type, 1 > section (int _I0, int _E0) const __GPU
 Produces a one-dimensional subsection of the source array with origin specified by the index components _I0, with extent _E0. More...
 
array_view< _Value_type, 2 > section (int _I0, int _I1, int _E0, int _E1) __GPU
 Produces a two-dimensional subsection of the source array with origin specified by the index components (_I0,_I1), with extent (_E0,_E1). More...
 
array_view< const _Value_type, 2 > section (int _I0, int _I1, int _E0, int _E1) const __GPU
 Produces a two-dimensional subsection of the source array with origin specified by the index components (_I0,_I1), with extent (_E0,_E1). More...
 
array_view< _Value_type, 3 > section (int _I0, int _I1, int _I2, int _E0, int _E1, int _E2) __GPU
 Produces a three-dimensional subsection of the source array with origin specified by the index components (_I0,_I1,_I2), with extent (_E0,_E1,_E2). More...
 
array_view< const _Value_type, 3 > section (int _I0, int _I1, int _I2, int _E0, int _E1, int _E2) const __GPU
 Produces a three-dimensional subsection of the source array with origin specified by the index components (_I0,_I1,_I2), with extent (_E0,_E1,_E2). More...
 
template<typename _Value_type2 >
array_view< _Value_type2, 1 > reinterpret_as () __GPU
 Produces a (possibly unsafe) reinterpretation of this array that is linear and with a different element type. More...
 
template<typename _Value_type2 >
array_view< const _Value_type2, 1 > reinterpret_as () const __GPU
 Produces a (possibly unsafe) reinterpretation of this array that is linear and with a different element type. More...
 
template<int _New_rank>
array_view< _Value_type, _New_rank > view_as (const Concurrency::extent< _New_rank > &_View_extent) __GPU
 Produces an array_view of a different rank over this array's data. More...
 
template<int _New_rank>
array_view< const _Value_type, _New_rank > view_as (const Concurrency::extent< _New_rank > &_View_extent) const __GPU
 Produces an array_view of a different rank over this array's data. More...
 
 operator std::vector< _Value_type > () const __CPU_ONLY
 Implicitly converts this array into a vector by copying. More...
 
_Ret_ _Value_type * data () __GPU
 Returns a pointer to the raw data of this array. More...
 
const _Value_type * data () const __GPU
 Returns a pointer to the raw data of this array. More...
 
 ~array () __CPU_ONLY
 Destroys this array and reclaims resources. More...
 

Static Public Attributes

static const int rank = _Rank
 

Private Types

typedef details::_Buffer_descriptor _Buffer_descriptor
 
typedef _Array_flatten_helper< _Rank, typename Concurrency::extent< _Rank >::value_type, typename Concurrency::index< _Rank >::value_type_Flatten_helper
 

Private Member Functions

 _CPP_AMP_VERIFY_RANK (_Rank, array)
 
 array () __CPU_ONLY
 
 array (const Concurrency::extent< _Rank > &_Extent, _Buffer_descriptor _Buffer_descriptor)
 
unsigned int _Initialize () __CPU_ONLY
 
void _Initialize (Concurrency::accelerator_view _Av, access_type _Cpu_access_type) __CPU_ONLY
 
template<typename _InputIterator >
void _Initialize (Concurrency::accelerator_view _Av, _InputIterator _Src_first, _InputIterator _Src_last, access_type _Cpu_access_type) __CPU_ONLY
 
void _Initialize (Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av) __CPU_ONLY
 
template<typename _InputIterator >
void _Initialize (Concurrency::accelerator_view _Av, Concurrency::accelerator_view _Associated_Av, _InputIterator _Src_first, _InputIterator _Src_last) __CPU_ONLY
 
void _Register () __CPU_ONLY
 
void _Register_copy (const array &_Other) __CPU_ONLY
 
void _Unregister () __CPU_ONLY
 
_Ret_ _Ubiquitous_buffer_Get_buffer () __CPU_ONLY const
 
_Event _Get_access_async (_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) __CPU_ONLY const
 
_Ret_ _View_shape_Create_buffer_view_shape () const
 
bool _Has_cpu_access () const __CPU_ONLY
 
void _Refresh_data_ptr (_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
 
void _Refresh_data_ptr (_Access_mode _Requested_mode, bool _Exception=true) __GPU_ONLY
 

Private Attributes

Concurrency::extent< _Rank > _M_extent
 
_Buffer_descriptor _M_buffer_descriptor
 
Concurrency::extent< _Rank > _M_multiplier
 

Friends

template<typename _Value_type , int _Rank>
array< _Value_type, _Rank > direct3d::make_array (const Concurrency::extent< _Rank > &_Extent, const Concurrency::accelerator_view &_Av, _In_ IUnknown *_D3D_buffer) __CPU_ONLY
 
const _Buffer_descriptordetails::_Get_buffer_descriptor (const array< _Value_type, _Rank > &_Array) __GPU
 
_Ret_ _Ubiquitous_bufferdetails::_Get_buffer (const array< _Value_type, _Rank > &_Array) __CPU_ONLY
 
_Event details::_Get_access_async (const array< _Value_type, _Rank > &_Array, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr) __CPU_ONLY
 

Detailed Description

template<typename _Value_type, int _Rank = 1>
class Concurrency::array< _Value_type, _Rank >

An array is a multi-dimensional data aggregate on a accelerator_view.

Parameters
_RankThe dimensionality of this array.
_Value_typeThe type of the elements in the array.

Member Typedef Documentation

template<typename _Value_type, int _Rank = 1>
typedef details::_Buffer_descriptor Concurrency::array< _Value_type, _Rank >::_Buffer_descriptor
private
template<typename _Value_type, int _Rank = 1>
typedef _Array_flatten_helper<_Rank, typename Concurrency::extent<_Rank>::value_type, typename Concurrency::index<_Rank>::value_type> Concurrency::array< _Value_type, _Rank >::_Flatten_helper
private
template<typename _Value_type, int _Rank = 1>
typedef _Value_type Concurrency::array< _Value_type, _Rank >::value_type

Constructor & Destructor Documentation

template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent)
inlineexplicit

Construct an array from extents

Parameters
_ExtentAn extent that describes the shape of the array.
3859  : _M_extent(_Extent)
3860  {
3862  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0)
inlineexplicit

Construct array<T,1> with the extent _E0

Parameters
_E0An integer that is the length of this array.
3872  {
3873  static_assert(_Rank == 1, "array(int) is only permissible on array<T, 1>");
3875  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1 
)
inlineexplicit

Construct an array<T,2> from two integer extents.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
3888  {
3889  static_assert(_Rank == 2, "array(int, int) is only permissible on array<T, 2>");
3891  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2 
)
inlineexplicit

Construct an array<T,3> from three integer extents.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
3906  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
3907  {
3908  static_assert(_Rank == 3, "array(int, int, int) is only permissible on array<T, 3>");
3910  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array from extents, bound to a specific accelerator_view.

Parameters
_ExtentAn extent that describes the shape of the array.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
3929  : _M_extent(_Extent)
3930  {
3931  _Initialize(_Av, _Cpu_access_type);
3932  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct array<T,1> with the extent _E0, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of this array.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
3952  {
3953  static_assert(_Rank == 1, "array(int, accelerator_view) is only permissible on array<T, 1>");
3954  _Initialize(_Av, _Cpu_access_type);
3955  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array<T,2> from two integer extents, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
3978  {
3979  static_assert(_Rank == 2, "array(int, int, accelerator_view) is only permissible on array<T, 2>");
3980  _Initialize(_Av, _Cpu_access_type);
3981  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array<T,3> from three integer extents, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4006  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4007  {
4008  static_assert(_Rank == 3, "array(int, int, int, accelerator_view) is only permissible on array<T, 3>");
4009  _Initialize(_Av, _Cpu_access_type);
4010  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view.

Parameters
_ExtentAn extent that describes the shape of the array.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4025  : _M_extent(_Extent)
4026  {
4027  _Initialize(_Av, _Associated_Av);
4028  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view.

Parameters
_E0An integer that is the length of this array.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4044  {
4045  static_assert(_Rank == 1, "array(int, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4046  _Initialize(_Av, _Associated_Av);
4047  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4066  {
4067  static_assert(_Rank == 2, "array(int, int, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4068  _Initialize(_Av, _Associated_Av);
4069  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4090  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4091  {
4092  static_assert(_Rank == 3, "array(int, int, int, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4093  _Initialize(_Av, _Associated_Av);
4094  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first,
_InputIterator  _Src_last 
)
inline

Construct an array initialized from a pair of iterators into a container.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
4109  : _M_extent(_Extent)
4110  {
4111  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4112  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first 
)
inline

Construct an array initialized from an iterator.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
4125  : _M_extent(_Extent)
4126  {
4127  _InputIterator _Src_last = _Src_first;
4128  std::advance(_Src_last, this->extent.size());
4129 
4130  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4131  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: amprt.h:103
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first,
_InputIterator  _Src_last 
)
inline

Construct an array initialized from a pair of iterators into a container.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
4147  {
4148  static_assert(_Rank == 1, "array(int, iterator, iterator) is only permissible on array<T, 1>");
4149  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4150  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first 
)
inline

Construct an array initialized from an iterator.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
4164  {
4165  static_assert(_Rank == 1, "array(int, iterator) is only permissible on array<T, 1>");
4166 
4167  _InputIterator _Src_last = _Src_first;
4168  std::advance(_Src_last, this->extent.size());
4169 
4170  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4171  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first,
_InputIterator  _Src_last 
)
inline

Construct an array initialized from a pair of iterators into a container.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
4190  {
4191  static_assert(_Rank == 2, "array(int, int, iterator, iterator) is only permissible on array<T, 2>");
4192  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4193  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first 
)
inline

Construct an array initialized from an iterator.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
4210  {
4211  static_assert(_Rank == 2, "array(int, int, iterator) is only permissible on array<T, 2>");
4212 
4213  _InputIterator _Src_last = _Src_first;
4214  std::advance(_Src_last, this->extent.size());
4215 
4216  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4217  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first,
_InputIterator  _Src_last 
)
inline

Construct an array initialized from an iterator.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
4236  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4237  {
4238  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator) is only permissible on array<T, 3>");
4239  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4240  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first 
)
inline

Construct an array initialized from an iterator.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
4259  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4260  {
4261  static_assert(_Rank == 3, "array(int, int, int, iterator) is only permissible on array<T, 3>");
4262 
4263  _InputIterator _Src_last = _Src_first;
4264  std::advance(_Src_last, this->extent.size());
4265 
4266  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4267  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
Definition: amprt.h:103
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4292  : _M_extent(_Extent)
4293  {
4294  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4295  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from an iterator into a container, bound to a specific accelerator_view.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4318  : _M_extent(_Extent)
4319  {
4320  _InputIterator _Src_last = _Src_first;
4321  std::advance(_Src_last, this->extent.size());
4322 
4323  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4324  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4350  {
4351  static_assert(_Rank == 1, "array(int, iterator, iterator) is only permissible on array<T, 1>");
4352  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4353  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from an iterator into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4377  {
4378  static_assert(_Rank == 1, "array(int, iterator) is only permissible on array<T, 1>");
4379 
4380  _InputIterator _Src_last = _Src_first;
4381  std::advance(_Src_last, this->extent.size());
4382 
4383  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4384  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4413  {
4414  static_assert(_Rank == 2, "array(int, int, iterator, iterator) is only permissible on array<T, 2>");
4415  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4416  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from an iterator into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4443  {
4444  static_assert(_Rank == 2, "array(int, int, iterator) is only permissible on array<T, 2>");
4445 
4446  _InputIterator _Src_last = _Src_first;
4447  std::advance(_Src_last, this->extent.size());
4448 
4449  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4450  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from a pair of iterators into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4481  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4482  {
4483  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator) is only permissible on array<T, 3>");
4484  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4485  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from an iterator into a container, bound to a specific accelerator_view.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4514  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4515  {
4516  static_assert(_Rank == 3, "array(int, int, int, iterator) is only permissible on array<T, 3>");
4517 
4518  _InputIterator _Src_last = _Src_first;
4519  std::advance(_Src_last, this->extent.size());
4520 
4521  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4522  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4543  : _M_extent(_Extent)
4544  {
4545  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4546  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from an iterator into a container.

Parameters
_ExtentAn extent that describes the shape of the array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4565  : _M_extent(_Extent)
4566  {
4567  _InputIterator _Src_last = _Src_first;
4568  std::advance(_Src_last, this->extent.size());
4569 
4570  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4571  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4593  {
4594  static_assert(_Rank == 1, "array(int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4595  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4596  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from an iterator into a container.

Parameters
_E0An integer that is the length of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4616  {
4617  static_assert(_Rank == 1, "array(int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4618 
4619  _InputIterator _Src_last = _Src_first;
4620  std::advance(_Src_last, this->extent.size());
4621 
4622  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4623  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4648  {
4649  static_assert(_Rank == 2, "array(int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4650  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4651  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from an iterator into a container.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4674  {
4675  static_assert(_Rank == 2, "array(int, int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4676 
4677  _InputIterator _Src_last = _Src_first;
4678  std::advance(_Src_last, this->extent.size());
4679 
4680  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4681  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from a pair of iterators into a container.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container.
_Src_lastAn ending iterator into the source container.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4708  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4709  {
4710  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4711  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4712  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
Concurrency::array< _Value_type, _Rank >::array ( int  _E0,
int  _E1,
int  _E2,
_InputIterator  _Src_first,
Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_view, initialized from an iterator into a container.

Parameters
_E0An integer that is the length of the most-significant dimension of this array.
_E1An integer that is the length of the next-to-most-significant dimension of this array.
_E2An integer that is the length of the least-significant dimension of this array.
_Src_firstA beginning iterator into the source container; if the number of available container elements starting at this iterator position is less than this->extent.size(), undefined behavior results.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvAn accelerator_view which specifies the preferred target location of the array.
4737  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4738  {
4739  static_assert(_Rank == 3, "array(int, int, int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4740 
4741  _InputIterator _Src_last = _Src_first;
4742  std::advance(_Src_last, this->extent.size());
4743 
4744  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4745  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:695
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const array_view< const _Value_type, _Rank > &  _Src)
inlineexplicit

Construct an array initialized from an array_view.

Parameters
_SrcAn array_view to copy from.
4754  :_M_extent(_Src.extent)
4755  {
4757  Concurrency::copy(_Src,*this);
4758  }
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_AMPIMP accelerator __cdecl _Select_default_accelerator()
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
Definition: amprt.h:103
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const array_view< const _Value_type, _Rank > &  _Src,
accelerator_view  _Av,
access_type  _Cpu_access_type = access_type_auto 
)
inline

Construct an array initialized from an array_view, bound to a specific accelerator_view.

Parameters
_SrcAn array_view to copy from.
_AvAn accelerator_view where this array resides.
_Cpu_access_typeThe desired access_type for the array on the CPU. This parameter has a default value of access_type_auto leaving the CPU access_type determination to the runtime. The actual CPU access_type for the array can be queried using the get_cpu_access_type method.
4777  :_M_extent(_Src.extent)
4778  {
4779  _Initialize(_Av, _Cpu_access_type);
4780  Concurrency::copy(_Src,*this);
4781  }
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const array_view< const _Value_type, _Rank > &  _Src,
accelerator_view  _Av,
accelerator_view  _Associated_Av 
)
inline

Construct a staging array between two associated accelerator_views, initialized from an array_view.

Parameters
_SrcAn array_view to copy from.
_AvAn accelerator_view which specifies the location of the array.
_Associated_AvThe accelerator_view that is associated with _Av.
4796  :_M_extent(_Src.extent)
4797  {
4798  _Initialize(_Av, _Associated_Av);
4799  Concurrency::copy(_Src,*this);
4800  }
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const array< _Value_type, _Rank > &  _Other)
inline

Copy constructor. Deep copy.

4806  : _M_extent(_Other._M_extent)
4807  {
4808  _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view);
4809  Concurrency::copy(_Other, *this);
4810  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( array< _Value_type, _Rank > &&  _Other)
inline

Move constructor.

4816  : _M_extent(_Other._M_extent), _M_multiplier(_Other._M_multiplier)
4817  , _M_buffer_descriptor(_Other._M_buffer_descriptor)
4818  {
4819  // Register this
4820  this->_Register_copy(_Other);
4821 
4822  // Release the _Other array
4823  _Other._Unregister();
4824  _Other._M_buffer_descriptor._M_data_ptr = NULL;
4825  _Other._M_buffer_descriptor._Set_buffer_ptr(NULL);
4826  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5723
#define NULL
Definition: crtdbg.h:30
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void _Register_copy(const array &_Other) __CPU_ONLY
Definition: amp.h:5617
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::~array ( )
inline

Destroys this array and reclaims resources.

5492  {
5493  bool _Can_throw = (std::current_exception() == nullptr);
5494 
5495  // Destructor should not throw if we are already processing
5496  // an exception and another exception will result in termination
5497  try {
5498  _Unregister();
5499  }
5500  catch(...)
5501  {
5502  if (_Can_throw) {
5503  throw;
5504  }
5505  }
5506  }
exception_ptr current_exception()
Definition: exception:527
void _Unregister() __CPU_ONLY
Definition: amp.h:5622
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( )
private
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const Concurrency::extent< _Rank > &  _Extent,
_Buffer_descriptor  _Buffer_descriptor 
)
inlineprivate
5515  : _M_extent(_Extent), _M_buffer_descriptor(_Buffer_descriptor)
5516  {
5517  _Initialize();
5518 
5519  // Register this
5520  this->_Register();
5521  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
void _Register() __CPU_ONLY
Definition: amp.h:5600
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717

Member Function Documentation

template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::__declspec ( property(get=get_cpu_access_type )

Returns the CPU access_type allowed for this array.

template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::_CPP_AMP_VERIFY_RANK ( _Rank  ,
array< _Value_type, _Rank >   
)
private
template<typename _Value_type, int _Rank = 1>
_Ret_ _View_shape* Concurrency::array< _Value_type, _Rank >::_Create_buffer_view_shape ( ) const
inlineprivate
5657  {
5658  _ASSERTE(_Get_buffer()->_Get_master_buffer_elem_size() == sizeof(_Value_type));
5659 
5660  unsigned int _ZeroOffset[_Rank] = {0};
5661  unsigned int _View_extent[_Rank];
5662  for(int i=0; i<_Rank; ++i)
5663  {
5664  _View_extent[i] = static_cast<unsigned int>(this->_M_extent[i]);
5665  }
5666  return _View_shape::_Create_view_shape(static_cast<unsigned int>(_Rank), 0, &_View_extent[0], &_ZeroOffset[0], &_View_extent[0]);
5667  }
int i[4]
Definition: dvec.h:70
#define _ASSERTE(expr)
Definition: crtdbg.h:216
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
_Event Concurrency::array< _Value_type, _Rank >::_Get_access_async ( _Access_mode  _Mode,
_Buffer_ptr _Buf_ptr,
bool  _Zero_copy_cpu_access = false 
) const
inlineprivate
5636  {
5637  _ASSERTE(!_Zero_copy_cpu_access || (_Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode() != _No_access));
5638 
5639  _Buffer_ptr _PBuf;
5640  Concurrency::accelerator_view _Access_av = _Zero_copy_cpu_access ? accelerator(accelerator::cpu_accelerator).default_view : this->accelerator_view;
5642  _Access_av,
5643  _Mode, _PBuf);
5644  _Buf_ptr = _PBuf;
5645 
5646  if (_Is_cpu_accelerator(_Access_av.accelerator)) {
5647  _Ev = _Ev._Add_continuation(std::function<_Event()>([_PBuf, this]() mutable -> _Event {
5648  const_cast<array*>(this)->_M_buffer_descriptor._M_data_ptr = _PBuf->_Get_host_ptr();
5649  return _Event();
5650  }));
5651  }
5652 
5653  return _Ev;
5654  }
friend class accelerator
Definition: amprt.h:1520
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:302
_AMPIMP _Event _Add_continuation(const std::function< _Event __cdecl()> &_Continuation_task)
Creates an event which is an ordered collection of this and a continuation task
_Check_return_ _In_ int _Mode
Definition: io.h:338
_Event _Get_access_async(const _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr)
Definition: amprt.h:3457
Definition: array:19
Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator ...
Definition: amprt.h:1518
static _AMPIMP const wchar_t cpu_accelerator[]
String constant for cpu accelerator
Definition: amprt.h:1111
#define _ASSERTE(expr)
Definition: crtdbg.h:216
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:532
void * _M_data_ptr
Definition: amprt.h:432
Definition: amprt.h:84
Definition: amprt.h:312
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3469
template<typename _Value_type, int _Rank = 1>
_Ret_ _Ubiquitous_buffer* Concurrency::array< _Value_type, _Rank >::_Get_buffer ( ) const
inlineprivate
5631  {
5633  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:497
template<typename _Value_type, int _Rank = 1>
bool Concurrency::array< _Value_type, _Rank >::_Has_cpu_access ( ) const
inlineprivate
5670  {
5671  return (_Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode() != _No_access);
5672  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
Definition: amprt.h:84
template<typename _Value_type, int _Rank = 1>
unsigned int Concurrency::array< _Value_type, _Rank >::_Initialize ( )
inlineprivate
5525  {
5527 
5528  // Arrays always have a type access mode of '_Is_array_mode'
5529  // This is the mechanism for differentiating between arrays and array_views by the runtime
5531  unsigned int totalExtent = _M_extent[_Rank-1];
5532  details::_Array_init_helper<Concurrency::extent<_Rank>, Concurrency::extent<_Rank>>::func(totalExtent, _M_multiplier, _M_extent);
5533 
5534  return totalExtent;
5535  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5723
static void _Is_valid_extent(const _T< _Rank > &_Tuple) __CPU_ONLY
Definition: xxamp.h:1203
Definition: amprt.h:87
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
_Access_mode _M_type_access_mode
Definition: amprt.h:449
The extent type represents an N-dimensional vector of int which specifies the bounds of an N-dimen...
Definition: amp.h:383
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Initialize ( Concurrency::accelerator_view  _Av,
access_type  _Cpu_access_type 
)
inlineprivate
5539  {
5540  unsigned int totalExtent = _Initialize();
5541  // release the existing buffer if any before allocation new one
5543 
5544  _Buffer_ptr _PBuf = _Buffer::_Create_buffer(_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, _Cpu_access_type);
5545 
5546  _M_buffer_descriptor._Set_buffer_ptr(_Ubiquitous_buffer::_Create_ubiquitous_buffer(_PBuf));
5547  _Register();
5548  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:302
#define NULL
Definition: crtdbg.h:30
void _Set_buffer_ptr(_In_opt_ _Ubiquitous_buffer *_Buffer_ptr) __CPU_ONLY
Definition: amprt.h:502
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
void _Register() __CPU_ONLY
Definition: amp.h:5600
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
void Concurrency::array< _Value_type, _Rank >::_Initialize ( Concurrency::accelerator_view  _Av,
_InputIterator  _Src_first,
_InputIterator  _Src_last,
access_type  _Cpu_access_type 
)
inlineprivate
5553  {
5554  _Initialize(_Av, _Cpu_access_type);
5555  copy(_Src_first, _Src_last, *this);
5556  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Initialize ( Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inlineprivate
5560  {
5561  unsigned int totalExtent = _Initialize();
5562 
5563  // Staging arrays can only be created if the accelerator_view is on the cpu_accelerator
5564  _Buffer_ptr _PBuf = NULL;
5565 
5566  // release the existing buffer if any before allocation new one
5568 
5569  if (_Is_cpu_accelerator(_Av.accelerator))
5570  {
5571  // If the accelerator _Associated_Av supports zero-copy and the default cpu access type
5572  // for the accelerator is access_type_read_write, create a zero-copy buffer instead of a
5573  // staging buffer
5574  if (_Associated_Av.accelerator.supports_cpu_shared_memory && (_Get_recommended_buffer_host_access_mode(_Associated_Av) == _Read_write_access)) {
5575  _PBuf = _Buffer::_Create_buffer(_Associated_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, access_type_read_write);
5576  }
5577  else {
5578  _PBuf = _Buffer::_Create_stage_buffer(_Associated_Av, _Av, totalExtent, sizeof(_Value_type));
5579  }
5580 
5581  _PBuf->_Map_buffer(_Read_write_access, true /* _Wait */);
5582  }
5583  else
5584  {
5585  _PBuf = _Buffer::_Create_buffer(_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, access_type_auto);
5586  }
5587 
5588  _M_buffer_descriptor._Set_buffer_ptr(_Ubiquitous_buffer::_Create_ubiquitous_buffer(_PBuf));
5589  _Register();
5590  }
friend class accelerator
Definition: amprt.h:1520
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:302
_AMPIMP _Access_mode __cdecl _Get_recommended_buffer_host_access_mode(const accelerator_view &_Av)
#define NULL
Definition: crtdbg.h:30
void _Set_buffer_ptr(_In_opt_ _Ubiquitous_buffer *_Buffer_ptr) __CPU_ONLY
Definition: amprt.h:502
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
void _Register() __CPU_ONLY
Definition: amp.h:5600
Definition: amprt.h:88
Definition: amprt.h:103
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3469
template<typename _Value_type, int _Rank = 1>
template<typename _InputIterator >
void Concurrency::array< _Value_type, _Rank >::_Initialize ( Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av,
_InputIterator  _Src_first,
_InputIterator  _Src_last 
)
inlineprivate
5595  {
5596  _Initialize(_Av, _Associated_Av);
5597  copy(_Src_first, _Src_last, *this);
5598  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Refresh_data_ptr ( _Access_mode  _Requested_mode,
bool  _Exception = true 
)
inlineprivate
5675  {
5676  _ASSERTE(_Is_valid_access_mode(_Requested_mode));
5677 
5678  // For an array that has CPU access, the maximum CPU access allowed is that allowed by
5679  // the underlying _Buffer allocation
5680  _Requested_mode = static_cast<_Access_mode>(_Requested_mode & _Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode());
5681 
5682  // Refresh the data ptr if we do not have requested access
5683  if ((_Requested_mode == _No_access) || ((_M_buffer_descriptor._M_curr_cpu_access_mode & _Requested_mode) != _Requested_mode))
5684  {
5685  if (_Has_cpu_access() && (_Requested_mode != _No_access))
5686  {
5688  _Buffer_ptr _PBuf;
5689  bool _Zero_copy_cpu_access = !_Is_cpu_accelerator(this->accelerator_view.accelerator);
5690  this->_Get_access_async(_Requested_mode, _PBuf, _Zero_copy_cpu_access)._Get();
5692  }
5693  else
5694  {
5695  if (_Exception)
5696  {
5697  if (!_Has_cpu_access()) {
5698  throw runtime_exception("The array is not accessible on CPU.", E_FAIL);
5699  }
5700  else {
5701  throw runtime_exception("The array is not accessible for reading on CPU.", E_FAIL);
5702  }
5703  }
5704  }
5705  }
5706  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:302
bool _Is_valid_access_mode(_Access_mode _Mode)
Definition: amprt.h:411
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl _Get_amp_trace()
_Event _Get_access_async(_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) __CPU_ONLY const
Definition: amp.h:5635
#define _ASSERTE(expr)
Definition: crtdbg.h:216
_Access_mode _M_curr_cpu_access_mode
Definition: amprt.h:444
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
bool _Has_cpu_access() const __CPU_ONLY
Definition: amp.h:5669
_AMPIMP _Buffer_ptr _Get_master_buffer() const
_Access_mode
Definition: amprt.h:82
_AMPIMP ULONG _Start_array_view_synchronize_event_helper(const _Buffer_descriptor &_Buff_desc)
Definition: amprt.h:84
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3469
_AMPIMP void _Write_end_event(ULONG _Span_id)
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Refresh_data_ptr ( _Access_mode  _Requested_mode,
bool  _Exception = true 
)
inlineprivate
5709  {
5710  UNREFERENCED_PARAMETER(_Requested_mode);
5711  UNREFERENCED_PARAMETER(_Exception);
5712  }
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Register ( )
inlineprivate
5601  {
5602  Concurrency::accelerator_view cpuAv = _Is_cpu_accelerator(this->accelerator_view.accelerator) ?
5603  this->accelerator_view : accelerator(accelerator::cpu_accelerator).default_view;
5605 
5607 
5608  // If the array is on the CPU accelerator then we will ensure that the descriptor
5609  // indicates CPU access
5610  if (_Is_cpu_accelerator(this->accelerator_view.accelerator))
5611  {
5612  _Buffer_ptr _PBuf = NULL;
5613  this->_Get_access_async(_Read_write_access, _PBuf, false)._Get();
5614  }
5615  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:302
Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator ...
Definition: amprt.h:1518
_AMPIMP void _Register_view(_In_ _View_key _Key, accelerator_view _Cpu_av, _View_shape_ptr _Shape)
#define NULL
Definition: crtdbg.h:30
_Ret_ _View_shape * _Create_buffer_view_shape() const
Definition: amp.h:5656
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
_Event _Get_access_async(_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) __CPU_ONLY const
Definition: amp.h:5635
static _AMPIMP const wchar_t cpu_accelerator[]
String constant for cpu accelerator
Definition: amprt.h:1111
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:532
Definition: amprt.h:88
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:497
_AMPIMP void _Discard(_In_ _View_key _Key)
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3469
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Register_copy ( const array< _Value_type, _Rank > &  _Other)
inlineprivate
5618  {
5619  _M_buffer_descriptor._Get_buffer_ptr()->_Register_view_copy(_M_buffer_descriptor._Get_view_key(), _Other._M_buffer_descriptor._Get_view_key());
5620  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
_AMPIMP void _Register_view_copy(_In_ _View_key _New_view_key, _In_ _View_key _Existing_view_key)
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:532
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:497
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Unregister ( )
inlineprivate
5623  {
5624  // No need to unregister if the array was moved causing the buffer ptr to be set to NULL
5627  }
5628  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
#define NULL
Definition: crtdbg.h:30
_AMPIMP void _Unregister_view(_In_ _View_key _Key)
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:532
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:497
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::copy_to ( array< _Value_type, _Rank > &  _Dest) const
inline

Copies elements from this array to the destination array.

4881  {
4882  Concurrency::copy(*this, _Dest);
4883  }
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::copy_to ( const array_view< _Value_type, _Rank > &  _Dest) const
inline

Copies elements from this array to the destination array_view.

4889  {
4890  Concurrency::copy(*this,_Dest);
4891  }
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
_Ret_ _Value_type* Concurrency::array< _Value_type, _Rank >::data ( )
inline

Returns a pointer to the raw data of this array.

5467  {
5468  _Refresh_data_ptr(_Read_write_access, false /* _Exception */);
5469  return reinterpret_cast<_Value_type*>(_M_buffer_descriptor._M_data_ptr);
5470  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5674
void * _M_data_ptr
Definition: amprt.h:432
Definition: amprt.h:88
template<typename _Value_type, int _Rank = 1>
const _Value_type* Concurrency::array< _Value_type, _Rank >::data ( ) const
inline

Returns a pointer to the raw data of this array.

5476  {
5477 #pragma warning( push )
5478 #pragma warning( disable : 4880 )
5479  // Casting away constness in amp restricted scope might result in
5480  // undefined behavior, therefore, the compiler will report a level 1 warning
5481  // for it. But the following const_cast is harmless thus we are suppressing
5482  // this warning just for this line.
5483  const_cast<array*>(this)->_Refresh_data_ptr(_Read_access, false /* _Exception */);
5484 #pragma warning( pop )
5485  return reinterpret_cast<const _Value_type*>(_M_buffer_descriptor._M_data_ptr);
5486  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Definition: amprt.h:85
Definition: array:19
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5674
void * _M_data_ptr
Definition: amprt.h:432
template<typename _Value_type, int _Rank = 1>
__declspec (property(get=get_accelerator_view)) Concurrency Concurrency::accelerator_view Concurrency::array< _Value_type, _Rank >::get_accelerator_view ( ) const
inline

Returns the accelerator_view where this array is located.

4907  {
4908  return _Get_buffer()->_Get_master_buffer()->_Get_access_on_accelerator_view();
4909  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
_AMPIMP _Buffer_ptr _Get_master_buffer() const
template<typename _Value_type, int _Rank = 1>
__declspec (property(get=get_associated_accelerator_view)) Concurrency Concurrency::accelerator_view Concurrency::array< _Value_type, _Rank >::get_associated_accelerator_view ( ) const
inline

Returns the accelerator_view that is the preferred target where this array can be copied.

4916  {
4917  return _Get_buffer()->_Get_master_buffer()->_Get_accelerator_view();
4918  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
_AMPIMP _Buffer_ptr _Get_master_buffer() const
template<typename _Value_type, int _Rank = 1>
access_type Concurrency::array< _Value_type, _Rank >::get_cpu_access_type ( ) const
inline
4925  {
4926  return _Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_type();
4927  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() __CPU_ONLY const
Definition: amp.h:5630
_AMPIMP _Buffer_ptr _Get_master_buffer() const
template<typename _Value_type, int _Rank = 1>
__declspec (property(get=get_extent)) Concurrency Concurrency::extent<_Rank> Concurrency::array< _Value_type, _Rank >::get_extent ( ) const
inline

Returns the extent that defines the shape of this array.

4898  {
4899  return _M_extent;
4900  }
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::operator std::vector< _Value_type > ( ) const
inline

Implicitly converts this array into a vector by copying.

5456  {
5457  std::vector<_Value_type> _return_vector(extent.size());
5458  Concurrency::copy(*this, _return_vector.begin());
5459 
5460  return _return_vector;
5461  }
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
value_type& Concurrency::array< _Value_type, _Rank >::operator() ( const index< _Rank > &  _Index)
inline

Get the element value indexed by _I

Parameters
_IThe index.
Returns
The element value indexed by _I
5012  {
5013  return this->operator[](_Index);
5014  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
const value_type& Concurrency::array< _Value_type, _Rank >::operator() ( const index< _Rank > &  _Index) const
inline

Get the element value indexed by _Index

Parameters
_IndexThe index.
Returns
The element value indexed by _Index
5026  {
5027  return this->operator[](_Index);
5028  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
value_type& Concurrency::array< _Value_type, _Rank >::operator() ( int  _I0,
int  _I1 
)
inline

Get the element value indexed by (_I0,_I1)

Parameters
_I0The most-significant component of the index
_I1The least-significant component of the index
Returns
The element value indexed by (_I0,_I1)
5043  {
5044  static_assert(_Rank == 2, "value_type& array::operator()(int, int) is only permissible on array<T, 2>");
5045  return this->operator[](index<2>(_I0, _I1));
5046  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
const value_type& Concurrency::array< _Value_type, _Rank >::operator() ( int  _I0,
int  _I1 
) const
inline

Get the element value indexed by (_I0,_I1)

Parameters
_I0The most-significant component of the index
_I1The least-significant component of the index
Returns
The element value indexed by (_I0,_I1)
5061  {
5062  static_assert(_Rank == 2, "const value_type& array::operator()(int, int) is only permissible on array<T, 2>");
5063  return this->operator[](index<2>(_I0, _I1));
5064  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
value_type& Concurrency::array< _Value_type, _Rank >::operator() ( int  _I0,
int  _I1,
int  _I2 
)
inline

Get the element value indexed by (_I0,_I1,_I2)

Parameters
_I0The most-significant component of the index
_I1The next-to-most-significant component of the index
_I2The least-significant component of the index
Returns
The element value indexed by (_I0,_I1,_I2)
5082  {
5083  static_assert(_Rank == 3, "value_type& array::operator()(int, int, int) is only permissible on array<T, 3>");
5084  return this->operator[](index<3>(_I0, _I1, _I2));
5085  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
const value_type& Concurrency::array< _Value_type, _Rank >::operator() ( int  _I0,
int  _I1,
int  _I2 
) const
inline

Get the element value indexed by (_I0,_I1,_I2)

Parameters
_I0The most-significant component of the index
_I1The next-to-most-significant component of the index
_I2The least-significant component of the index
Returns
The element value indexed by (_I0,_I1,_I2)
5103  {
5104  static_assert(_Rank == 3, "const value_type& array::operator()(int, int, int) const is only permissible on array<T, 3>");
5105  return this->operator[](index<3>(_I0, _I1, _I2));
5106  }
value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4938
template<typename _Value_type, int _Rank = 1>
details::_Projection_result_type<_Value_type,_Rank>::_Result_type Concurrency::array< _Value_type, _Rank >::operator() ( int  _I)
inline

Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions.

Parameters
_IThe most-significant index component
Returns
The element at index component _I, or an array_view projected on the most-significant dimension.
5119  {
5121  }
static _Projection_result_type< _T, _R >::_Result_type _Project0(_In_ array< _T, _R > *_Array, int _I) __GPU
Definition: xxamp_inl.h:73
template<typename _Value_type, int _Rank = 1>
details::_Projection_result_type<_Value_type,_Rank>::_Const_result_type Concurrency::array< _Value_type, _Rank >::operator() ( int  _I) const
inline

Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions.

Parameters
_IThe most-significant index component
Returns
The element at index component _I, or an array_view projected on the most-significant dimension.
5134  {
5136  }
static _Projection_result_type< _T, _R >::_Const_result_type _Project0(const array< _T, _R > *_Array, int _I) __GPU
Definition: xxamp_inl.h:65
template<typename _Value_type, int _Rank = 1>
array& Concurrency::array< _Value_type, _Rank >::operator= ( const array< _Value_type, _Rank > &  _Other)
inline

Copy Assignment operator. Deep copy.

4832  {
4833  if (this != &_Other)
4834  {
4835  // First unregister myself from the current buffer
4836  _Unregister();
4837 
4838  _M_extent = _Other._M_extent;
4839  _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view);
4840  Concurrency::copy(_Other, *this);
4841  }
4842  return *this;
4843  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5524
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
void _Unregister() __CPU_ONLY
Definition: amp.h:5622
template<typename _Value_type, int _Rank = 1>
array& Concurrency::array< _Value_type, _Rank >::operator= ( array< _Value_type, _Rank > &&  _Other)
inline

Move Assignment operator.

4849  {
4850  if (this != &_Other)
4851  {
4852  // First unregister myself from the current buffer
4853  _Unregister();
4854 
4855  _M_extent = _Other._M_extent;
4856  _M_multiplier = _Other._M_multiplier;
4857  _M_buffer_descriptor = _Other._M_buffer_descriptor;
4858  this->_Register_copy(_Other);
4859 
4860  // Release the _Other array
4861  _Other._Unregister();
4862  _Other._M_buffer_descriptor._M_data_ptr = NULL;
4863  _Other._M_buffer_descriptor._Set_buffer_ptr(NULL);
4864  }
4865  return *this;
4866  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5723
#define NULL
Definition: crtdbg.h:30
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5717
void _Register_copy(const array &_Other) __CPU_ONLY
Definition: amp.h:5617
void _Unregister() __CPU_ONLY
Definition: amp.h:5622
template<typename _Value_type, int _Rank = 1>
array& Concurrency::array< _Value_type, _Rank >::operator= ( const array_view< const _Value_type, _Rank > &  _Src)
inline

Assignment operator from an array_view

4872  {
4873  Concurrency::copy(_Src,*this);
4874  return *this;
4875  }
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
void copy(const array< _Value_type, _Rank > &_Src, array< _Value_type, _Rank > &_Dest)
Copies the contents of the source array into the destination array.
Definition: amp.h:5976
template<typename _Value_type, int _Rank = 1>
value_type& Concurrency::array< _Value_type, _Rank >::operator[] ( const index< _Rank > &  _Index)
inline

Get the element value indexed by _I

Parameters
_IThe index.
Returns
The element value indexed by _I
4939  {
4940  // Refresh the data ptr if needed
4942 
4943  _Value_type * _Ptr = reinterpret_cast<_Value_type *>(_M_buffer_descriptor._M_data_ptr);
4944  return _Ptr[_Flatten_helper::func(_M_multiplier._M_base, _Index._M_base)];
4945  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5723
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5674
void * _M_data_ptr
Definition: amprt.h:432
Definition: amprt.h:88
static _T2 func(const _T1 *_Multiplier, const _T2 *_Index) __GPU
Definition: xxamp.h:925
template<typename _Value_type, int _Rank = 1>
const value_type& Concurrency::array< _Value_type, _Rank >::operator[] ( const index< _Rank > &  _Index) const
inline

Get the element value indexed by _I

Parameters
_IThe index.
Returns
The element value indexed by _I
4957  {
4958  // Refresh the data ptr if needed
4959 #pragma warning( push )
4960 #pragma warning( disable : 4880 )
4961  // Casting away constness in amp restricted scope might result in
4962  // undefined behavior, therefore, the compiler will report a level 1 warning
4963  // for it. But the following const_cast is harmless thus we are suppressing
4964  // this warning just for this line.
4965  const_cast<array*>(this)->_Refresh_data_ptr(_Read_access);
4966 #pragma warning( pop )
4967 
4968  _Value_type * _Ptr = reinterpret_cast<_Value_type *>(_M_buffer_descriptor._M_data_ptr);
4969  return _Ptr[_Flatten_helper::func(_M_multiplier._M_base, _Index._M_base)];
4970  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
Definition: amprt.h:85
Definition: array:19
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5723
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5674
void * _M_data_ptr
Definition: amprt.h:432
static _T2 func(const _T1 *_Multiplier, const _T2 *_Index) __GPU
Definition: xxamp.h:925
template<typename _Value_type, int _Rank = 1>
details::_Projection_result_type<_Value_type,_Rank>::_Result_type Concurrency::array< _Value_type, _Rank >::operator[] ( int  _I)
inline

Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions.

Parameters
_IThe most-significant index component
Returns
The element at index component _I, or an array_view projected on the most-significant dimension.
4983  {
4985  }
static _Projection_result_type< _T, _R >::_Result_type _Project0(_In_ array< _T, _R > *_Array, int _I) __GPU
Definition: xxamp_inl.h:73
template<typename _Value_type, int _Rank = 1>
details::_Projection_result_type<_Value_type,_Rank>::_Const_result_type Concurrency::array< _Value_type, _Rank >::operator[] ( int  _I) const
inline

Projects the most-significant dimension of this array. If the array rank is 1, this produces a single element; otherwise it produces an array_view with one fewer dimensions.

Parameters
_IThe most-significant index component
Returns
The element at index component _I, or an array_view projected on the most-significant dimension.
4998  {
5000  }
static _Projection_result_type< _T, _R >::_Const_result_type _Project0(const array< _T, _R > *_Array, int _I) __GPU
Definition: xxamp_inl.h:65
template<typename _Value_type, int _Rank = 1>
template<typename _Value_type2 >
array_view<_Value_type2,1> Concurrency::array< _Value_type, _Rank >::reinterpret_as ( )
inline

Produces a (possibly unsafe) reinterpretation of this array that is linear and with a different element type.

Returns
A linear array_view with a reinterpreted element type.
5394  {
5395  return array_view<_Value_type,1>(_M_buffer_descriptor, Concurrency::extent<1>(extent.size())).template reinterpret_as<_Value_type2>();
5396  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
template<typename _Value_type, int _Rank = 1>
template<typename _Value_type2 >
array_view<const _Value_type2,1> Concurrency::array< _Value_type, _Rank >::reinterpret_as ( ) const
inline

Produces a (possibly unsafe) reinterpretation of this array that is linear and with a different element type.

Returns
A linear array_view with a reinterpreted element type.
5406  {
5407 #pragma warning( push )
5408 #pragma warning( disable : 4880 )
5409  // Casting away constness in amp restricted scope might result in
5410  // undefined behavior, therefore, the compiler will report a level 1 warning
5411  // for it. But the following const_cast is harmless thus we are suppressing
5412  // this warning just for this line.
5413  return const_cast<array*>(this)->reinterpret_as<_Value_type2>();
5414 #pragma warning( pop )
5415  }
Definition: array:19
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const Concurrency::index< _Rank > &  _Section_origin,
const Concurrency::extent< _Rank > &  _Section_extent 
)
inline

Produces a subsection of the source array at the given origin and extent.

Parameters
_Section_originThe origin of the section.
_Section_extentThe extent of the section
Returns
A subsection of the array.
5151  {
5152  array_view<_Value_type,_Rank> _T1(*this);
5153  return _T1.section(_Section_origin, _Section_extent);
5154  }
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const Concurrency::index< _Rank > &  _Section_origin,
const Concurrency::extent< _Rank > &  _Section_extent 
) const
inline

Produces a subsection of the source array at the given origin and extent.

Parameters
_Section_originThe origin of the section.
_Section_extentThe extent of the section
Returns
A subsection of the array.
5169  {
5170  array_view<const _Value_type,_Rank> _T1(*this);
5171  return _T1.section(_Section_origin, _Section_extent);
5172  }
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const Concurrency::extent< _Rank > &  _Ext)
inline

Produces a subsection of the source array_view with origin of zero, with an extent of _Ext.

Parameters
_ExtThe extent of this section
Returns
A subsection of the array_view.
5185  {
5186  return section(Concurrency::index<_Rank>(), _Ext);
5187  }
array_view< _Value_type, _Rank > section(const Concurrency::index< _Rank > &_Section_origin, const Concurrency::extent< _Rank > &_Section_extent) __GPU
Produces a subsection of the source array at the given origin and extent.
Definition: amp.h:5150
Define an N-dimensional index point; which may also be viewed as a vector based at the origin in N-sp...
Definition: amp.h:53
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const Concurrency::extent< _Rank > &  _Ext) const
inline

Produces a subsection of the source array_view with origin of zero, with an extent of _Ext.

Parameters
_ExtThe extent of this section
Returns
A subsection of the array_view.
5200  {
5201  return section(Concurrency::index<_Rank>(), _Ext);
5202  }
array_view< _Value_type, _Rank > section(const Concurrency::index< _Rank > &_Section_origin, const Concurrency::extent< _Rank > &_Section_extent) __GPU
Produces a subsection of the source array at the given origin and extent.
Definition: amp.h:5150
Define an N-dimensional index point; which may also be viewed as a vector based at the origin in N-sp...
Definition: amp.h:53
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const index< _Rank > &  _Idx)
inline

Produces a subsection of the source array with origin specified by an index, with an extent of (this->exent - _Idx).

Parameters
_IdxThe index that specifies the origin of this section.
Returns
A subsection of the array.
5215  {
5216  array_view<_Value_type,_Rank> _T1(*this);
5217  return _T1.section(_Idx);
5218  }
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,_Rank> Concurrency::array< _Value_type, _Rank >::section ( const index< _Rank > &  _Idx) const
inline

Produces a subsection of the source array with origin specified by an index, with an extent of (this->exent - _Idx).

Parameters
_IdxThe index that specifies the origin of this section.
Returns
A subsection of the array.
5231  {
5232  array_view<const _Value_type,_Rank> _T1(*this);
5233  return _T1.section(_Idx);
5234  }
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,1> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _E0 
)
inline

Produces a one-dimensional subsection of the source array with origin specified by the index components _I0, with extent _E0.

Parameters
_I0The origin of this section.
_E0The extent of this section.
Returns
A subsection of the array.
5250  {
5251  array_view<_Value_type,_Rank> _T1(*this);
5252  return _T1.section(_I0,_E0);
5253  }
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,1> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _E0 
) const
inline

Produces a one-dimensional subsection of the source array with origin specified by the index components _I0, with extent _E0.

Parameters
_I0The origin of this section.
_E0The extent of this section.
Returns
A subsection of the array.
5269  {
5270  array_view<const _Value_type,_Rank> _T1(*this);
5271  return _T1.section(_I0,_E0);
5272  }
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,2> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _I1,
int  _E0,
int  _E1 
)
inline

Produces a two-dimensional subsection of the source array with origin specified by the index components (_I0,_I1), with extent (_E0,_E1).

Parameters
_I0The most-significant component of the origin of this section.
_I1The least-significant component of the origin of this section.
_E0The most-significant component of the extent of this section.
_E1The least-significant component of the extent of this section.
Returns
A subsection of the array.
5294  {
5295  array_view<_Value_type,_Rank> _T1(*this);
5296  return _T1.section(_I0,_I1,_E0,_E1);
5297  }
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,2> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _I1,
int  _E0,
int  _E1 
) const
inline

Produces a two-dimensional subsection of the source array with origin specified by the index components (_I0,_I1), with extent (_E0,_E1).

Parameters
_I0The most-significant component of the origin of this section.
_I1The least-significant component of the origin of this section.
_E0The most-significant component of the extent of this section.
_E1The least-significant component of the extent of this section.
Returns
A subsection of the array.
5319  {
5320  array_view<const _Value_type,_Rank> _T1(*this);
5321  return _T1.section(_I0,_I1,_E0,_E1);
5322  }
template<typename _Value_type, int _Rank = 1>
array_view<_Value_type,3> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _I1,
int  _I2,
int  _E0,
int  _E1,
int  _E2 
)
inline

Produces a three-dimensional subsection of the source array with origin specified by the index components (_I0,_I1,_I2), with extent (_E0,_E1,_E2).

Parameters
_I0The most-significant component of the origin of this section.
_I1The next-to-most-significant component of the origin of this section.
_I2The least-significant component of the origin of this section.
_E0The most-significant component of the extent of this section.
_E1The next-to-most-significant component of the extent of this section.
_E2The least-significant component of the extent of this section.
Returns
A subsection of the array.
5350  {
5351  array_view<_Value_type,_Rank> _T1(*this);
5352  return _T1.section(_I0,_I1,_I2,_E0,_E1,_E2);
5353  }
template<typename _Value_type, int _Rank = 1>
array_view<const _Value_type,3> Concurrency::array< _Value_type, _Rank >::section ( int  _I0,
int  _I1,
int  _I2,
int  _E0,
int  _E1,
int  _E2 
) const
inline

Produces a three-dimensional subsection of the source array with origin specified by the index components (_I0,_I1,_I2), with extent (_E0,_E1,_E2).

Parameters
_I0The most-significant component of the origin of this section.
_I1The next-to-most-significant component of the origin of this section.
_I2The least-significant component of the origin of this section.
_E0The most-significant component of the extent of this section.
_E1The next-to-most-significant component of the extent of this section.
_E2The least-significant component of the extent of this section.
Returns
A subsection of the array.
5381  {
5382  array_view<const _Value_type,_Rank> _T1(*this);
5383  return _T1.section(_I0,_I1,_I2,_E0,_E1,_E2);
5384  }
template<typename _Value_type, int _Rank = 1>
template<int _New_rank>
array_view<_Value_type,_New_rank> Concurrency::array< _Value_type, _Rank >::view_as ( const Concurrency::extent< _New_rank > &  _View_extent)
inline

Produces an array_view of a different rank over this array's data.

Parameters
_View_extentThe reshaping extent.
Returns
A reshaped array_view.
5427  {
5428  return array_view<_Value_type,_New_rank>(_M_buffer_descriptor, _View_extent);
5429  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5720
template<typename _Value_type, int _Rank = 1>
template<int _New_rank>
array_view<const _Value_type,_New_rank> Concurrency::array< _Value_type, _Rank >::view_as ( const Concurrency::extent< _New_rank > &  _View_extent) const
inline

Produces an array_view of a different rank over this array's data.

Parameters
_View_extentThe reshaping extent.
Returns
A reshaped array_view.
5441  {
5442 #pragma warning( push )
5443 #pragma warning( disable : 4880 )
5444  // Casting away constness in amp restricted scope might result in
5445  // undefined behavior, therefore, the compiler will report a level 1 warning
5446  // for it. But the following const_cast is harmless thus we are suppressing
5447  // this warning just for this line.
5448  return const_cast<array*>(this)->view_as<_New_rank>(_View_extent);
5449 #pragma warning( pop )
5450  }
Definition: array:19

Friends And Related Function Documentation

template<typename _Value_type, int _Rank = 1>
_Event details::_Get_access_async ( const array< _Value_type, _Rank > &  _Array,
_Access_mode  _Mode,
_Buffer_ptr _Buf_ptr 
)
friend
template<typename _Value_type, int _Rank = 1>
_Ret_ _Ubiquitous_buffer* details::_Get_buffer ( const array< _Value_type, _Rank > &  _Array)
friend
template<typename _Value_type, int _Rank = 1>
const _Buffer_descriptor& details::_Get_buffer_descriptor ( const array< _Value_type, _Rank > &  _Array)
friend
template<typename _Value_type, int _Rank = 1>
template<typename _Value_type , int _Rank>
array<_Value_type,_Rank> direct3d::make_array ( const Concurrency::extent< _Rank > &  _Extent,
const Concurrency::accelerator_view _Av,
_In_ IUnknown *  _D3D_buffer 
)
friend

Member Data Documentation

template<typename _Value_type, int _Rank = 1>
_Buffer_descriptor Concurrency::array< _Value_type, _Rank >::_M_buffer_descriptor
private
template<typename _Value_type, int _Rank = 1>
Concurrency::extent<_Rank> Concurrency::array< _Value_type, _Rank >::_M_extent
private
template<typename _Value_type, int _Rank = 1>
Concurrency::extent<_Rank> Concurrency::array< _Value_type, _Rank >::_M_multiplier
private
template<typename _Value_type, int _Rank = 1>
const int Concurrency::array< _Value_type, _Rank >::rank = _Rank
static

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