array::array 建構函式
初始化 RoleService 類別的新執行個體。沒有 array<T,N> 的預設建構函式。所有建構函式只在 CPU 上執行。它們在 Direct3D 目標上無法執行。
explicit array(
const Concurrency::extent<_Rank> & _Extent
) ;
explicit array(
int _E0
) ;
explicit array(
int _E0,
int _E1
) ;
explicit array(
int _E0,
int _E1,
int _E2
) ;
array(
const Concurrency::extent<_Rank>& _Extent,
Concurrency::accelerator_view _Av
) ;
array(
int _E0,
Concurrency::accelerator_view _Av
) ;
array(
int _E0,
int _E1,
Concurrency::accelerator_view _Av
) ;
array(
int _E0,
int _E1,
int _E2,
Concurrency::accelerator_view _Av
) ;
array(
const Concurrency::extent<_Rank>& _Extent,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
array(
int _E0,
accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
array(
int _E0,
int _E1,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
array(
int _E0,
int _E1,
int _E2,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
_InputIterator _Src_last
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
_InputIterator _Src_last
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
_InputIterator _Src_last
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
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
) ;
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) ;
explicit array(
const array_view<const _Value_type,
_Rank>& _Src
) ;
array(
const array_view<const _Value_type,
_Rank>& _Src,
accelerator_view _Av
) ;
array(
const array_view<const _Value_type,
_Rank>& _Src,
accelerator_view _Av,
accelerator_view _Associated_Av
) ;
array(
const array& _Other
) ;
array(
array && _Other
) ;
參數
_Associated_Av
指定陣列的慣用目標位置的 accelerator_view。_Av
指定陣列的 accelerator_view 位置的物件。_Extent
陣列中的每個維度的範圍。_E0
區段範圍的最大元件。_E1
下個區段範圍的最大元件。_E2
區段範圍的最小顯著性元件。InputIterator
輸入 Iterator 的類型。_Src
要複製的物件。_Src_first
源容器中開頭的 Iterator 。_Src_last
Iterator 至最後一個源容器中。_Other
其他資料來源。_Rank
部分的層級。_Value_type
複製項目的資料型別。
備註
開發用建構函式具有兩個 accelerator_view 物件當做建構函式參數。使用開發用陣列,最佳提示重複了兩個快速之間的複本 (CPU 和 Direct3D 快速之間)。開發的陣列會執行資料傳輸進行最佳化,並不穩定的使用者空間記憶體。它們是由開發具有判斷正確的硬體的對齊的緩衝區的 DirectX 支援 CPU 和快速之間的有效率的直接記憶體存取 (DMA) 傳輸。開發用 accelerator_view 陣列的屬性會傳回建構時的第一個快速引數。您無法在呼叫作業時變更或檢查開發用內容中排列時會,如下列程式碼所示。
class SimulationServer
{
array<float,2> acceleratorArray;
array<float,2> stagingArray;
public:
SimulationServer(const accelerator_view& av)
:acceleratorArray(extent<2>(1000,1000), av),
stagingArray(extent<2>(1000,1000), accelerator("cpu"),
accelerator("gpu"))
{
}
void OnCompute()
{
array<float,2> &a = acceleratorArray;
ApplyNetworkChanges(stagingArray.data());
// Starting here, you can't change or examine contents.
a = stagingArray;
parallel_for_each(a.extents, [&](index<2> idx)
{
// Update a[idx] according to simulation.
}
stagingArray = a;
// Starting here, you can change or examine contents.
SendToClient(stagingArray.data());
}
};
需求
標頭檔: amp.h
**命名空間:**並行