Reputation: 22916
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.
Do SIMD construct of openMP require a particular kind of hardware?
Upvotes: 4
Views: 234
Reputation: 22670
The OpenMP simd
construct does not require a particular kind of hardware. The construct merely indicates that a loop can be transformed into a SIMD loop (as per Specification 2.8.1). It is a hint to the compiler, it does not require the compiler to transform it to SIMD instructions.
Actual SIMD loops do require hardware support as detailed by the other answers.
Upvotes: 3
Reputation: 1220
From the 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.
The short answer is Yes. In Detail this is as Mats Peterson states e.g. SSE, AVX, Neon or AltiVec.
The special hardware need results from the description of SIMD lane. However, the underlying technology is not specified and therefore is implementation-dependent (on runtime library). So there might be more or less technologies supported.
Also note that OpenMP statements are ignored if the requirements are not fulfilled. So if you intruduce the statement in your code and the target hardware does not support SIMD instructions no error occurs.
Upvotes: 1
Reputation: 129374
Yes. As per the quoted text in the original question:
using special instructions that perform the same calculation to multiple values at once.
This requires that the processor has such instructions, which is part of the hardware design to implement those instructions. That would be SSE or AVX on x86 processors, AltiVec on PowerPC and Neon on ARM.
Upvotes: 2