DynProgr_PPU.c File Reference

PPU frontend to the alignment routines on the SPU. More...

#include <stdio.h>
#include <malloc.h>
#include <libspe2.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <errno.h>
#include "DynProgr_SPE.h"
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#include <limits.h>
#include <time.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include "debug.h"
#include "swps3.h"
#include "matrix.h"
#include "DynProgr_scalar.h"
#include "DynProgr_PPU.h"
#include "DynProgr_PPU_profile.inc"

Include dependency graph for DynProgr_PPU.c:

Go to the source code of this file.

Defines

#define MAX(a, b)   (a>b?a:b)
#define MIN(a, b)   (a<b?a:b)
#define T   float
#define T   int16_t
#define T   int8_t

Functions

static int SPEAlign (const char *db, int dbLen, double *result)
static int SPECreateProfile (const char *query, int queryLen, const void *matrix, double min, double max)
 Creates a profile in the SPE's memory.
static int SPEGetProfile (const SPEProfile *profile)
static int SPEInit (int dataType, int maxDbLen, Options *options)
 Initializes a SPE.
static int SPEPutProfile (void *profile, int *blockSize)
static int submitSPECommand (SPECommand *command)
 Sends a SPECommand to the SPE.
EXPORT double swps3_alignmentByteSPE (const SBMatrix matrix, const char *query, int queryLen, const char *db, int dbLen, Options *options)
EXPORT double swps3_alignmentFloatSPE (const SBMatrix matrix, const char *query, int queryLen, const char *db, int dbLen, Options *options)
EXPORT double swps3_alignmentProfileSPE (const char *db, int dbLen)
 Profile must have been loaded before!
EXPORT double swps3_alignmentShortSPE (const SBMatrix matrix, const char *query, int queryLen, const char *db, int dbLen, Options *options)
EXPORT SPEProfileswps3_createProfileBytePPU (const char *query, int queryLen, const SBMatrix matrix, int maxDbLen)
EXPORT SPEProfileswps3_createProfileFloatPPU (const char *query, int queryLen, const SBMatrix matrix, int maxDbLen)
EXPORT SPEProfileswps3_createProfileShortPPU (const char *query, int queryLen, const SBMatrix matrix, int maxDbLen)
EXPORT void swps3_freeProfilePPU (SPEProfile *profile)
EXPORT void swps3_loadProfileByte (SPEProfile *profile, int maxDbLen, Options *options)
EXPORT void swps3_loadProfileFloat (SPEProfile *profile, int maxDbLen, Options *options)
EXPORT void swps3_loadProfileShort (SPEProfile *profile, int maxDbLen, Options *options)

Variables

static spe_context_ptr_t spe_context = NULL
spe_program_handle_t spe_dynprogr_handle


Detailed Description

PPU frontend to the alignment routines on the SPU.

Definition in file DynProgr_PPU.c.


Define Documentation

#define MAX ( a,
 )     (a>b?a:b)

Definition at line 57 of file DynProgr_PPU.c.

#define MIN ( a,
 )     (a<b?a:b)

Definition at line 58 of file DynProgr_PPU.c.

#define T   float

Definition at line 372 of file DynProgr_PPU.c.

#define T   int16_t

Definition at line 372 of file DynProgr_PPU.c.

#define T   int8_t

Definition at line 372 of file DynProgr_PPU.c.

Referenced by allocateProfile(), doCreateProfile(), dynProgrLocal(), dynProgrLocal2(), dynProgrLocalBlock(), swps3_createProfileAltivec(), swps3_dynProgrAltivec(), TcreateProfile(), and TdynProgLocal().


Function Documentation

static int SPEAlign ( const char *  db,
int  dbLen,
double *  result 
) [static]

Definition at line 196 of file DynProgr_PPU.c.

static int SPECreateProfile ( const char *  query,
int  queryLen,
const void *  matrix,
double  min,
double  max 
) [static]

Creates a profile in the SPE's memory.

Parameters:
query The query sequence.
queryLen The length of the query sequence.
matrix The scoring matrix with entries of the same type as specified in the SPEInit command.
min The highest value in the scoring matrix.
max The lowest value in the scoring matrix.
See also:
SPEInit()
Returns:
Nonzero on error.

Definition at line 154 of file DynProgr_PPU.c.

static int SPEGetProfile ( const SPEProfile profile  )  [static]

Definition at line 169 of file DynProgr_PPU.c.

static int SPEInit ( int  dataType,
int  maxDbLen,
Options options 
) [static]

Initializes a SPE.

Parameters:
dataType The data type for the computation. Must be one of SPE_ALIGNMENT_TYPE_DOUBLE, SPE_ALIGNMENT_TYPE_FLOAT, SPE_ALIGNMENT_TYPE_INT, SPE_ALIGNMENT_TYPE_SHORT, SPE_ALIGNMENT_TYPE_BYTE.
maxDbLen Maximal possible length of the database sequence.
options Program options.
Returns:
Nonzero on error.

Definition at line 129 of file DynProgr_PPU.c.

static int SPEPutProfile ( void *  profile,
int *  blockSize 
) [static]

Definition at line 179 of file DynProgr_PPU.c.

static int submitSPECommand ( SPECommand command  )  [static]

Sends a SPECommand to the SPE.

Parameters:
command A SPEcommand.
Returns:
Returns nonzero on error.

Definition at line 102 of file DynProgr_PPU.c.

EXPORT double swps3_alignmentByteSPE ( const SBMatrix  matrix,
const char *  query,
int  queryLen,
const char *  db,
int  dbLen,
Options options 
)

Definition at line 214 of file DynProgr_PPU.c.

Referenced by main().

EXPORT double swps3_alignmentFloatSPE ( const SBMatrix  matrix,
const char *  query,
int  queryLen,
const char *  db,
int  dbLen,
Options options 
)

Definition at line 276 of file DynProgr_PPU.c.

EXPORT double swps3_alignmentProfileSPE ( const char *  db,
int  dbLen 
)

Profile must have been loaded before!

Definition at line 311 of file DynProgr_PPU.c.

Referenced by main().

EXPORT double swps3_alignmentShortSPE ( const SBMatrix  matrix,
const char *  query,
int  queryLen,
const char *  db,
int  dbLen,
Options options 
)

Definition at line 244 of file DynProgr_PPU.c.

Referenced by main().

EXPORT SPEProfile* swps3_createProfileBytePPU ( const char *  query,
int  queryLen,
const SBMatrix  matrix,
int  maxDbLen 
)

Definition at line 356 of file DynProgr_PPU.c.

Referenced by main().

EXPORT SPEProfile* swps3_createProfileFloatPPU ( const char *  query,
int  queryLen,
const SBMatrix  matrix,
int  maxDbLen 
)

Definition at line 373 of file DynProgr_PPU.c.

Referenced by main().

EXPORT SPEProfile* swps3_createProfileShortPPU ( const char *  query,
int  queryLen,
const SBMatrix  matrix,
int  maxDbLen 
)

Definition at line 366 of file DynProgr_PPU.c.

Referenced by main().

EXPORT void swps3_freeProfilePPU ( SPEProfile profile  ) 

Definition at line 379 of file DynProgr_PPU.c.

References SPEProfile::addr.

Referenced by main().

EXPORT void swps3_loadProfileByte ( SPEProfile profile,
int  maxDbLen,
Options options 
)

Definition at line 322 of file DynProgr_PPU.c.

Referenced by main().

EXPORT void swps3_loadProfileFloat ( SPEProfile profile,
int  maxDbLen,
Options options 
)

Definition at line 344 of file DynProgr_PPU.c.

EXPORT void swps3_loadProfileShort ( SPEProfile profile,
int  maxDbLen,
Options options 
)

Definition at line 333 of file DynProgr_PPU.c.

Referenced by main().


Variable Documentation

spe_context_ptr_t spe_context = NULL [static]

Definition at line 94 of file DynProgr_PPU.c.

spe_program_handle_t spe_dynprogr_handle


Generated on Thu Jun 5 12:44:40 2008 for swps3 by  doxygen 1.5.4