#include <libspe2.h>
#include <stdint.h>
Go to the source code of this file.
Typedefs | |
typedef struct spe_handle | spe_handle_t |
Handle for internal SPE context. | |
Functions | |
spe_handle_t * | init_spes (spe_program_handle_t *program, uint8_t spe_threads, void *globals, uint16_t globals_size, void *locals, uint16_t locals_size) |
Initialize SPEs. | |
void | start_spes (spe_handle_t *handle) |
Start SPE threads. | |
void | join_spes (spe_handle_t *handle) |
Wait until all SPEs have finished. | |
void | free_spes (spe_handle_t *handle) |
Release resources required for the SPEs. |
Definition in file ppu/tools.h.
void free_spes | ( | spe_handle_t * | handle | ) |
Release resources required for the SPEs.
Frees all allocated data structures associated with the given handle.
The SPE threads should have finished before their resources are freed. Use join_spes() to wait for running SPE threads.
handle | The handle to the SPEs whose resources are to be freed. |
spe_handle_t* init_spes | ( | spe_program_handle_t * | program, | |
uint8_t | spe_threads, | |||
void * | globals, | |||
uint16_t | globals_size, | |||
void * | locals, | |||
uint16_t | locals_size | |||
) |
Initialize SPEs.
This function initializes a number of SPEs. Global as well as individual parameters can be transfered to the SPEs automatically.
SPEs are only initialized but not yet started.
program | Program handle of the SPE binary. | |
spe_threads | Number of SPE threads to be started. | |
globals | This data is passed to all SPEs. It must have correct DMA alignment and size. | |
globals_size | Size of global data (globals). | |
locals | Pointer to an array that contains #spe_threads data elements to be passed to each SPE. Data must be aligned properly in a 16byte grid; to achieve this, the size of each data element should be a multiple of 16. | |
locals_size | Size of one private data element (not the size of the list...). |
void join_spes | ( | spe_handle_t * | handle | ) |
Wait until all SPEs have finished.
This method pauses execution until all SPE threads have finished. The threads should have been started via start_spes() before.
handle | The handle to the SPEs which are to be waited for. |
void start_spes | ( | spe_handle_t * | handle | ) |
Start SPE threads.
Start a set of SPESs previously initialized via init_spes().
This method is non-blocking! Use join_spes() to wait until all SPE threads have finished.
handle | The handle to the SPEs which are to be started. |