⬆️ ⬇️

OpenMP is now available in Clang!

Soon the first of September. Someone is going to school, someone is going to college. And we suggest starting new projects with the clang compiler, which now supports OpenMP!



The project is available here . Now it is based on clang 3.3. The quick review process is already underway, and soon the code will be uploaded to the clang trunk, which means it will be included in its new releases.



Implemented full support for OpenMP version 3.1. The following tests are successfully passed: the OpenMP validation kit from the OpenUH Research Compiler, SPEC OMP2012, and Intel internal tests. Executable code with OpenMP, compiled by clang, demonstrates performance comparable to other compilers that support OpenMP.

The run-time library used is the Intel OpenMP Runtime Library , also available under a free license.



We will not write for a long time all the advantages of OpenMP specification, let us just say that it is an industrial standard for parallelizing programs with shared memory. This indicates the achievement of a significant stage in the development of clang, the scope of which has become even wider.

')

The project was launched by Mahesha HS and executed by several Intel engineers from Moscow, among which Alexey Bataev can be identified. The code review was conducted by Hal Finkel, Dmitry Gribenko and Doug Gregor.



Remarks on the code, tests or errors found are extremely welcome (do not forget that github is an open area) - we will be very grateful to you for that.



And finally:



$ cat hello.c #include <stdio.h> int main() { #pragma omp parallel printf("Hello, Habr!\n"); } $ clang -fopenmp hello.c -o ./hello_habr $ ./hello_habr Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! Hello, Habr! 

Source: https://habr.com/ru/post/191912/



All Articles