- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm planning on adding OpenMP SIMD pragmas to a project of mine, but I don't really need the full OpenMP; the -openmp-simd option is perfect for me.
The problem is that _OPENMP is (correctly) only defined for full OpenMP; when only -openmp-simd is used there doesn't seem to be any way to detect that the compiler supports it. It would be nice if there were a macro (_OPENMP_SIMD seems logical) to tell if omp simd pragmas are supported. I'd love to be able to do something like
#if (defined(_OPENMP) && (_OPENMP >= 201307L)) || (defined(_OPENMP_SIMD) && (_OPENMP_SIMD >= 201307L)) #pragma omp simd ... #endif
I'd probably wrap it up in a macro, but that's beside the point. As it stands the best I can do is pass something like -DOPENMP_SIMD from the build system, which isn't terrible, but it would be nice to have something a bit more standard so the code is easier to copy around across projects.
FWIW, gcc doesn't have anything for -fopenmp-simd either, but I figured I'd start with ICC since that's where the idea for -fopenmp-simd originated.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have raised a feature request for the same. Will keep you posted when I hear back from the development team on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed GCC bug #80502 about this issue. Assuming they make the requested change, it would be great if ICC and GCC could use the same macro name…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I'm doing that. in addition to checking _OPENMP_SIMD (and living in hope), I'm checking _OPENMP, and allowing people to define a project-specific macro (SIMDE_ENABLE_OPENMP) to force the issue. Now that GCC 7 is out I'll try find someone to poke about that patch…

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page