[Openmp-dev] OpenMP support in clang compiler

Jonas Hahnfeld via Openmp-dev openmp-dev at lists.llvm.org
Wed May 2 03:24:44 PDT 2018


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

Am 2018-05-01 21:33, schrieb Joachim Protze via Openmp-dev:
> 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);
> }
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list