testsuite/libgomp.c/loop-1.c File Reference

#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 Documentation

#define N   10000

Definition at line 12 of file loop-1.c.

#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 ();                         \
}

Definition at line 47 of file loop-1.c.

#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 ();                     \
}

Definition at line 74 of file loop-1.c.


Function Documentation

static void clean_data ( void   )  [static]

Definition at line 16 of file loop-1.c.

References data, and memset().

Referenced by test(), test_1(), and test_2().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void   ) 

Definition at line 110 of file loop-1.c.

References CHUNK, E, INCR, N, NTHR, omp_set_dynamic(), and test.

Here is the call graph for this function:

static void set_data ( long  i,
int  val 
) [static]

Definition at line 38 of file loop-1.c.

References data, and N.

Referenced by f_1(), f_2(), and f_static_1().

Here is the caller graph for this function:

static void test ( void   )  [static]

Definition at line 100 of file loop-1.c.

static void test_data ( void   )  [static]

Definition at line 21 of file loop-1.c.

References data, E, i, INCR, j, and N.

Referenced by test(), test_1(), and test_2().

Here is the caller graph for this function:


Variable Documentation

int CHUNK [static]

Definition at line 13 of file loop-1.c.

Referenced by f_static_1(), main(), and test_data().

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 E [static]

Definition at line 13 of file loop-1.c.

Referenced by f(), main(), and test_data().

int INCR [static]

Definition at line 13 of file loop-1.c.

Referenced by f_static_1(), main(), and test_data().

int NTHR [static]

Definition at line 13 of file loop-1.c.

Referenced by main(), test(), test_1(), test_2(), and test_data().

int S [static]

Definition at line 13 of file loop-1.c.


Generated on Fri Apr 5 05:40:57 2013 for Libgomp by  doxygen 1.4.7