openMP 的 SIMD 构造是否需要特定类型的硬件?

Do SIMD construct of openMP require a particular kind of hardware?

https://bisqwit.iki.fi/story/howto/openmp/

The simd construct (OpenMP 4.0+) OpenMP 4.0 added explicit SIMD parallelism (Single-Instruction, Multiple-Data). SIMD means that multiple calculations will be performed simultaneously by the processor, using special instructions that perform the same calculation to multiple values at once. This is often more efficient than regular instructions that operate on single data values. This is also sometimes called vector parallelism or vector operations (and is in fact the preferred term in OpenACC).

https://en.wikipedia.org/wiki/SIMD

Single instruction, multiple data (SIMD), is a class of parallel computers in Flynn's taxonomy.

openMP 的 SIMD 构造是否需要特定类型的硬件?

是的。根据原始问题中引用的文字:

using special instructions that perform the same calculation to multiple values at once.

这要求处理器具有此类指令,这是实现这些指令的硬件设计的一部分。那将是 x86 处理器上的 SSE 或 AVX,PowerPC 上的 AltiVec 和 ARM 上的 Neon。

来自OpenMP Specification (p. 8)

  • SIMD instruction: A single machine instruction that can operate on multiple data elements.
  • SIMD lane: A software or hardware mechanism capable of processing one data element from a SIMD instruction .
  • SIMD chunk: A set of iterations executed concurrently, each by a SIMD lane , by a single thread by means of SIMD instructions.
  • SIMD loop: A loop that includes at least one SIMD chunk.

简短的回答是。 详细来说,这是 Mats Peterson 所说的,例如SSE、AVX、Neon 或 AltiVec。

特殊硬件需求源于SIMD通道的描述。但是,未指定底层技术,因此是 implementation-dependent(在运行时库上)。所以可能支持的技术或多或少。

另请注意,如果未满足要求,OpenMP 语句将被忽略。因此,如果您在代码中引入该语句并且目标硬件不支持 SIMD 指令,则不会发生错误。

没有

OpenMP simd construct 不需要 需要特定类型的硬件。 construct 仅表示循环 可以 转换为 SIMD 循环(根据 Specification 2.8.1).它是对编译器的提示,不需要编译器将其转换为SIMD指令。

实际 SIMD 循环确实需要硬件支持,如其他答案所述。