array::array-Konstruktor
Initialisiert eine neue Instanz der array-Klasse. Für "array<T,N>" ist kein Standardkonstruktor vorhanden. Alle Konstruktoren werden nur auf der CPU ausgeführt. Sie können nicht auf einem Direct3D-Ziel ausgeführt werden.
explicit array(
const Concurrency::extent<_Rank> & _Extent
) restrict(cpu);
explicit array(
int _E0
) restrict(cpu);
explicit array(
int _E0,
int _E1
) restrict(cpu);
explicit array(
int _E0,
int _E1,
int _E2
) restrict(cpu);
array(
const Concurrency::extent<_Rank>& _Extent,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
array(
int _E0,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
array(
int _E0,
int _E1,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
array(
int _E0,
int _E1,
int _E2,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
array(
const Concurrency::extent<_Rank>& _Extent,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
array(
int _E0,
accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
array(
int _E0,
int _E1,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
array(
int _E0,
int _E1,
int _E2,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
_InputIterator _Src_last
) restrict(cpu);
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
_InputIterator _Src_last
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
_InputIterator _Src_last
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first
) restrict(cpu);
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
) restrict(cpu);
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
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
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
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
) restrict(cpu);
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
) restrict(cpu);
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
const Concurrency::extent<_Rank>& _Extent,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
_InputIterator _Src_last,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
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
) restrict(cpu);
template <
typename _InputIterator
>
array(
int _E0,
int _E1,
int _E2,
_InputIterator _Src_first,
Concurrency::accelerator_view _Av,
Concurrency::accelerator_view _Associated_Av
) restrict(cpu);
explicit array(
const array_view<const _Value_type, _Rank>& _Src
) restrict(cpu);
array(
const array_view<const _Value_type, _Rank>& _Src,
accelerator_view _Av
access_type _Cpu_access_type = access_type_auto
) restrict(cpu);
array(
const array_view<const _Value_type, _Rank>& _Src,
accelerator_view _Av,
accelerator_view _Associated_Av
) restrict(cpu);
array(
const array& _Other
) restrict(cpu);
array(
array && _Other
) restrict(cpu);
Parameter
_Associated_Av
Ein accelerator_view-Objekt, das den bevorzugten Zielort des Arrays angibt._Av
Ein accelerator_view-Objekt, das den Speicherort des Arrays angibt._Cpu_access_type
Das gewünschte access_type-Objekt für das Array auf der CPU. Dieser Parameter hat den Standardwert access_type_auto und überlässt die Bestimmung des CPU- access_type-Objekts der Laufzeit. Das tatsächliche CPU-access_type-Objekt für das Array kann mithilfe der get_cpu_access_type-Methode abgefragt werden._Extent
Der Umfang in jeder Dimension des Arrays._E0
Die wichtigste Komponente des Umfangs dieses Abschnitts._E1
Die zweitwichtigste Komponente des Umfangs dieses Abschnitts._E2
Die unwichtigste Komponente des Umfangs dieses Abschnitts._InputIterator
Der Typ des Eingabeiterators._Src
Das zu kopierende Objekt._Src_first
Ein Anfangsiterator in den Quellcontainer._Src_last
Ein Endeiterator in den Quellcontainer._Other
Andere Datenquelle._Rank
Der Rang des Abschnitts._Value_type
Der Datentyp der Elemente, die kopiert werden.
Hinweise
Stagingkonstruktoren verfügen über zwei accelerator_view-Objekte als Konstruktorparameter. Stagingarrays werden als Hinweis verwendet, um wiederholte Kopien zwischen zwei Zugriffstasten (zwischen der CPU- und einer Direct3D-Zugriffstaste) zu optimieren. Stagingarrays werden für die Datenübertragung optimiert und verfügen nicht über einen stabilen Benutzerbereichsspeicher. Sie werden von DirectX-Stagingpuffer unterstützt, die die richtige Hardwareausrichtung haben, um eine effiziente Übertragung des direkten Speicherzugriffs zwischen der CPU und der Zugriffstaste sicherzustellen. Die accelerator_view-Eigenschaft eines Stagingarrays gibt den Wert des ersten Zugriffstastenarguments zurück, mit dem sie erstellt wurde. Der Inhalt eines Stagingarrays kann bei Beteiligung an einem Übertragungsvorgang weder geändert noch überprüft werden, wie im folgenden Code veranschaulicht.
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());
}
};
Anforderungen
Header: amp.h
Namespace: Nebenläufigkeit