DynProgr_altivec.cc File Reference

Profile generation and alignment on IBM Altivec^TM instruction set. More...

#include "matrix.h"
#include "DynProgr_altivec.h"
#include <cstdlib>
#include <malloc.h>
#include <float.h>
#include <cstdio>
#include <string.h>
#include <altivec.h>
#include <sys/types.h>

Include dependency graph for DynProgr_altivec.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  IsInteger< u_int16_t >
struct  IsInteger< u_int32_t >
struct  IsInteger< u_int8_t >
struct  IsSigned< T >
struct  MaxValue< T >
struct  MaxValue< double >
struct  MaxValue< float >
struct  MinValue< T >
struct  MinValue< double >
struct  MinValue< float >
struct  Profile< T, V >

Defines

#define ALIGN16(x)   (((x)+15)&(-16))

Typedefs

typedef vector float v_float_t
 Saturated addition for floating point data types.

Functions

template<typename T, typename V>
static Profile< T, V > * allocateProfile (int len)
 Allocates a profile data structure.
template<typename T, typename V>
static T dynProgrLocal (const char *db, int dbLen, Profile< T, V > *profile, Options *options)
 Performs an local alignment using the given profile and database sequence.
template<typename T, typename V>
static T dynProgrLocal2 (const char *db, int dbLen, Profile< T, V > *profile, Options *options)
 Unrolled version of dynProgrLocal.
template<typename T, typename V>
void freeProfile (Profile< T, V > *profile)
 Releases memory occupied by a profile data structure.
template<typename T>
static T max (T a, T b)
template<typename T>
static T min (T a, T b)
template<typename T, typename V, typename X>
EXPORT Profile< T, V > * swps3_createProfileAltivec (const char *query, int queryLen, X *simi)
 Template version for allocation and computation of a profile for the given data type and similarity matrix.
EXPORT void * swps3_createProfileByteAltivec (const char *query, int queryLen, SBMatrix matrix)
 C version for allocation and computation of a 8-bit integer profile for the given data type and similarity matrix.
EXPORT void * swps3_createProfileFloatAltivec (const char *query, int queryLen, SBMatrix matrix)
 C version for allocation and computation of a 32-bit floating point profile for the given data type and similarity matrix.
EXPORT void * swps3_createProfileShortAltivec (const char *query, int queryLen, SBMatrix matrix)
 C version for allocation and computation of a 16-bit integer profile for the given data type and similarity matrix.
template<typename T, typename V>
EXPORT double swps3_dynProgrAltivec (const char *db, int dbLen, Profile< T, V > *profile, Options *options)
 Template version of alignment routine for Altivec.
EXPORT double swps3_dynProgrByteAltivec (const char *db, int dbLen, void *profile, Options *options)
 C version of alignment routine for Altivec for signed 8-bit integers.
EXPORT double swps3_dynProgrFloatAltivec (const char *db, int dbLen, void *profile, Options *options)
 C version of alignment routine for Altivec for signed 32-bit floating point values.
EXPORT double swps3_dynProgrShortAltivec (const char *db, int dbLen, void *profile, Options *options)
 C version of alignment routine for Altivec for signed 16-bit integers.
template<typename V>
static V vec_addx (V a, V b)
 Saturated addition for integer data types.
template<>
static v_float_t vec_addx< v_float_t > (v_float_t a, v_float_t b)
template<typename V>
static V vec_subx (V a, V b)
 Saturated subtraction for integer data types.
template<>
static v_float_t vec_subx< v_float_t > (v_float_t a, v_float_t b)


Detailed Description

Profile generation and alignment on IBM Altivec^TM instruction set.

Definition in file DynProgr_altivec.cc.


Define Documentation

#define ALIGN16 (  )     (((x)+15)&(-16))

Definition at line 40 of file DynProgr_altivec.cc.

Referenced by alloc(), allocateProfile(), dynProgrLocal(), dynProgrLocal2(), handleCommand(), swps3_createProfileAltivec(), TcreateProfile(), and TdynProgLocal().


Typedef Documentation

typedef vector float v_float_t

Saturated addition for floating point data types.

Saturated substraction for floating point data types.

Definition at line 118 of file DynProgr_altivec.cc.


Function Documentation

template<typename T, typename V>
static Profile<T,V>* allocateProfile ( int  len  )  [inline, static]

Allocates a profile data structure.

Parameters:
T The datatype for the profile.
V The datatype of the corresponding packed vectors.
len The query length.
Returns:
A profile data structure.

Definition at line 81 of file DynProgr_altivec.cc.

References ALIGN16, Profile< T, V >::len, Profile< T, V >::loadOpt, MATRIX_DIM, Profile< T, V >::profile, profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, and T.

template<typename T, typename V>
static T dynProgrLocal ( const char *  db,
int  dbLen,
Profile< T, V > *  profile,
Options options 
) [inline, static]

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

Parameters:
db The database sequence.
dbLen The length of the database sequence.
profile The profile created previously from the query sequence.
options Some global options.
Returns:
The local alignment score or a maximum value if result exceeds threshold.

Definition at line 152 of file DynProgr_altivec.cc.

References ALIGN16, Profile< T, V >::bias, Options::gapExt, Options::gapOpen, Profile< T, V >::len, LIKELY, Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, T, UNLIKELY, vec_addx(), and vec_subx().

template<typename T, typename V>
static T dynProgrLocal2 ( const char *  db,
int  dbLen,
Profile< T, V > *  profile,
Options options 
) [inline, static]

Unrolled version of dynProgrLocal.

Parameters:
db The database sequence.
dbLen The length of the database sequence.
profile The profile created previously from the query sequence.
options Some global options.
Returns:
The local alignment score or a maximum value if result exceeds threshold.
See also:
dynProgrLocal()

swps3_createProfileAltivec()

Definition at line 365 of file DynProgr_altivec.cc.

References ALIGN16, Profile< T, V >::bias, Options::gapExt, Options::gapOpen, Profile< T, V >::len, LIKELY, Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, Profile< T, V >::storeOpt, T, UNLIKELY, vec_addx(), and vec_subx().

template<typename T, typename V>
void freeProfile ( Profile< T, V > *  profile  )  [inline]

Releases memory occupied by a profile data structure.

Definition at line 98 of file DynProgr_altivec.cc.

References Profile< T, V >::loadOpt, Profile< T, V >::profile, Profile< T, V >::rD, and Profile< T, V >::storeOpt.

template<typename T>
static T max ( a,
b 
) [inline, static]

Definition at line 44 of file DynProgr_altivec.cc.

template<typename T>
static T min ( a,
b 
) [inline, static]

Definition at line 43 of file DynProgr_altivec.cc.

template<typename T, typename V, typename X>
EXPORT Profile<T,V>* swps3_createProfileAltivec ( const char *  query,
int  queryLen,
X *  simi 
) [inline]

Template version for allocation and computation of a profile for the given data type and similarity matrix.

Parameters:
T The data type for the alignment scores.
V The corresponding packed vector data type.
X The data type of the similarity matrix.
query The query sequence.
queryLen The length of the query sequence.
simi The similarity matrix.
Returns:
An initialized profile data structure.

Definition at line 629 of file DynProgr_altivec.cc.

References ALIGN16, MATRIX_DIM, Profile< T, V >::profile, profile, and T.

EXPORT void* swps3_createProfileByteAltivec ( const char *  query,
int  queryLen,
SBMatrix  matrix 
)

C version for allocation and computation of a 8-bit integer profile for the given data type and similarity matrix.

Parameters:
query The query sequence.
queryLen The length of the query sequence.
matrix The similarity matrix.
Returns:
An initialized profile data structure.

Definition at line 774 of file DynProgr_altivec.cc.

Referenced by main().

EXPORT void* swps3_createProfileFloatAltivec ( const char *  query,
int  queryLen,
SBMatrix  matrix 
)

C version for allocation and computation of a 32-bit floating point profile for the given data type and similarity matrix.

Parameters:
query The query sequence.
queryLen The length of the query sequence.
matrix The similarity matrix.
Returns:
An initialized profile data structure.

Definition at line 804 of file DynProgr_altivec.cc.

Referenced by main().

EXPORT void* swps3_createProfileShortAltivec ( const char *  query,
int  queryLen,
SBMatrix  matrix 
)

C version for allocation and computation of a 16-bit integer profile for the given data type and similarity matrix.

Parameters:
query The query sequence.
queryLen The length of the query sequence.
matrix The similarity matrix.
Returns:
An initialized profile data structure.

Definition at line 789 of file DynProgr_altivec.cc.

Referenced by main().

template<typename T, typename V>
EXPORT double swps3_dynProgrAltivec ( const char *  db,
int  dbLen,
Profile< T, V > *  profile,
Options options 
) [inline]

Template version of alignment routine for Altivec.

To be called from C++ code.

Parameters:
T The data type for the alignment scores.
V The corresponding packed vector data type.
db The database sequence.
dbLen The length of the database sequence.
profile A profile data structure previously computed from the query sequence.
options Some global options.
Returns:
The local alignment score or DBL_MAX if score exceeds threshold.
See also:
swps3_createProfileAltivec()

Definition at line 669 of file DynProgr_altivec.cc.

References T.

EXPORT double swps3_dynProgrByteAltivec ( const char *  db,
int  dbLen,
void *  profile,
Options options 
)

C version of alignment routine for Altivec for signed 8-bit integers.

Parameters:
db The database sequence.
dbLen The length of the database sequence.
profile A profile data structure previously computed from the query sequence.
options Some global options.
Returns:
The local alignment score or DBL_MAX if score exceeds threshold.
See also:
swps3_createProfileByteAltivec()

swps3_dynProgrAltivec()

Definition at line 718 of file DynProgr_altivec.cc.

Referenced by main().

EXPORT double swps3_dynProgrFloatAltivec ( const char *  db,
int  dbLen,
void *  profile,
Options options 
)

C version of alignment routine for Altivec for signed 32-bit floating point values.

Parameters:
db The database sequence.
dbLen The length of the database sequence.
profile A profile data structure previously computed from the query sequence.
options Some global options.
Returns:
The local alignment score or DBL_MAX if score exceeds threshold.
See also:
swps3_createProfileFloatAltivec()

swps3_dynProgrAltivec()

Definition at line 759 of file DynProgr_altivec.cc.

Referenced by main().

EXPORT double swps3_dynProgrShortAltivec ( const char *  db,
int  dbLen,
void *  profile,
Options options 
)

C version of alignment routine for Altivec for signed 16-bit integers.

Parameters:
db The database sequence.
dbLen The length of the database sequence.
profile A profile data structure previously computed from the query sequence.
options Some global options.
Returns:
The local alignment score or DBL_MAX if score exceeds threshold.
See also:
swps3_createProfileShortAltivec()

swps3_dynProgrAltivec()

Definition at line 738 of file DynProgr_altivec.cc.

Referenced by main().

template<typename V>
static V vec_addx ( a,
b 
) [inline, static]

Saturated addition for integer data types.

Definition at line 110 of file DynProgr_altivec.cc.

Referenced by dynProgrLocal(), and dynProgrLocal2().

template<>
static v_float_t vec_addx< v_float_t > ( v_float_t  a,
v_float_t  b 
) [inline, static]

template<typename V>
static V vec_subx ( a,
b 
) [inline, static]

Saturated subtraction for integer data types.

Definition at line 127 of file DynProgr_altivec.cc.

Referenced by dynProgrLocal(), and dynProgrLocal2().

template<>
static v_float_t vec_subx< v_float_t > ( v_float_t  a,
v_float_t  b 
) [inline, static]


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