DP-HLS
|
Namespace including the functions of the kernel architecture. More...
Namespaces | |
FindMax | |
Namespace related to functions used to find the maximum elements in in the score matrix. | |
Fixed | |
This namespace contains functions to define the core architectures used in the fixed banding alignment kernel. | |
Rectangular | |
This namespace contains functions to define the core architectures used in the non-banding alignment kernel. | |
Functions | |
void | PrepareLocalQuery (char_t(&query)[MAX_QUERY_LENGTH], char_t(&local_query)[PE_NUM], const idx_t offset) |
At beginning of the computation of each strip, it copy a PE_NUM number of the global query characters into the local query buffer. More... | |
void | InitializeChunkColScore (score_vec_t(&init_col_scr)[PE_NUM], stream_of_blocks< dp_mem_block_t > &dp_mem_out) |
void | PrepareScoresArr (dp_mem_block_t &dp_mem_in, score_vec_t(&init_col_scr)[PE_NUM], int id, score_vec_t(&last_chunk_scr)[2], wavefront_scores_t &up_out, wavefront_scores_t &diag_out, wavefront_scores_t &left_out) |
template<int PE_NUM_T> | |
void | PrepareLocals (const char_t(&query)[MAX_QUERY_LENGTH], char_t(&local_query)[PE_NUM_T], score_vec_t(&init_col_scr)[MAX_QUERY_LENGTH], chunk_col_scores_inf_t &init_col_scr_local, bool(&col_pred)[PE_NUM], const idx_t local_query_len, const idx_t idx) |
This function merge PrepareLocalQuery function and CopyColScore function into one, where CopyColScore is a function to copy a column of initial scores from the global buffer to each PE's local buffer before the computation of each chunk. More... | |
void | InitializeChunkCoordinates (idx_t chunk_row_offset, idx_t chunk_col_offset, hls::vector< idx_t, PE_NUM > &ic, hls::vector< idx_t, PE_NUM > &jc) |
Initialize two lists of coordinates, x coordinate and y coordinate, for each chunk. Theis function is called within the chunk compute function. This is especially useful if the chunk doesn't start at the beginning, i.e. after chunk column offset is developed. More... | |
void | ArrangeTBP (const tbp_vec_t &tbp_in, const idx_t &p_col_offset, const bool(&predicate)[PE_NUM], tbp_t(&chunk_tbp_out)[PE_NUM][TBMEM_SIZE]) |
void | ShiftPredicate (bool(&predicate)[PE_NUM], int idx, int query_len, int reference_len) |
Determine the predicate values by constantantly shifting the predicate array with truth values. More... | |
void | ShiftReference (char_t(&local_reference)[PE_NUM], const char_t(&reference)[MAX_REFERENCE_LENGTH], int idx, int ref_len) |
Shift into the local reference buffer a new reference element, given current wavefront index and reference length. More... | |
void | PreserveRowScore (score_vec_t(&preserved_row_scr)[MAX_REFERENCE_LENGTH], const score_vec_t score_vec, const bool predicate_pe_last, const idx_t idx) |
Write the last PE's output score to the preserved_row_score buffer to be used in the next chunk. More... | |
void | UpdateDPMem (dp_mem_block_t &dp_mem, idx_t i, chunk_col_scores_inf_t &init_col_scr, score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH]) |
Updated the content of the DP Memory with the new scores. It saparates the step of shifting and setting the specific cell with initial scores. More... | |
void | UpdateDPMemShift (dp_mem_block_t &dp_mem) |
void | UpdateDPMemSet (dp_mem_block_t &dp_mem, idx_t i, chunk_col_scores_inf_t &init_col_scr, score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH]) |
void | InitializeScores (score_vec_t(&init_col_scr)[MAX_QUERY_LENGTH], score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH], const Penalties &penalties) |
Initialize initial scores for the first column and row on the device. More... | |
void | ChunkMax (ScorePack &max, ScorePack new_scr) |
void | UpdatePEOffset (idx_t(&pe_offset)[PE_NUM], bool(&predicate)[PE_NUM]) |
void | CopyColScore (chunk_col_scores_inf_t &init_col_scr_local, score_vec_t(&init_col_scr)[MAX_QUERY_LENGTH], idx_t i) |
void | UpdateDPMemSep (score_vec_t(&dp_mem)[PE_NUM+1][2], score_vec_t(&score_in)[PE_NUM+1]) |
void | PrepareScoreBuffer (score_vec_t(&score_buff)[PE_NUM+1], const idx_t i, const chunk_col_scores_inf_t(&init_col_scr), const score_vec_t(&init_row_scr)[MAX_REFERENCE_LENGTH]) |
Namespace including the functions of the kernel architecture.
void Align::ArrangeTBP | ( | const tbp_vec_t & | tbp_in, |
const idx_t & | p_col_offset, | ||
const bool(&) | predicate[PE_NUM], | ||
tbp_t(&) | chunk_tbp_out[PE_NUM][TBMEM_SIZE] | ||
) |
Store the traceback pointers of PE at the correct location in the traceback pointer matrix, based on the predicate and current p_col_offset.
tbp_in | The buffer receiving the traceback pointer from the PE output. |
p_col_offset | Physical column of a wavefront of traceback pointers. |
predicate | Predicates. |
chunk_tbp_out | The traceback pointer memory. |
void Align::CopyColScore | ( | chunk_col_scores_inf_t & | init_col_scr_local, |
score_vec_t(&) | init_col_scr[MAX_QUERY_LENGTH], | ||
idx_t | i | ||
) |
void Align::InitializeChunkColScore | ( | score_vec_t(&) | init_col_scr[PE_NUM], |
stream_of_blocks< dp_mem_block_t > & | dp_mem_out | ||
) |
void Align::InitializeChunkCoordinates | ( | idx_t | chunk_row_offset, |
idx_t | chunk_col_offset, | ||
hls::vector< idx_t, PE_NUM > & | ic, | ||
hls::vector< idx_t, PE_NUM > & | jc | ||
) |
Initialize two lists of coordinates, x coordinate and y coordinate, for each chunk. Theis function is called within the chunk compute function. This is especially useful if the chunk doesn't start at the beginning, i.e. after chunk column offset is developed.
chunk_row_offset | Initial Row of a Chunk |
chunk_col_offset | Initial Column of a Chunk. |
ic | Actual Global Coordinates for i. |
jc | Actual Global Coordinates for j. |
void Align::InitializeScores | ( | score_vec_t(&) | init_col_scr[MAX_QUERY_LENGTH], |
score_vec_t(&) | init_row_scr[MAX_REFERENCE_LENGTH], | ||
const Penalties & | penalties | ||
) |
Initialize initial scores for the first column and row on the device.
init_col_scr,: | Initial scores for the first column. |
init_row_scr,: | Initial scores for the first row. |
void Align::PrepareLocalQuery | ( | char_t(&) | query[MAX_QUERY_LENGTH], |
char_t(&) | local_query[PE_NUM], | ||
const idx_t | offset | ||
) |
At beginning of the computation of each strip, it copy a PE_NUM number of the global query characters into the local query buffer.
query | Query sequence |
local_query | Local query is a buffer of PE_NUM length that is read in parallel by PEs during the wavefront computation. |
offset | The offset in the global query to start copying. |
void Align::PrepareLocals | ( | const char_t(&) | query[MAX_QUERY_LENGTH], |
char_t(&) | local_query[PE_NUM_T], | ||
score_vec_t(&) | init_col_scr[MAX_QUERY_LENGTH], | ||
chunk_col_scores_inf_t & | init_col_scr_local, | ||
bool(&) | col_pred[PE_NUM], | ||
const idx_t | local_query_len, | ||
const idx_t | idx | ||
) |
This function merge PrepareLocalQuery function and CopyColScore function into one, where CopyColScore is a function to copy a column of initial scores from the global buffer to each PE's local buffer before the computation of each chunk.
PE_NUM_T | Number of PE |
query | Query Sequence |
local_query | Local Query Buffer |
init_col_scr | Initial Column Scores |
init_col_scr_local | Local Initial Column Score Buffer. |
idx | The offset in the global buffer to copy. |
void Align::PrepareScoreBuffer | ( | score_vec_t(&) | score_buff[PE_NUM+1], |
const idx_t | i, | ||
const chunk_col_scores_inf_t & | init_col_scr, | ||
const score_vec_t(&) | init_row_scr[MAX_REFERENCE_LENGTH] | ||
) |
void Align::PrepareScoresArr | ( | dp_mem_block_t & | dp_mem_in, |
score_vec_t(&) | init_col_scr[PE_NUM], | ||
int | id, | ||
score_vec_t(&) | last_chunk_scr[2], | ||
wavefront_scores_t & | up_out, | ||
wavefront_scores_t & | diag_out, | ||
wavefront_scores_t & | left_out | ||
) |
void Align::PreserveRowScore | ( | score_vec_t(&) | preserved_row_scr[MAX_REFERENCE_LENGTH], |
const score_vec_t | score_vec, | ||
const bool | predicate_pe_last, | ||
const idx_t | idx | ||
) |
void Align::ShiftPredicate | ( | bool(&) | predicate[PE_NUM], |
int | idx, | ||
int | query_len, | ||
int | reference_len | ||
) |
Determine the predicate values by constantantly shifting the predicate array with truth values.
predicate | Predicate Array. |
idx | Wavefront Index. |
query_len | Actual query Length. |
reference_len | Actual reference Length. |
void Align::ShiftReference | ( | char_t(&) | local_reference[PE_NUM], |
const char_t(&) | reference[MAX_REFERENCE_LENGTH], | ||
int | idx, | ||
int | ref_len | ||
) |
Shift into the local reference buffer a new reference element, given current wavefront index and reference length.
local_reference | The local reference buffer. |
reference | The reference. |
idx | Wavefront index. |
ref_len | Actual reference length. |
void Align::UpdateDPMem | ( | dp_mem_block_t & | dp_mem, |
idx_t | i, | ||
chunk_col_scores_inf_t & | init_col_scr, | ||
score_vec_t(&) | init_row_scr[MAX_REFERENCE_LENGTH] | ||
) |
Updated the content of the DP Memory with the new scores. It saparates the step of shifting and setting the specific cell with initial scores.
dp_mem | DP Memory |
i | The index of the wavefront. |
init_col_scr | Initial Column Scores |
init_row_scr | Initial Row Scores |
void Align::UpdateDPMemSep | ( | score_vec_t(&) | dp_mem[PE_NUM+1][2], |
score_vec_t(&) | score_in[PE_NUM+1] | ||
) |
void Align::UpdateDPMemSet | ( | dp_mem_block_t & | dp_mem, |
idx_t | i, | ||
chunk_col_scores_inf_t & | init_col_scr, | ||
score_vec_t(&) | init_row_scr[MAX_REFERENCE_LENGTH] | ||
) |
void Align::UpdateDPMemShift | ( | dp_mem_block_t & | dp_mem | ) |
void Align::UpdatePEOffset | ( | idx_t(&) | pe_offset[PE_NUM], |
bool(&) | predicate[PE_NUM] | ||
) |