2 ms·
The semantics of the CUDA (or OpenCL) kernels are identical to the OpenMP Fortran "parallel do" and OpenMP C/C++ "parallel for" (which derive from similar synta
by adrian_b 3y ago
The semantics of the CUDA (or OpenCL) kernels are identical to the OpenMP Fortran "parallel do" and OpenMP C/C++ "parallel for" (which derive from similar syntax proposed by C.A.R. Hoare in 1978 and first implemented in the language Occam).
As you say, the difference between autovectorization and OpenMP or CUDA is that for the latter the programmer specifies the independent sequences of operations, so that the compiler knows with certainty when they can be safely scheduled to be executed concurrently, either on different processor cores or on different SIMD lanes of the same core, therefore the performance of the compiled code is predictable and it does not vary wildly after minor changes in the source code.
Moreover, the compiler can report errors when the programmer introduces by mistake dependencies between sequences of operations that are intended to be independent.