OpenMP support in clang compiler

Hi all,

I wonder about the reason, that clang sets the _OPENMP macro to 201107 when compiling with -fopenmp flag. I also found the flag -fopenmp-version=45 which changes the value of the macro to 201511. Unfortunately, I couldn't find information on this flag, especially whether this flag has other effects for the compiler.

Thanks,

Joachim

PS: I used this code for testing:

#include "stdio.h"
int main(){
   printf("%i\n", _OPENMP);
}

Hi,

as discussed off-list this was because Clang didn't support compiling all possible OpenMP 4.0 programs at some point. This means the compiler can only advertise support for OpenMP 3.1 which is fully done. I'm not sure if that level can be raised by now (CC'ing Alexey): http://clang.llvm.org/docs/OpenMPSupport.html lists all directives as "Complete" except for codegen of "declare" directives. Does this mean that Clang can now generate at least fallback code for all OpenMP 4.5 programs?

IIRC -fopenmp-version was added to make code take advantage of, for example, simd directives that are guarded by #ifdef _OPENMP > /.../. I think this will only define _OPENMP to a different value and do nothing else at the moment.

Regards,
Jonas