#include <omp.h>
#include <string.h>
#include <assert.h>
#include "libgomp_g.h"
Include dependency graph for loop-1.c:
Go to the source code of this file.
Defines | |
#define | N 10000 |
#define | TMPL_1(sched) |
#define | TMPL_2(sched) |
Functions | |
static void | clean_data (void) |
static void | test_data (void) |
static void | set_data (long i, int val) |
static void | test (void) |
int | main () |
Variables | |
static int | S |
static int | E |
static int | INCR |
static int | CHUNK |
static int | NTHR |
static int | data [N] |
#define TMPL_1 | ( | sched | ) |
Value:
static void f_##sched##_1 (void *dummy) \ { \ int iam = omp_get_thread_num (); \ long s0, e0, i; \ if (GOMP_loop_##sched##_start (S, E, INCR, CHUNK, &s0, &e0)) \ do \ { \ for (i = s0; i < e0; i += INCR) \ set_data (i, iam); \ } \ while (GOMP_loop_##sched##_next (&s0, &e0)); \ GOMP_loop_end (); \ } \ static void t_##sched##_1 (void) \ { \ clean_data (); \ GOMP_parallel_start (f_##sched##_1, NULL, NTHR); \ f_##sched##_1 (NULL); \ GOMP_parallel_end (); \ test_data (); \ }
#define TMPL_2 | ( | sched | ) |
Value:
static void f_##sched##_2 (void *dummy) \ { \ int iam = omp_get_thread_num (); \ long s0, e0, i; \ while (GOMP_loop_##sched##_next (&s0, &e0)) \ { \ for (i = s0; i < e0; i += INCR) \ set_data (i, iam); \ } \ GOMP_loop_end_nowait (); \ } \ static void t_##sched##_2 (void) \ { \ clean_data (); \ GOMP_parallel_loop_##sched##_start \ (f_##sched##_2, NULL, NTHR, S, E, INCR, CHUNK); \ f_##sched##_2 (NULL); \ GOMP_parallel_end (); \ test_data (); \ }
static void clean_data | ( | void | ) | [static] |
int main | ( | void | ) |
static void set_data | ( | long | i, | |
int | val | |||
) | [static] |
static void test_data | ( | void | ) | [static] |
int CHUNK [static] |
int data[N] [static] |
Definition at line 14 of file loop-1.c.
Referenced by clean_data(), ompc_team_end(), set_data(), and test_data().
int INCR [static] |
int NTHR [static] |