On Sat, Jun 10, 2023 at 07:51:10PM +0200, Jakub Juszczakiewicz via Gcc wrote: > Hi all, > > I don't know is here right place for sharing ideas, but I don't have > idea, where I can send it. > I have simple idea. When I turned on OpenMP, for parallelly execute simple > for it's enough when I add line like this before loop: > > #pragma omp parallel for > for (size_t i = 0; i < 1000000; i++) > vec_c[i] = vec_a[i] * vec_b[i]; > > Why don't use similar idea for show compiler that, it can by done by SIMD > CPU extension? e.g. > > #pragma simd for
Use #pragma omp simd for that. That is part of OpenMP for years. Jakub