Controls synchronous and asynchronous execution of functions on the CPU and coprocessor. This keyword only applies to Intel® MIC Architecture.


lvalue = _Cilk_offload func_name ( rvalue )

lvalue = _Cilk_offload_to ( target-number ) func_name ( rvalue )

lvalue = _Cilk_spawn _Cilk_offload func_name ( rvalue )

lvalue = _Cilk_spawn _Cilk_offload_to ( target-number ) func_name ( rvalue )

_Cilk_offload _Cilk_for ( init-expr ; test-expr ; incr-expr )

_Cilk_offload_to ( target-number ) _Cilk_for ( init-expr ; test-expr ; incr-expr )



An expression that designates an object.


An expression that represents a value.


A function name.


An expression whose value is interpreted as follows:


Executes the statement on a specified target according to the following formula:

target = target-number % number_of_targets

For example, in a system with four targets:

  • Specifying 2 or 6 tells the runtime systems to execute the code on target 2, because the result of 2 % 4 and 6 % 4 is 2.

  • Specifying 1000 tells the runtime systems to execute the code on target 0, because the result of 1000 % 4 is 0.

-1 or no value

Executes the statements on a target selected by the runtime system.




An initialization expression for a _Cilk_for loop.


A test expression for a _Cilk_for loop.


An increment expression for a _Cilk_for loop.


_Cilk_offload before a function call indicates that the runtime system chooses to execute the function being called either on the host, or on the coprocessor synchronously, and if multiple coprocessors are available, on which coprocessor.

Placing the keyword _Cilk_offload between a _Cilk_spawn keyword and a call results in asynchronous execution on the CPU using the normal Intel® Cilk™ Plus rules, and a synchronous offload of the function by an Intel® Cilk™ Plus task, effectively doing an asynchronous offload. Just as in normal Intel® Cilk™ Plus usage, you need a _Cilk_sync keyword before the CPU can use the results of the offloaded function.

_Cilk_offload before a _Cilk_for loop specifies that the entire loop be executed on the coprocessor.

_Cilk_offload_to (target-number) specifies mandatory offload to a coprocessor. target-number determines the specific coprocessor.


Offload function calls:

z =  _Cilk_offload func(a);
z =  _Cilk_spawn _Cilk_offload func(a);

Offload _Cilk_for loop:

_Cilk_offload _Cilk_for ( init-expr; test-expr; incr-expr ) {
For more complete information about compiler optimizations, see our Optimization Notice.