Intel® C++ Compiler 16.0 User and Reference Guide

Summary of Intel® Cilk™ Plus Language Features

Intel® Cilk™ Plus provides a number of related elements such as keywords, command line options, environment variables and pragmas. The following table provides a summary.

Element Description
Keywords:

_Cilk_spawn

Modifies a function call statement to tell the runtime system that the function may (but is not required to) run in parallel with the caller.

See cilk_spawn.

_Cilk_sync

Indicates that the current function cannot continue past this point in parallel with its spawned children.

See cilk_sync.

_Cilk_for

Specifies a loop that permits loop iterations to run in parallel; is a replacement for the normal C/C++ for loop.

This statement divides a loop into chunks containing one or more loop iterations. Each chunk is executed serially, and is spawned as a chunk during the execution of the loop.

See cilk_for.

Pragmas:

cilk grainsize

Specifies the grain size for one cilk_for loop.

See cilk_for.

simd

Expresses vector parallelism for utilizing hardware SIMD parallelism.

See simd.

Predefined Macro:

__cilk

Specifies the supported Intel® Cilk™ Plus version number. The value is set at 200 for this release. If this macro is not defined, the compiler does not support Intel® Cilk™ Plus.

Environment Variables:

CILK_NWORKERS

Specifies the number of worker threads.

See Set Worker Count.

CILK_VERSION

If defined, specifies a file to receive information on the version of the Cilk runtime. The special values “stdout” or “stderr” will cause the version information to be written to the specified stream.

SIMD-Enabled Function:

__declspec(vector)

__attribute__((vector))

Used to write a SIMD-enabled function.

See SIMD-Enabled Functions.

Compiler Options:

[Q]cilk-serialize

Specifies that a Intel® Cilk™ Plus program should be serialized.

See Serialization and cilk-serialize/Qcilk-serialize.

[Q]intel-extensions

Enables Intel language extensions (which include Intel® Cilk™ Plus). Intel language extensions are on by default. To disable, use the negative form of the compiler option.

See intel-extensions/Qintel-extensions.

Header files (located in include/cilk):

cilk/cilk.h

Defines macros that provide names with simpler conventions (cilk_spawn, cilk_sync and cilk_for).

cilk/cilk_api.h

Declares the runtime functions and classes.

cilk/cilk_stub.h

Can be used to serialize an Intel® Cilk™ Plus application.

See Serialization and cilk-serialize/Qcilk-serialize.

cilk/holder.h

Contains the definition of the cilk::holder template.

See Introduction to Holders.

cilk/reducer.h

Contains common reducer definitions.

See Introduction to Reducers.

reducer_list.h reducer_max.h reducer_min.h reducer_opadd.h reducer_opand.h reducer_opor.h reducer_opxor.h reducer_ostream.h reducer_string.h reducer_vector.h

Reducers provided in the reducer library.

See Reducer Library.

See Also