notifications
Intel Announces Agreement to Acquire Codeplay Software; Expanding our Open Standards Vision. Learn more here.
highlight_off
arrow_back_ios Back to List

class Local<>

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.

Include: <liboffload>

The Local class template is instantiated within Offload contexts. It creates a local store and will DMA PPU data into local store on construction and DMA it back to main memory on destruction. This provides a very convenient way of caching data referenced by a pointer variable for example. Overloaded operators such as operator* and operator-> enable processing data in the local store without further code changes.

Usage

int DoSomeWork(ParamsBlock* parameters)
{
	liboffload::data::Local<ParamsBlock> localParams(parameters); // constructor dmas data into store
	parameters->param1 = 1; // causes a software-cache write
	localParams->param1 = 2; // write happens on local store
	// localParams data will be written to main memory as it leaves the function scope.
}

Limitations

The __outer PPU pointer passed to the constructor must be aligned to 16 bytes, or naturally aligned if size is < 16.

Reference types are not supported.