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_type & operator[] (const index< _Rank > &_Index) __GPU
 Get the element value indexed by _I More...
 
const _Value_type & operator[] (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_type & operator() (const index< _Rank > &_Index) __GPU
 Get the element value indexed by _I More...
 
const _Value_type & operator() (const index< _Rank > &_Index) const __GPU
 Get the element value indexed by _Index More...
 
_Value_type & operator() (int _I0, int _I1) __GPU
 Get the element value indexed by (_I0,_I1) More...
 
const _Value_type & operator() (int _I0, int _I1) const __GPU
 Get the element value indexed by (_I0,_I1) More...
 
_Value_type & operator() (int _I0, int _I1, int _I2) __GPU
 Get the element value indexed by (_I0,_I1,_I2) More...
 
const _Value_type & operator() (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 noexcept(false)
 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 () const __CPU_ONLY
 
_Event _Get_access_async (_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) const __CPU_ONLY
 
_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, bool=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.
3893  : _M_extent(_Extent)
3894  {
3896  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: amprt.h:109
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.
3906  {
3907  static_assert(_Rank == 1, "array(int) is only permissible on array<T, 1>");
3909  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
3922  {
3923  static_assert(_Rank == 2, "array(int, int) is only permissible on array<T, 2>");
3925  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
3940  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
3941  {
3942  static_assert(_Rank == 3, "array(int, int, int) is only permissible on array<T, 3>");
3944  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
3963  : _M_extent(_Extent)
3964  {
3965  _Initialize(_Av, _Cpu_access_type);
3966  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
3986  {
3987  static_assert(_Rank == 1, "array(int, accelerator_view) is only permissible on array<T, 1>");
3988  _Initialize(_Av, _Cpu_access_type);
3989  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4012  {
4013  static_assert(_Rank == 2, "array(int, int, accelerator_view) is only permissible on array<T, 2>");
4014  _Initialize(_Av, _Cpu_access_type);
4015  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4040  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4041  {
4042  static_assert(_Rank == 3, "array(int, int, int, accelerator_view) is only permissible on array<T, 3>");
4043  _Initialize(_Av, _Cpu_access_type);
4044  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4059  : _M_extent(_Extent)
4060  {
4061  _Initialize(_Av, _Associated_Av);
4062  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4078  {
4079  static_assert(_Rank == 1, "array(int, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4080  _Initialize(_Av, _Associated_Av);
4081  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4100  {
4101  static_assert(_Rank == 2, "array(int, int, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4102  _Initialize(_Av, _Associated_Av);
4103  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4124  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4125  {
4126  static_assert(_Rank == 3, "array(int, int, int, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4127  _Initialize(_Av, _Associated_Av);
4128  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4143  : _M_extent(_Extent)
4144  {
4145  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4146  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: amprt.h:109
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.
4159  : _M_extent(_Extent)
4160  {
4161  _InputIterator _Src_last = _Src_first;
4162  std::advance(_Src_last, this->extent.size());
4163 
4164  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4165  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: type_traits:974
Definition: amprt.h:109
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4181  {
4182  static_assert(_Rank == 1, "array(int, iterator, iterator) is only permissible on array<T, 1>");
4183  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4184  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
4198  {
4199  static_assert(_Rank == 1, "array(int, iterator) is only permissible on array<T, 1>");
4200 
4201  _InputIterator _Src_last = _Src_first;
4202  std::advance(_Src_last, this->extent.size());
4203 
4204  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4205  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: type_traits:974
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:109
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4224  {
4225  static_assert(_Rank == 2, "array(int, int, iterator, iterator) is only permissible on array<T, 2>");
4226  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4227  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
4244  {
4245  static_assert(_Rank == 2, "array(int, int, iterator) is only permissible on array<T, 2>");
4246 
4247  _InputIterator _Src_last = _Src_first;
4248  std::advance(_Src_last, this->extent.size());
4249 
4250  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4251  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: type_traits:974
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:109
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4270  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4271  {
4272  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator) is only permissible on array<T, 3>");
4273  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4274  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:109
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.
4293  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4294  {
4295  static_assert(_Rank == 3, "array(int, int, int, iterator) is only permissible on array<T, 3>");
4296 
4297  _InputIterator _Src_last = _Src_first;
4298  std::advance(_Src_last, this->extent.size());
4299 
4300  _Initialize(details::_Select_default_accelerator().default_view, _Src_first, _Src_last, access_type_auto);
4301  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_AMPIMP accelerator __cdecl _Select_default_accelerator()
Definition: type_traits:974
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:109
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4326  : _M_extent(_Extent)
4327  {
4328  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4329  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4352  : _M_extent(_Extent)
4353  {
4354  _InputIterator _Src_last = _Src_first;
4355  std::advance(_Src_last, this->extent.size());
4356 
4357  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4358  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4384  {
4385  static_assert(_Rank == 1, "array(int, iterator, iterator) is only permissible on array<T, 1>");
4386  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4387  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4411  {
4412  static_assert(_Rank == 1, "array(int, iterator) is only permissible on array<T, 1>");
4413 
4414  _InputIterator _Src_last = _Src_first;
4415  std::advance(_Src_last, this->extent.size());
4416 
4417  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4418  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4447  {
4448  static_assert(_Rank == 2, "array(int, int, iterator, iterator) is only permissible on array<T, 2>");
4449  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4450  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4477  {
4478  static_assert(_Rank == 2, "array(int, int, iterator) is only permissible on array<T, 2>");
4479 
4480  _InputIterator _Src_last = _Src_first;
4481  std::advance(_Src_last, this->extent.size());
4482 
4483  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4484  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4515  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4516  {
4517  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator) is only permissible on array<T, 3>");
4518  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4519  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4548  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4549  {
4550  static_assert(_Rank == 3, "array(int, int, int, iterator) is only permissible on array<T, 3>");
4551 
4552  _InputIterator _Src_last = _Src_first;
4553  std::advance(_Src_last, this->extent.size());
4554 
4555  _Initialize(_Av, _Src_first, _Src_last, _Cpu_access_type);
4556  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4577  : _M_extent(_Extent)
4578  {
4579  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4580  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4599  : _M_extent(_Extent)
4600  {
4601  _InputIterator _Src_last = _Src_first;
4602  std::advance(_Src_last, this->extent.size());
4603 
4604  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4605  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
void advance(_InIt &_Where, _Diff _Off)
Definition: xutility:1089
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.
4627  {
4628  static_assert(_Rank == 1, "array(int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4629  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4630  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4650  {
4651  static_assert(_Rank == 1, "array(int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 1>");
4652 
4653  _InputIterator _Src_last = _Src_first;
4654  std::advance(_Src_last, this->extent.size());
4655 
4656  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4657  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4682  {
4683  static_assert(_Rank == 2, "array(int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4684  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4685  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4708  {
4709  static_assert(_Rank == 2, "array(int, int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 2>");
4710 
4711  _InputIterator _Src_last = _Src_first;
4712  std::advance(_Src_last, this->extent.size());
4713 
4714  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4715  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4742  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4743  {
4744  static_assert(_Rank == 3, "array(int, int, int, iterator, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4745  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4746  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.
4771  : _M_extent(Concurrency::extent<_Rank>(_E0, _E1, _E2))
4772  {
4773  static_assert(_Rank == 3, "array(int, int, int, iterator, accelerator_view, accelerator_view) is only permissible on array<T, 3>");
4774 
4775  _InputIterator _Src_last = _Src_first;
4776  std::advance(_Src_last, this->extent.size());
4777 
4778  _Initialize(_Av, _Associated_Av, _Src_first, _Src_last);
4779  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
Definition: type_traits:974
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:1089
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.
4788  :_M_extent(_Src.extent)
4789  {
4791  Concurrency::copy(_Src,*this);
4792  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_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:6008
Definition: amprt.h:109
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.
4811  :_M_extent(_Src.extent)
4812  {
4813  _Initialize(_Av, _Cpu_access_type);
4814  Concurrency::copy(_Src,*this);
4815  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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:6008
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.
4830  :_M_extent(_Src.extent)
4831  {
4832  _Initialize(_Av, _Associated_Av);
4833  Concurrency::copy(_Src,*this);
4834  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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:6008
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( const array< _Value_type, _Rank > &  _Other)
inline

Copy constructor. Deep copy.

4840  : _M_extent(_Other._M_extent)
4841  {
4842  _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view);
4843  Concurrency::copy(_Other, *this);
4844  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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:6008
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::array ( array< _Value_type, _Rank > &&  _Other)
inline

Move constructor.

4850  : _M_extent(_Other._M_extent), _M_multiplier(_Other._M_multiplier)
4851  , _M_buffer_descriptor(_Other._M_buffer_descriptor)
4852  {
4853  // Register this
4854  this->_Register_copy(_Other);
4855 
4856  // Release the _Other array
4857  _Other._Unregister();
4858  _Other._M_buffer_descriptor._M_data_ptr = NULL;
4859  _Other._M_buffer_descriptor._Set_buffer_ptr(NULL);
4860  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
#define NULL
Definition: vcruntime.h:236
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5755
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
void _Register_copy(const array &_Other) __CPU_ONLY
Definition: amp.h:5651
template<typename _Value_type, int _Rank = 1>
Concurrency::array< _Value_type, _Rank >::~array ( )
inlinenoexcept

Destroys this array and reclaims resources.

5526  {
5527  bool _Can_throw = (std::current_exception() == nullptr);
5528 
5529  // Destructor should not throw if we are already processing
5530  // an exception and another exception will result in termination
5531  try {
5532  _Unregister();
5533  }
5534  catch(...)
5535  {
5536  if (_Can_throw) {
5537  throw;
5538  }
5539  }
5540  }
void _Unregister() __CPU_ONLY
Definition: amp.h:5656
exception_ptr current_exception() _NOEXCEPT
Definition: exception:359
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
5549  : _M_extent(_Extent), _M_buffer_descriptor(_Buffer_descriptor)
5550  {
5551  _Initialize();
5552 
5553  // Register this
5554  this->_Register();
5555  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
void _Register() __CPU_ONLY
Definition: amp.h:5634
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749

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
5691  {
5692  _ASSERTE(_Get_buffer()->_Get_master_buffer_elem_size() == sizeof(_Value_type));
5693 
5694  unsigned int _ZeroOffset[_Rank] = {0};
5695  unsigned int _View_extent[_Rank];
5696  for(int i=0; i<_Rank; ++i)
5697  {
5698  _View_extent[i] = static_cast<unsigned int>(this->_M_extent[i]);
5699  }
5700  return _View_shape::_Create_view_shape(static_cast<unsigned int>(_Rank), 0, &_View_extent[0], &_ZeroOffset[0], &_View_extent[0]);
5701  }
int i[4]
Definition: dvec.h:68
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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
5670  {
5671  _ASSERTE(!_Zero_copy_cpu_access || (_Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode() != _No_access));
5672 
5673  _Buffer_ptr _PBuf;
5674  Concurrency::accelerator_view _Access_av = _Zero_copy_cpu_access ? accelerator(accelerator::cpu_accelerator).default_view : this->accelerator_view;
5676  _Access_av,
5677  _Mode, _PBuf);
5678  _Buf_ptr = _PBuf;
5679 
5680  if (_Is_cpu_accelerator(_Access_av.accelerator)) {
5681  _Ev = _Ev._Add_continuation(std::function<_Event()>([_PBuf, this]() mutable -> _Event {
5682  const_cast<array*>(this)->_M_buffer_descriptor._M_data_ptr = _PBuf->_Get_host_ptr();
5683  return _Event();
5684  }));
5685  }
5686 
5687  return _Ev;
5688  }
friend class accelerator
Definition: amprt.h:1444
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:308
_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
_Event _Get_access_async(const _View_key _Key, accelerator_view _Av, _Access_mode _Mode, _Buffer_ptr &_Buf_ptr)
Definition: amprt.h:3389
Definition: array:21
Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator ...
Definition: amprt.h:1442
static _AMPIMP const wchar_t cpu_accelerator[]
String constant for cpu accelerator
Definition: amprt.h:1035
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:537
void * _M_data_ptr
Definition: amprt.h:438
Definition: amprt.h:90
Definition: amprt.h:318
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3401
template<typename _Value_type, int _Rank = 1>
_Ret_ _Ubiquitous_buffer* Concurrency::array< _Value_type, _Rank >::_Get_buffer ( ) const
inlineprivate
5665  {
5667  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
template<typename _Value_type, int _Rank = 1>
bool Concurrency::array< _Value_type, _Rank >::_Has_cpu_access ( ) const
inlineprivate
5704  {
5705  return (_Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode() != _No_access);
5706  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
Definition: amprt.h:90
template<typename _Value_type, int _Rank = 1>
unsigned int Concurrency::array< _Value_type, _Rank >::_Initialize ( )
inlineprivate
5559  {
5561 
5562  // Arrays always have a type access mode of '_Is_array_mode'
5563  // This is the mechanism for differentiating between arrays and array_views by the runtime
5565  unsigned int totalExtent = _M_extent[_Rank-1];
5566  details::_Array_init_helper<Concurrency::extent<_Rank>, Concurrency::extent<_Rank>>::func(totalExtent, _M_multiplier, _M_extent);
5567 
5568  return totalExtent;
5569  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5755
static void _Is_valid_extent(const _T< _Rank > &_Tuple) __CPU_ONLY
Definition: xxamp.h:1195
Definition: amprt.h:93
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
_Access_mode _M_type_access_mode
Definition: amprt.h:455
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
5573  {
5574  unsigned int totalExtent = _Initialize();
5575  // release the existing buffer if any before allocation new one
5577 
5578  _Buffer_ptr _PBuf = _Buffer::_Create_buffer(_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, _Cpu_access_type);
5579 
5580  _M_buffer_descriptor._Set_buffer_ptr(_Ubiquitous_buffer::_Create_ubiquitous_buffer(_PBuf));
5581  _Register();
5582  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:308
#define NULL
Definition: vcruntime.h:236
void _Set_buffer_ptr(_In_opt_ _Ubiquitous_buffer *_Buffer_ptr) __CPU_ONLY
Definition: amprt.h:508
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
void _Register() __CPU_ONLY
Definition: amp.h:5634
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
5587  {
5588  _Initialize(_Av, _Cpu_access_type);
5589  copy(_Src_first, _Src_last, *this);
5590  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
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:6008
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Initialize ( Concurrency::accelerator_view  _Av,
Concurrency::accelerator_view  _Associated_Av 
)
inlineprivate
5594  {
5595  unsigned int totalExtent = _Initialize();
5596 
5597  // Staging arrays can only be created if the accelerator_view is on the cpu_accelerator
5598  _Buffer_ptr _PBuf = NULL;
5599 
5600  // release the existing buffer if any before allocation new one
5602 
5603  if (_Is_cpu_accelerator(_Av.accelerator))
5604  {
5605  // If the accelerator _Associated_Av supports zero-copy and the default cpu access type
5606  // for the accelerator is access_type_read_write, create a zero-copy buffer instead of a
5607  // staging buffer
5608  if (_Associated_Av.accelerator.supports_cpu_shared_memory && (_Get_recommended_buffer_host_access_mode(_Associated_Av) == _Read_write_access)) {
5609  _PBuf = _Buffer::_Create_buffer(_Associated_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, access_type_read_write);
5610  }
5611  else {
5612  _PBuf = _Buffer::_Create_stage_buffer(_Associated_Av, _Av, totalExtent, sizeof(_Value_type));
5613  }
5614 
5615  _PBuf->_Map_buffer(_Read_write_access, true /* _Wait */);
5616  }
5617  else
5618  {
5619  _PBuf = _Buffer::_Create_buffer(_Av, _Av, totalExtent, sizeof(_Value_type), false /* _Is_temp */, access_type_auto);
5620  }
5621 
5622  _M_buffer_descriptor._Set_buffer_ptr(_Ubiquitous_buffer::_Create_ubiquitous_buffer(_PBuf));
5623  _Register();
5624  }
friend class accelerator
Definition: amprt.h:1444
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:308
#define NULL
Definition: vcruntime.h:236
_AMPIMP _Access_mode __cdecl _Get_recommended_buffer_host_access_mode(const accelerator_view &_Av)
void _Set_buffer_ptr(_In_opt_ _Ubiquitous_buffer *_Buffer_ptr) __CPU_ONLY
Definition: amprt.h:508
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
void _Register() __CPU_ONLY
Definition: amp.h:5634
Definition: amprt.h:94
Definition: amprt.h:109
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3401
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
5629  {
5630  _Initialize(_Av, _Associated_Av);
5631  copy(_Src_first, _Src_last, *this);
5632  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
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:6008
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  _ASSERTE(_Is_valid_access_mode(_Requested_mode));
5711 
5712  // For an array that has CPU access, the maximum CPU access allowed is that allowed by
5713  // the underlying _Buffer allocation
5714  _Requested_mode = static_cast<_Access_mode>(_Requested_mode & _Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_mode());
5715 
5716  // Refresh the data ptr if we do not have requested access
5717  if ((_Requested_mode == _No_access) || ((_M_buffer_descriptor._M_curr_cpu_access_mode & _Requested_mode) != _Requested_mode))
5718  {
5719  if (_Has_cpu_access() && (_Requested_mode != _No_access))
5720  {
5722  _Buffer_ptr _PBuf;
5723  bool _Zero_copy_cpu_access = !_Is_cpu_accelerator(this->accelerator_view.accelerator);
5724  this->_Get_access_async(_Requested_mode, _PBuf, _Zero_copy_cpu_access)._Get();
5726  }
5727  else
5728  {
5729  if (_Exception)
5730  {
5731  if (!_Has_cpu_access()) {
5732  throw runtime_exception("The array is not accessible on CPU.", E_FAIL);
5733  }
5734  else {
5735  throw runtime_exception("The array is not accessible for reading on CPU.", E_FAIL);
5736  }
5737  }
5738  }
5739  }
5740  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:308
bool _Is_valid_access_mode(_Access_mode _Mode)
Definition: amprt.h:417
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
_AMPIMP _Ret_ _Amp_runtime_trace *__cdecl _Get_amp_trace()
_Access_mode _M_curr_cpu_access_mode
Definition: amprt.h:450
bool _Has_cpu_access() const __CPU_ONLY
Definition: amp.h:5703
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
_Event _Get_access_async(_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) const __CPU_ONLY
Definition: amp.h:5669
_AMPIMP _Buffer_ptr _Get_master_buffer() const
_Access_mode
Definition: amprt.h:88
_AMPIMP ULONG _Start_array_view_synchronize_event_helper(const _Buffer_descriptor &_Buff_desc)
Definition: amprt.h:90
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3401
_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  ,
bool  = true 
)
inlineprivate
5743  {
5744  }
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Register ( )
inlineprivate
5635  {
5636  Concurrency::accelerator_view cpuAv = _Is_cpu_accelerator(this->accelerator_view.accelerator) ?
5637  this->accelerator_view : accelerator(accelerator::cpu_accelerator).default_view;
5639 
5641 
5642  // If the array is on the CPU accelerator then we will ensure that the descriptor
5643  // indicates CPU access
5644  if (_Is_cpu_accelerator(this->accelerator_view.accelerator))
5645  {
5646  _Buffer_ptr _PBuf = NULL;
5647  this->_Get_access_async(_Read_write_access, _PBuf, false)._Get();
5648  }
5649  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
details::_Reference_counted_obj_ptr< details::_Buffer > _Buffer_ptr
Definition: amprt.h:308
#define NULL
Definition: vcruntime.h:236
Class represents a virtual device abstraction on a C++ AMP data-parallel accelerator ...
Definition: amprt.h:1442
_Ret_ _View_shape * _Create_buffer_view_shape() const
Definition: amp.h:5690
_AMPIMP void _Register_view(_In_ _View_key _Key, accelerator_view _Cpu_av, _View_shape_ptr _Shape, _In_opt_ const _View_key _Source_view_key=nullptr)
_AMPIMP void _Get()
Wait until the _Event completes and throw any exceptions that occur.
static _AMPIMP const wchar_t cpu_accelerator[]
String constant for cpu accelerator
Definition: amprt.h:1035
_Event _Get_access_async(_Access_mode _Mode, _Buffer_ptr &_Buf_ptr, bool _Zero_copy_cpu_access=false) const __CPU_ONLY
Definition: amp.h:5669
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:537
Definition: amprt.h:94
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
_AMPIMP void _Discard(_In_ _View_key _Key)
bool _Is_cpu_accelerator(const accelerator &_Accl)
Definition: amprt.h:3401
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Register_copy ( const array< _Value_type, _Rank > &  _Other)
inlineprivate
5652  {
5653  _M_buffer_descriptor._Get_buffer_ptr()->_Register_view_copy(_M_buffer_descriptor._Get_view_key(), _Other._M_buffer_descriptor._Get_view_key());
5654  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
_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:537
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
template<typename _Value_type, int _Rank = 1>
void Concurrency::array< _Value_type, _Rank >::_Unregister ( )
inlineprivate
5657  {
5658  // No need to unregister if the array was moved causing the buffer ptr to be set to NULL
5661  }
5662  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
#define NULL
Definition: vcruntime.h:236
_AMPIMP void _Unregister_view(_In_ _View_key _Key)
_Ret_ _View_key _Get_view_key()
Definition: amprt.h:537
_Ret_ _Ubiquitous_buffer * _Get_buffer_ptr() const __CPU_ONLY
Definition: amprt.h:503
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.

4915  {
4916  Concurrency::copy(*this, _Dest);
4917  }
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:6008
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.

4923  {
4924  Concurrency::copy(*this,_Dest);
4925  }
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:6008
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.

5501  {
5502  _Refresh_data_ptr(_Read_write_access, false /* _Exception */);
5503  return reinterpret_cast<_Value_type*>(_M_buffer_descriptor._M_data_ptr);
5504  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5708
void * _M_data_ptr
Definition: amprt.h:438
Definition: amprt.h:94
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.

5510  {
5511 #pragma warning( push )
5512 #pragma warning( disable : 4880 )
5513  // Casting away constness in amp restricted scope might result in
5514  // undefined behavior, therefore, the compiler will report a level 1 warning
5515  // for it. But the following const_cast is harmless thus we are suppressing
5516  // this warning just for this line.
5517  const_cast<array*>(this)->_Refresh_data_ptr(_Read_access, false /* _Exception */);
5518 #pragma warning( pop )
5519  return reinterpret_cast<const _Value_type*>(_M_buffer_descriptor._M_data_ptr);
5520  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
Definition: amprt.h:91
Definition: array:21
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5708
void * _M_data_ptr
Definition: amprt.h:438
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.

4941  {
4942  return _Get_buffer()->_Get_master_buffer()->_Get_access_on_accelerator_view();
4943  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
_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.

4950  {
4951  return _Get_buffer()->_Get_master_buffer()->_Get_accelerator_view();
4952  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
_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
4959  {
4960  return _Get_buffer()->_Get_master_buffer()->_Get_allowed_host_access_type();
4961  }
_Ret_ _Ubiquitous_buffer * _Get_buffer() const __CPU_ONLY
Definition: amp.h:5664
_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.

4932  {
4933  return _M_extent;
4934  }
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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.

5490  {
5491  std::vector<_Value_type> _return_vector(extent.size());
5492  Concurrency::copy(*this, _return_vector.begin());
5493 
5494  return _return_vector;
5495  }
Definition: type_traits:974
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:6008
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
5046  {
5047  return this->operator[](_Index);
5048  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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
5060  {
5061  return this->operator[](_Index);
5062  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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)
5077  {
5078  static_assert(_Rank == 2, "value_type& array::operator()(int, int) is only permissible on array<T, 2>");
5079  return this->operator[](index<2>(_I0, _I1));
5080  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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)
5095  {
5096  static_assert(_Rank == 2, "const value_type& array::operator()(int, int) is only permissible on array<T, 2>");
5097  return this->operator[](index<2>(_I0, _I1));
5098  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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)
5116  {
5117  static_assert(_Rank == 3, "value_type& array::operator()(int, int, int) is only permissible on array<T, 3>");
5118  return this->operator[](index<3>(_I0, _I1, _I2));
5119  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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)
5137  {
5138  static_assert(_Rank == 3, "const value_type& array::operator()(int, int, int) const is only permissible on array<T, 3>");
5139  return this->operator[](index<3>(_I0, _I1, _I2));
5140  }
_Value_type & operator[](const index< _Rank > &_Index) __GPU
Get the element value indexed by _I
Definition: amp.h:4972
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.
5153  {
5155  }
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.
5168  {
5170  }
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.

4866  {
4867  if (this != &_Other)
4868  {
4869  // First unregister myself from the current buffer
4870  _Unregister();
4871 
4872  _M_extent = _Other._M_extent;
4873  _Initialize(_Other.accelerator_view, _Other.associated_accelerator_view);
4874  Concurrency::copy(_Other, *this);
4875  }
4876  return *this;
4877  }
unsigned int _Initialize() __CPU_ONLY
Definition: amp.h:5558
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
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:6008
void _Unregister() __CPU_ONLY
Definition: amp.h:5656
template<typename _Value_type, int _Rank = 1>
array& Concurrency::array< _Value_type, _Rank >::operator= ( array< _Value_type, _Rank > &&  _Other)
inline

Move Assignment operator.

4883  {
4884  if (this != &_Other)
4885  {
4886  // First unregister myself from the current buffer
4887  _Unregister();
4888 
4889  _M_extent = _Other._M_extent;
4890  _M_multiplier = _Other._M_multiplier;
4891  _M_buffer_descriptor = _Other._M_buffer_descriptor;
4892  this->_Register_copy(_Other);
4893 
4894  // Release the _Other array
4895  _Other._Unregister();
4896  _Other._M_buffer_descriptor._M_data_ptr = NULL;
4897  _Other._M_buffer_descriptor._Set_buffer_ptr(NULL);
4898  }
4899  return *this;
4900  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
#define NULL
Definition: vcruntime.h:236
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5755
Concurrency::extent< _Rank > _M_extent
Definition: amp.h:5749
void _Register_copy(const array &_Other) __CPU_ONLY
Definition: amp.h:5651
void _Unregister() __CPU_ONLY
Definition: amp.h:5656
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

4906  {
4907  Concurrency::copy(_Src,*this);
4908  return *this;
4909  }
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:6008
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
4973  {
4974  // Refresh the data ptr if needed
4976 
4977  _Value_type * _Ptr = reinterpret_cast<_Value_type *>(_M_buffer_descriptor._M_data_ptr);
4978  return _Ptr[_Flatten_helper::func(_M_multiplier._M_base, _Index._M_base)];
4979  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5755
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5708
void * _M_data_ptr
Definition: amprt.h:438
Definition: amprt.h:94
static _T2 func(const _T1 *_Multiplier, const _T2 *_Index) __GPU
Definition: xxamp.h:924
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
4991  {
4992  // Refresh the data ptr if needed
4993 #pragma warning( push )
4994 #pragma warning( disable : 4880 )
4995  // Casting away constness in amp restricted scope might result in
4996  // undefined behavior, therefore, the compiler will report a level 1 warning
4997  // for it. But the following const_cast is harmless thus we are suppressing
4998  // this warning just for this line.
4999  const_cast<array*>(this)->_Refresh_data_ptr(_Read_access);
5000 #pragma warning( pop )
5001 
5002  _Value_type * _Ptr = reinterpret_cast<_Value_type *>(_M_buffer_descriptor._M_data_ptr);
5003  return _Ptr[_Flatten_helper::func(_M_multiplier._M_base, _Index._M_base)];
5004  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
Definition: amprt.h:91
Definition: array:21
Concurrency::extent< _Rank > _M_multiplier
Definition: amp.h:5755
void _Refresh_data_ptr(_Access_mode _Requested_mode, bool _Exception=true) __CPU_ONLY
Definition: amp.h:5708
void * _M_data_ptr
Definition: amprt.h:438
static _T2 func(const _T1 *_Multiplier, const _T2 *_Index) __GPU
Definition: xxamp.h:924
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.
5017  {
5019  }
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.
5032  {
5034  }
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.
5428  {
5429  return array_view<_Value_type,1>(_M_buffer_descriptor, Concurrency::extent<1>(extent.size())).template reinterpret_as<_Value_type2>();
5430  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
Definition: type_traits:974
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.
5440  {
5441 #pragma warning( push )
5442 #pragma warning( disable : 4880 )
5443  // Casting away constness in amp restricted scope might result in
5444  // undefined behavior, therefore, the compiler will report a level 1 warning
5445  // for it. But the following const_cast is harmless thus we are suppressing
5446  // this warning just for this line.
5447  return const_cast<array*>(this)->reinterpret_as<_Value_type2>();
5448 #pragma warning( pop )
5449  }
Definition: array:21
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.
5185  {
5186  array_view<_Value_type,_Rank> _T1(*this);
5187  return _T1.section(_Section_origin, _Section_extent);
5188  }
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.
5203  {
5204  array_view<const _Value_type,_Rank> _T1(*this);
5205  return _T1.section(_Section_origin, _Section_extent);
5206  }
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.
5219  {
5220  return section(Concurrency::index<_Rank>(), _Ext);
5221  }
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:5184
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.
5234  {
5235  return section(Concurrency::index<_Rank>(), _Ext);
5236  }
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:5184
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.
5249  {
5250  array_view<_Value_type,_Rank> _T1(*this);
5251  return _T1.section(_Idx);
5252  }
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.
5265  {
5266  array_view<const _Value_type,_Rank> _T1(*this);
5267  return _T1.section(_Idx);
5268  }
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.
5284  {
5285  array_view<_Value_type,_Rank> _T1(*this);
5286  return _T1.section(_I0,_E0);
5287  }
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.
5303  {
5304  array_view<const _Value_type,_Rank> _T1(*this);
5305  return _T1.section(_I0,_E0);
5306  }
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.
5328  {
5329  array_view<_Value_type,_Rank> _T1(*this);
5330  return _T1.section(_I0,_I1,_E0,_E1);
5331  }
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.
5353  {
5354  array_view<const _Value_type,_Rank> _T1(*this);
5355  return _T1.section(_I0,_I1,_E0,_E1);
5356  }
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.
5384  {
5385  array_view<_Value_type,_Rank> _T1(*this);
5386  return _T1.section(_I0,_I1,_I2,_E0,_E1,_E2);
5387  }
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.
5415  {
5416  array_view<const _Value_type,_Rank> _T1(*this);
5417  return _T1.section(_I0,_I1,_I2,_E0,_E1,_E2);
5418  }
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.
5461  {
5462  return array_view<_Value_type,_New_rank>(_M_buffer_descriptor, _View_extent);
5463  }
_Buffer_descriptor _M_buffer_descriptor
Definition: amp.h:5752
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.
5475  {
5476 #pragma warning( push )
5477 #pragma warning( disable : 4880 )
5478  // Casting away constness in amp restricted scope might result in
5479  // undefined behavior, therefore, the compiler will report a level 1 warning
5480  // for it. But the following const_cast is harmless thus we are suppressing
5481  // this warning just for this line.
5482  return const_cast<array*>(this)->view_as<_New_rank>(_View_extent);
5483 #pragma warning( pop )
5484  }
Definition: array:21

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: