arrow_back_ios Back to List

__blockingoffload

Offload KB - offload-library

Old Content Alert

Please note that this is a old document archive and the will most likely be out-dated or superseded by various other products and is purely here for historical purposes.

The basic Offload™ keyword is __blockingoffload - which is used to denote a synchronous or blocking offload block (as opposed to non-blocking offload blocks).

__blockingoffload()
{
	; // performs it's execution on the SPU
};

The __blockingoffload keyword is followed by function-like parenthesis, then the scope of the block. Any work within this scope is performed on the SPU instead of on the PPU. A __blockingoffload block can optionally take parameters that will be passed into the __blockingoffload block's context.

int number = 42;
__blockingoffload(number)
{
	;
};

Within the __blockingoffload block, number has been passed in by value, and can be used in calculations within. Parameters passed into __blockingoffload blocks are useful for bringing local variables on the stack within the __blockingoffload block for use.