一个处理器核有多个向量流水线时的simdlen值
The simdlen value when a processor core has multiple vector pipelines
我正在阅读 OpenMP 4.5 标准并试图对 !$omp simd
/ #pragma omp simd
指令下定决心。具体来说,我不清楚允许的 simdlen
值是多少。
如果我的处理器核心带有一个能够进行 256 位向量运算的浮点单元 (FPU),我会使用 simdlen(4)
来处理 64 位浮点变量。
但是,如果一个内核有两个独立的矢量流水线和 128 位寄存器,我应该使用什么 simdlen
值?
tl;博士:
该标准在特定硬件架构与 simd
构造的 simdlen
子句之间没有任何联系,因此它是实现定义的。
我首先要补充的问题是:你需要使用 simdlen
吗?
根据我对 AVX2 和 AVX-512 的不同实现的经验,我会说:不,没有必要 为了在 Xeon 和 Xeon 上利用每个内核的 VPU Xeon Phi,但使用两倍于本机寄存器大小的参数作为参数可能对生成代码的性能有些好处。我认为预期用途是不同的(见背景)。
来自标准:
根据标准(第 74 页,第 22 页),simd
构造(相对于 declare simd
构造)的 simdlen
子句指定 首选行为,而实际行为,以及原始问题的答案,是实现定义的:
If used, the simdlen clause specifies the preferred number of iterations to be executed concurrently. The parameter of the simdlen clause must be a constant positive integer. The number of iterations that are executed concurrently at any given time is implementation defined.
标准中规定的允许值的唯一限制是:
The parameter of the safelen clause must be a constant positive integer expression.
If both simdlen and safelen clauses are specified, the value of the simdlen parameter must be less than or equal to the value of the safelen parameter.
背景:
The simdlen clause was added to the simd construct (see Section 2.8.1 on page 72) to support specification of the exact number of iterations desired per SIMD chunk.
这可用于调用由 declare simd
构造和相应的 simdlen
子句生成的匹配 SIMD 函数,其中后者的语义略有不同:
If a SIMD version is created, the number of concurrent arguments for the function is determined by the simdlen clause.
希望对您有所帮助。
我正在阅读 OpenMP 4.5 标准并试图对 !$omp simd
/ #pragma omp simd
指令下定决心。具体来说,我不清楚允许的 simdlen
值是多少。
如果我的处理器核心带有一个能够进行 256 位向量运算的浮点单元 (FPU),我会使用 simdlen(4)
来处理 64 位浮点变量。
但是,如果一个内核有两个独立的矢量流水线和 128 位寄存器,我应该使用什么 simdlen
值?
tl;博士:
该标准在特定硬件架构与 simd
构造的 simdlen
子句之间没有任何联系,因此它是实现定义的。
我首先要补充的问题是:你需要使用 simdlen
吗?
根据我对 AVX2 和 AVX-512 的不同实现的经验,我会说:不,没有必要 为了在 Xeon 和 Xeon 上利用每个内核的 VPU Xeon Phi,但使用两倍于本机寄存器大小的参数作为参数可能对生成代码的性能有些好处。我认为预期用途是不同的(见背景)。
来自标准:
根据标准(第 74 页,第 22 页),simd
构造(相对于 declare simd
构造)的 simdlen
子句指定 首选行为,而实际行为,以及原始问题的答案,是实现定义的:
If used, the simdlen clause specifies the preferred number of iterations to be executed concurrently. The parameter of the simdlen clause must be a constant positive integer. The number of iterations that are executed concurrently at any given time is implementation defined.
标准中规定的允许值的唯一限制是:
The parameter of the safelen clause must be a constant positive integer expression.
If both simdlen and safelen clauses are specified, the value of the simdlen parameter must be less than or equal to the value of the safelen parameter.
背景:
The simdlen clause was added to the simd construct (see Section 2.8.1 on page 72) to support specification of the exact number of iterations desired per SIMD chunk.
这可用于调用由 declare simd
构造和相应的 simdlen
子句生成的匹配 SIMD 函数,其中后者的语义略有不同:
If a SIMD version is created, the number of concurrent arguments for the function is determined by the simdlen clause.
希望对您有所帮助。