Most applications might only use one device, thus we provide a simpler API for such cases. Similar to CUDA, there is a background device that can be used to call methods that would normally require an actual device object.
For example, when allocating memory
The default background device is set to
Methods to fetch and set the background device are
A powerful use of the background device is the ability to easy the inclusion of OCCA in existing libraries. Changing API is not always an easy process, specially when adding a library such as OCCA that targets the most computational intensive parts of the code. Having the background device implicitly allows a device to be used inside methods without passing it as a function argument.