mirror of https://git.wownero.com/dsc/mxe.git
improved test programs of packages libgomp and pthreads
This commit is contained in:
parent
bc2cfdc051
commit
43ba8ad2f1
|
@ -9,9 +9,11 @@ int main(int argc, char *argv[])
|
|||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
omp_set_num_threads(4);
|
||||
|
||||
#pragma omp parallel
|
||||
printf("Hello from thread %d, nthreads %d\n",
|
||||
omp_get_thread_num(), omp_get_num_threads());
|
||||
fprintf(stderr, "Hello from thread %d, nthreads %d\n",
|
||||
omp_get_thread_num(), omp_get_num_threads());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define N 10
|
||||
#define N 4
|
||||
|
||||
void *thread_fn(void *p)
|
||||
{
|
||||
const int *arg = p;
|
||||
fprintf(stderr, "Hello from thread %d\n", *arg);
|
||||
fprintf(stderr, "Hello from thread %d, nthreads %d\n", *arg, N);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue