ordered

ordered

The ordered clause must be present when ordered directives bind to the for construct.

schedule

schedule(kind[,chunksize])

The schedule clause specifies how iterations of the for loop are divided among threads of the team. The kind of schedule can be: static, dynamic, guided, or runtime. chunksize should be a loop invariant integer expression.

num_threads

num_threads(interger-expression)

The num_threads clause allows a user to request a specific number of threads for a parallel construct. If the num_threads clause is present, then the value of the integer expression is the number of threads requested.

Attributes

__attribute__ is a language feature that allows you to add attributes to functions (or with the aligned attribute, to variables or structure fields). The capabilities are similar to those of #pragma. It is more integrated into the language syntax than pragmas and its placement in the source code depends on the construct to which the attribute is being applied.

The attributes supported are:

aligned

malloc

non_exposing

noreturn

format

visibility

warn_unused_result

attribute aligned

__attribute__ (aligned (alignment))

The aligned attribute specifies the minimum alignment for a variable or structure field, measured in bytes. For example, the following declaration causes the compiler to allocate the global variable

xon a 16-byte boundary:

int x __attribute__ ((aligned (16))) = 0;

You can also specify the alignment of structure fields. For example, the following causes the compiler to allocate the field member "x" to be aligned on a 128-byte boundary:

struct foo { int x[2] __attribute__ ((aligned (128)));}

The maximum alignment that can be specified is 128. This feature is for compatibility with gcc.

attribute malloc

__attribute__ ((malloc))

The malloc attribute is used to improve optimization by telling the compiler that:

116 Pragma Directives and Attributes

Page 116
Image 116
HP C/aC++ for PA-RISC Software manual Attributes