swps3
DynProgr_SPE_functions.cc File Reference

Profile generation and alignment on Cell/BE SPE. More...

#include "DynProgr_SPE_functions.h"
#include "DynProgr_SPE.h"
#include "matrix.h"
#include <cstdlib>
#include <malloc.h>
#include <float.h>
#include <cstdio>
#include <string.h>
#include <spu_intrinsics.h>
#include <sys/types.h>
Include dependency graph for DynProgr_SPE_functions.cc:

Go to the source code of this file.

Classes

struct  IsInteger< T >
 
struct  IsInteger< int16_t >
 
struct  IsInteger< int32_t >
 
struct  IsInteger< int8_t >
 
struct  MaxValue< T >
 
struct  MaxValue< double >
 
struct  MaxValue< float >
 
struct  MinValue< T >
 
struct  MinValue< double >
 
struct  MinValue< float >
 

Functions

template<class T , class V >
static void doCreateProfile (int blockStart, int currentBlockSize, const T *simi, V *currentBlock)
 Computes a profile and writes it to the specified memory location.
 
template<class T , class V >
static T dynProgrLocalBlock (int currentBlockSize, T zero, T goal, T *maxS, T *delS, const V *profile, V *loadOpt, V *storeOpt, V *rD)
 Performs an local alignment using the given profile segment and database sequence.
 
template<typename T >
static T max (T a, T b)
 
template<typename T >
static T min (T a, T b)
 
template<class V >
static V spu_max (V a, V b)
 Emulates a packed maximum operation.
 
template<class V >
static V spu_min (V a, V b)
 Emulates a packed minimum operation.
 
template<class T , class V >
static void TcreateProfile (void)
 Template for creating a profile using global variables as parameters.
 
template<class T , class V >
static double TdynProgLocal (void)
 Template for computing a local alignment score using global variables as parameters.
 

Variables

int blockSize
 length of current profile segment
 
int blockStart
 start position of current profile block
 
vvf_t createProfile []
 A structure for accessing different flavors of the profile creation routine.
 
void * delS
 storage for intermediate column deletion scores
 
dvf_t dynProgLocal []
 A structure for accessing different flavors of the local alignment routine.
 
double fixedDel
 gap initiation penalty
 
double incDel
 gap extension penalty
 
void * loadOpt
 temporary storage for score column
 
int ls1
 query sequence length
 
int ls2
 database sequence length
 
int maxDbLen
 maximal database sequence length
 
void * maxS
 storage for intermediate score row
 
double mn
 minimum score
 
double mx
 maximum score
 
void * profile
 current profile segment
 
void * rD
 temporary storage for row delection scores
 
ppu_addr_t remote_profile
 64-bit pointer to profile location in main memory
 
char * s1
 query sequence
 
char * s2
 database sequence
 
void * simi
 similarity matrix
 
void * storeOpt
 temporary storage for score column
 

Detailed Description

Profile generation and alignment on Cell/BE SPE.

Definition in file DynProgr_SPE_functions.cc.

Function Documentation

template<class T , class V >
static void doCreateProfile ( int  blockStart,
int  currentBlockSize,
const T simi,
V *  currentBlock 
)
static

Computes a profile and writes it to the specified memory location.

Parameters
blockStartCurrent position in the query sequence.
currentBlockSizeLength of current profile segment.
simiThe similarity matrix.
currentBlockMemory location to write the profile to.

Definition at line 559 of file DynProgr_SPE_functions.cc.

References blockStart, ls1, MATRIX_DIM, s1, and T.

Referenced by TcreateProfile().

template<class T , class V >
static T dynProgrLocalBlock ( int  currentBlockSize,
T  zero,
T  goal,
T maxS,
T delS,
const V *  profile,
V *  loadOpt,
V *  storeOpt,
V *  rD 
)
inlinestatic

Performs an local alignment using the given profile segment and database sequence.

Parameters
currentBlockSizeLength of the current profile segment in terms of query sequence characters.
zeroDefines a value for the zero score.
goalDefines a maximum value for the score.
maxSIntermediate row with maximum scores.
delSIntermediate row with column deletion scores.
profileA segment of the profile created previously from the query sequence.
loadOptTemporary storage for a column.
storeOptTemporary storage for a column.
rDTemporary storage for a column of row deletion scores.
Returns
The local alignment score or a maximum value if result exceeds threshold.

Definition at line 97 of file DynProgr_SPE_functions.cc.

References fixedDel, incDel, LIKELY, loadOpt, ls1, ls2, s2, spu_max(), spu_min(), storeOpt, T, and UNLIKELY.

template<typename T >
static T max ( T  a,
T  b 
)
inlinestatic

Definition at line 42 of file DynProgr_SPE_functions.cc.

template<typename T >
static T min ( T  a,
T  b 
)
inlinestatic

Definition at line 41 of file DynProgr_SPE_functions.cc.

Referenced by TcreateProfile(), and TdynProgLocal().

template<class V >
static V spu_max ( a,
b 
)
inlinestatic

Emulates a packed maximum operation.

Definition at line 68 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock().

template<class V >
static V spu_min ( a,
b 
)
inlinestatic

Emulates a packed minimum operation.

Definition at line 74 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock().

template<class T , class V >
static void TcreateProfile ( void  )
static

Template for creating a profile using global variables as parameters.

Parameters
TThe data type for the alignment scores.
VThe corresponding packed vector data type.

Definition at line 583 of file DynProgr_SPE_functions.cc.

References ALIGN16, blockSize, blockStart, doCreateProfile(), ls1, min(), simi, and T.

template<class T , class V >
static double TdynProgLocal ( void  )
static

Template for computing a local alignment score using global variables as parameters.

Parameters
TThe data type for the alignment scores.
VThe corresponding packed vector data type.

Definition at line 595 of file DynProgr_SPE_functions.cc.

References ALIGN16, blockSize, blockStart, delS, loadOpt, ls1, ls2, MATRIX_DIM, MAX_TRANSFER, min(), mn, mx, profile, rD, remote_profile, simi, and T.

Variable Documentation

int blockSize

length of current profile segment

Definition at line 59 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), TcreateProfile(), and TdynProgLocal().

int blockStart

start position of current profile block

Definition at line 59 of file DynProgr_SPE_functions.cc.

Referenced by doCreateProfile(), handleCommand(), TcreateProfile(), and TdynProgLocal().

vvf_t createProfile[]
Initial value:
= {
TcreateProfile<int8_t, vector int8_t>,
TcreateProfile<int16_t, vector int16_t>,
TcreateProfile<int32_t, vector int32_t>,
TcreateProfile<float, vector float>,
TcreateProfile<double, vector double>
}

A structure for accessing different flavors of the profile creation routine.

Definition at line 677 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand().

void * delS

storage for intermediate column deletion scores

Definition at line 62 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), and TdynProgLocal().

dvf_t dynProgLocal[]
Initial value:
= {
TdynProgLocal<int8_t, vector int8_t>,
TdynProgLocal<int16_t, vector int16_t>,
TdynProgLocal<int32_t, vector int32_t>,
TdynProgLocal<float, vector float>,
TdynProgLocal<double, vector double>
}

A structure for accessing different flavors of the local alignment routine.

Definition at line 666 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand().

double fixedDel

gap initiation penalty

Definition at line 61 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock(), and handleCommand().

double incDel

gap extension penalty

Definition at line 61 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock(), and handleCommand().

int ls1
int ls2

database sequence length

Definition at line 58 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock(), handleCommand(), swps3_alignScalar(), and TdynProgLocal().

int maxDbLen

maximal database sequence length

Definition at line 60 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), and SPEInit().

void * maxS

storage for intermediate score row

Definition at line 62 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand().

double mn

minimum score

Definition at line 61 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), and TdynProgLocal().

double mx

maximum score

Definition at line 61 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), and TdynProgLocal().

void * rD

temporary storage for row delection scores

Definition at line 62 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), swps3_alignmentByteSSE(), swps3_alignmentShort2SSE(), swps3_alignmentShortSSE(), and TdynProgLocal().

ppu_addr_t remote_profile

64-bit pointer to profile location in main memory

Definition at line 63 of file DynProgr_SPE_functions.cc.

Referenced by handleCommand(), and TdynProgLocal().

char* s1

query sequence

Definition at line 57 of file DynProgr_SPE_functions.cc.

Referenced by doCreateProfile(), and handleCommand().

char * s2

database sequence

Definition at line 57 of file DynProgr_SPE_functions.cc.

Referenced by dynProgrLocalBlock(), and handleCommand().

void* simi