swps3
|
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"
Go to the source code of this file.
Macros | |
#define | MAX(a, b) (a>b?a:b) |
#define | MIN(a, b) (a<b?a:b) |
#define | T int8_t |
#define | T int16_t |
#define | T float |
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 SPEProfile * | swps3_createProfileBytePPU (const char *query, int queryLen, const SBMatrix matrix, int maxDbLen) |
EXPORT SPEProfile * | swps3_createProfileFloatPPU (const char *query, int queryLen, const SBMatrix matrix, int maxDbLen) |
EXPORT SPEProfile * | swps3_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 |
PPU frontend to the alignment routines on the SPU.
Definition in file DynProgr_PPU.c.
#define MAX | ( | a, | |
b | |||
) | (a>b?a:b) |
Definition at line 57 of file DynProgr_PPU.c.
Referenced by swps3_alignmentByteSPE(), swps3_alignmentFloatSPE(), and swps3_alignmentShortSPE().
#define MIN | ( | a, | |
b | |||
) | (a<b?a:b) |
Definition at line 58 of file DynProgr_PPU.c.
Referenced by swps3_alignmentByteSPE(), swps3_alignmentFloatSPE(), and swps3_alignmentShortSPE().
#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().
#define T int16_t |
Definition at line 372 of file DynProgr_PPU.c.
#define T float |
Definition at line 372 of file DynProgr_PPU.c.
|
static |
Definition at line 199 of file DynProgr_PPU.c.
References __ALIGNED__, SPE_CMD_ALIGN, and submitSPECommand().
Referenced by swps3_alignmentByteSPE(), swps3_alignmentFloatSPE(), swps3_alignmentProfileSPE(), and swps3_alignmentShortSPE().
|
static |
Creates a profile in the SPE's memory.
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. |
Definition at line 157 of file DynProgr_PPU.c.
References __ALIGNED__, max, min, SPE_CMD_CREATE_PROFILE, and submitSPECommand().
Referenced by swps3_alignmentByteSPE(), swps3_alignmentFloatSPE(), and swps3_alignmentShortSPE().
|
static |
Definition at line 172 of file DynProgr_PPU.c.
References __ALIGNED__, SPEProfile::addr, SPE_CMD_GET_PROFILE, and submitSPECommand().
Referenced by swps3_loadProfileByte(), swps3_loadProfileFloat(), and swps3_loadProfileShort().
|
static |
Initializes a SPE.
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. |
Definition at line 132 of file DynProgr_PPU.c.
References __ALIGNED__, Options::gapExt, Options::gapOpen, maxDbLen, SPE_CMD_INIT, and submitSPECommand().
Referenced by swps3_alignmentByteSPE(), swps3_alignmentFloatSPE(), swps3_alignmentShortSPE(), swps3_loadProfileByte(), swps3_loadProfileFloat(), and swps3_loadProfileShort().
|
static |
Definition at line 182 of file DynProgr_PPU.c.
References __ALIGNED__, SPE_CMD_PUT_PROFILE, and submitSPECommand().
|
static |
Sends a SPECommand to the SPE.
command | A SPEcommand. |
Definition at line 105 of file DynProgr_PPU.c.
References spe_dynprogr_handle.
Referenced by SPEAlign(), SPECreateProfile(), SPEGetProfile(), SPEInit(), and SPEPutProfile().
EXPORT double swps3_alignmentByteSPE | ( | const SBMatrix | matrix, |
const char * | query, | ||
int | queryLen, | ||
const char * | db, | ||
int | dbLen, | ||
Options * | options | ||
) |
Definition at line 217 of file DynProgr_PPU.c.
References error(), Options::gapExt, Options::gapOpen, MATRIX_DIM, max, MAX, min, MIN, SPE_DATA_INT8, SPEAlign(), SPECreateProfile(), SPEInit(), swps3_alignScalar(), and warning().
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 279 of file DynProgr_PPU.c.
References __ALIGNED__, error(), Options::gapExt, Options::gapOpen, MATRIX_DIM, max, MAX, min, MIN, simi, SPE_DATA_FLOAT, SPEAlign(), SPECreateProfile(), SPEInit(), swps3_alignScalar(), and warning().
EXPORT double swps3_alignmentProfileSPE | ( | const char * | db, |
int | dbLen | ||
) |
Profile must have been loaded before!
Definition at line 314 of file DynProgr_PPU.c.
References SPEAlign().
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 247 of file DynProgr_PPU.c.
References __ALIGNED__, error(), Options::gapExt, Options::gapOpen, MATRIX_DIM, max, MAX, min, MIN, simi, SPE_DATA_INT16, SPEAlign(), SPECreateProfile(), SPEInit(), swps3_alignScalar(), and warning().
Referenced by main().
EXPORT SPEProfile* swps3_createProfileBytePPU | ( | const char * | query, |
int | queryLen, | ||
const SBMatrix | matrix, | ||
int | maxDbLen | ||
) |
Definition at line 359 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 | ) |
EXPORT void swps3_loadProfileByte | ( | SPEProfile * | profile, |
int | maxDbLen, | ||
Options * | options | ||
) |
Definition at line 325 of file DynProgr_PPU.c.
References error(), SPE_DATA_INT8, SPEGetProfile(), and SPEInit().
Referenced by main().
EXPORT void swps3_loadProfileFloat | ( | SPEProfile * | profile, |
int | maxDbLen, | ||
Options * | options | ||
) |
Definition at line 347 of file DynProgr_PPU.c.
References error(), SPE_DATA_FLOAT, SPEGetProfile(), and SPEInit().
EXPORT void swps3_loadProfileShort | ( | SPEProfile * | profile, |
int | maxDbLen, | ||
Options * | options | ||
) |
Definition at line 336 of file DynProgr_PPU.c.
References error(), SPE_DATA_INT16, SPEGetProfile(), and SPEInit().
Referenced by main().
|
static |
Definition at line 97 of file DynProgr_PPU.c.
spe_program_handle_t spe_dynprogr_handle |
Referenced by submitSPECommand().