This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
GCC and OpenMP
- From: cybernike <dragontse at hotmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 13 May 2008 16:11:22 -0700 (PDT)
- Subject: GCC and OpenMP
I am confused. I thought GCC didn't support OpenMP until 4.2, but why my
4.1.2 GCC compiler recognizes the following OpenMP code. Is it safe to use?
#include <omp.h>
#include <stdio.h>
int main (int argc, char *argv[]) {
int id, nthreads;
#pragma omp parallel private (id)
{
id = omp_get_thread_num ();
printf (âHello World from thread %d\nâ, id);
#pragma omp barrier
if (id == 0) {
nthreads = omp_get_num_threads ();
printf (âThere are %d threads\nâ, nthreads);
}
}
return 0;
}
--
View this message in context: http://www.nabble.com/GCC-and-OpenMP-tp17220268p17220268.html
Sent from the gcc - libstdc++ mailing list archive at Nabble.com.