-
Getting Started
-
FAQs
-
Getting Performance
-
Case Studies
-
Offload™ Library
-
C++ Language Extensions
-
Runtime API
-
Command Line Options
- -snvsips3
- -offloadshowptrcalls
- -nomemcpycacheflush
- -minmemcpysize=[n]
- -memcpydmasize=[n]
- -cachesets=[n]
- -warnonouterreadswrites
- -offloadshowptrcalls
- -BEspul[opt]
- -BEspuL[opt]
- -finline-limit=[n]
- -unroll-factor=[n]
- -outputoffloadcode
- -fno-access-control
- -O[n]
- -BEO[n]
- -BEspuopt:[opt]
- -showcallstackonduplerror
- -ignoretrapwordonspu
- -save-temps
- -ocdir [dir]
- -warnouterthiscalls
-
The liboffload header
-
Software caching library
-
Data locality library
-
Constructs library
-
PS3 SDK Function Overloads
-
Technical Information
-
Compiler Errors
- Summary
- Offload1101
- Offload3001
- Offload3005
- Offload3007
- Offload4000
- Offload4001
- Offload4002
- Offload4003
- Offload4105
- Offload4106
- Offload4107
- Offload2401
- Offload2400
- Offload2302
- Offload1108
- Offload1109
- Offload1115
- Offload1122
- Offload1201
- Offload1202
- Offload2000
- Offload2100
- Offload2200
- Offload2301
- Offload4108
-
Compiler Advice
-
Compiler Warnings
-
-
Features
-
Calling PPU functions from SPU
-
Accessing Global Variables
-
PPU virtual methods on SPU
-
Exploiting SPU Performance
-
Using Altivec Instrinsics
-
Using SPU Instrinsics
-
The Software Cache
-
Type Safe Pointers
-
VMX2SPU Engine
-
Compiler Advice
-
Implicit Function Duplication
-
Structure Type Duplication
-
Helpful command line options
-
Offload (SPU) Job functions
-
Core compiler features
-
Getting Started
Your First Offload Block
Your First Offload™ Block
Now You Have Offload™ Installed, Let's Look At The Process Of Offloading Code The To The SPU.
This article was updated on 2011-06-03 04:21:29
Regardless of how you decided to install Offload™, the first offload block that is attempted is a good sanity test for your installation.
Whether you decide to jump right in and integrate Offload™ with your current project, or you would rather create a project from scratch, it is advisable to start small and ensure the installation is working as is expected!
The first step is to create an C++ file, which will be compiled with Offload™. Once you have the given C++ file created, the next step is to set it to use Offload™. When using the Visual Studio 2008 integration, you can right-click on the desired file and select 'Activate Offload', or you could use a custom build step as either a Visual Studio custom build step, or within a makefile.
Create a function within your file:
#include <liboffload>
#include <stdio.h>
void offloadTestBlock()
{
__blockingoffload()
{
printf("Hello world from the SPU!\n");
};
}
By creating a corresponding header file to expose the function elsewhere in your code, or simply by using an extern offloadTestBlock();, you can link the offloaded function with your normal game code.
When using Visual Studio 2008 Integration, compiling the file as is normal will suffice to build the example.
Now compiling this example will create a blocking SPU job which simply prints 'Hello world!' to the console.

