This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Let me guess, you are using a redhat system, right ?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;
}
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |