初始化 index 类的新实例。
index() restrict(amp,cpu);
index(
const index<_Rank>& _Other
) restrict(amp,cpu);
explicit index(
int _I
) restrict(amp,cpu);
index(
int _I0,
int _I1
) restrict(amp,cpu);
index(
int _I0,
int _I1,
int _I2
) restrict(amp,cpu);
explicit index(
const int _Array[_Rank]
) restrict(amp,cpu);
参数
_Array
带有秩值的一维数组。_I
一维索引的索引位置。_I0
最高有效位维的长度。_I1
接近最高有效维的长度。_I2
最低有效位维的长度。_Other
新 index 对象基于的 index 对象。
Overloads
名称 |
定义 |
---|---|
index() restrict(cpu, amp); |
初始化 index 类的新实例,设置每个维的值为零。 例如,index<3> ix; 将变量初始化到位置(0,0,0)上。 |
index( const index<_Rank>& _Other ) restrict(cpu, amp); |
复制指定的 index 对象初始化 index 类的新实例。 |
explicit index( int _I ) restrict(cpu, amp); index( int _I0, int _I1 ) restrict(cpu, amp); index( int _I0, int _I1, int _I2 ) restrict(cpu, amp); |
使用指定的坐标值或值初始化 index 类的新实例。 这些构造函数仅当索引级别为 1、2 或 3 时才有效。 调用这些构造函数中的一个时使用不兼容的级别会导致兼容错误。 |
explicit index( const int _Array[_Rank] ) restrict(cpu, amp); |
使用指定数组中的坐标和值,初始化 index 类的新实例。 如果数组的长度与索引的级别不相等,则该行为为未定义。 数组值为 NULL 或为非有效指针,则未定义行为。 |
要求
**标头:**amp.h
命名空间: 并发