XT-neighbor
|
The core algorithm on the high-level abstraction concerning data manupulation operations in all 4 stream. More...
#include "generate_combination.cu"
#include "cub.cu"
#include "kernel.cu"
#include "codec.cu"
#include "stream.cu"
#include <limits.h>
Functions | |
int | NUM_BLOCK (int len) |
private function. More... | |
int | cal_offsets (Int3 *inputKeys, int *&inputOffsets, int *&outputLengths, int n, int *buffer) |
private function. More... | |
int | cal_offsets_lowerbound (Int3 *inputKeys, int *inputValues, int *&inputOffsets, int *&outputLengths, int lowerbound, int n, int *buffer) |
private function. More... | |
int | gen_pairs (int *input, int *inputOffsets, int *outputLengths, Int2 *&output, int *&lesserIndex, int lowerbound, int carry, int n, int seqLen) |
private function. More... | |
int | gen_smaller_index (int *input, int *inputOffsets, int *outputLengths, int *&output, int carry, int n) |
private function. More... | |
int | deduplicate (Int2 *input, Int2 *output, int n, int *buffer) |
private function. More... | |
int | postprocessing (char *allStr, unsigned int *allStrOffsets, Int2 *uniquePairs, int distance, char measure, Int2 *&pairOutput, char *&distanceOutput, int uniqueLen, int *buffer, int seqLen) |
private function. More... | |
void | make_output (Int2 *pairOut, char *distanceOut, int len, XTNOutput &output) |
private function. More... | |
void | gen_next_chunk (Chunk< Int3 > &keyInOut, Chunk< int > &valueInOut, int *valueOffsets, int offsetLen, int lowerbound, int *buffer) |
private function. More... | |
int | solve_next_bin (int *chunksizes, int start, int maxSize, int n) |
solve bin packing on spot when precalculation is impossible. More... | |
int | solve_bin_packing_lowerbounds (int *histograms, int *&lowerboundsOutput, int n, int seqLen, int *buffer, MemoryContext ctx) |
solve bin packing for lower bound calculation. More... | |
int | solve_bin_packing_offsets (int *histograms, int **&offsetOutput, int n, int *buffer, MemoryContext ctx) |
solve bin packing for 2 dimensional buffer. More... | |
void | stream_handler1 (Chunk< Int3 > input, Int3 *&deletionsOutput, int *&indexOutput, std::vector< int *> &histogramOutput, int &outputLen, int distance, int &carry, MemoryContext ctx) |
handle all GPU operations in stream 1. More... | |
void | stream_handler2 (Chunk< Int3 > &keyInOut, Chunk< int > &valueInOut, std::vector< int *> &histogramOutput, size_t &throughput2B, int distance, int seqLen, int *buffer, MemoryContext ctx) |
handle all GPU operations in stream 2. More... | |
void | stream_handler3 (Chunk< Int3 > &keyInOut, Chunk< int > &valueInOut, void callback(Int2 *, int), std::vector< int *> &histogramOutput, int lowerbound, int seqLen, int *buffer, MemoryContext ctx) |
handle all GPU operations in stream 3. More... | |
void | stream_handler4_nn (Chunk< Int2 > pairInput, XTNOutput &output, char *allStr, unsigned int *allStrOffsets, int seqLen, int distance, char measure, int *buffer) |
handle all GPU operations in stream 4 nn mode. More... | |
void | convertString (char *allStr, unsigned int *allStrOffsets, Int3 *output, int seqLen) |
convert all sequences to int3 form More... | |
Variables | |
const int | NUM_THREADS = 256 |
const unsigned int | UINT_MIN = 0 |
The core algorithm on the high-level abstraction concerning data manupulation operations in all 4 stream.
int cal_offsets | ( | Int3 * | inputKeys, |
int *& | inputOffsets, | ||
int *& | outputLengths, | ||
int | n, | ||
int * | buffer | ||
) |
private function.
int cal_offsets_lowerbound | ( | Int3 * | inputKeys, |
int * | inputValues, | ||
int *& | inputOffsets, | ||
int *& | outputLengths, | ||
int | lowerbound, | ||
int | n, | ||
int * | buffer | ||
) |
private function.
void convertString | ( | char * | allStr, |
unsigned int * | allStrOffsets, | ||
Int3 * | output, | ||
int | seqLen | ||
) |
convert all sequences to int3 form
allStr | all CDR3 sequences |
allStrOffsets | offset of CDR3 sequences |
output | sequence outputs |
seqLen | number of input CDR3 sequences |
void gen_next_chunk | ( | Chunk< Int3 > & | keyInOut, |
Chunk< int > & | valueInOut, | ||
int * | valueOffsets, | ||
int | offsetLen, | ||
int | lowerbound, | ||
int * | buffer | ||
) |
private function.
int gen_pairs | ( | int * | input, |
int * | inputOffsets, | ||
int * | outputLengths, | ||
Int2 *& | output, | ||
int *& | lesserIndex, | ||
int | lowerbound, | ||
int | carry, | ||
int | n, | ||
int | seqLen | ||
) |
private function.
int gen_smaller_index | ( | int * | input, |
int * | inputOffsets, | ||
int * | outputLengths, | ||
int *& | output, | ||
int | carry, | ||
int | n | ||
) |
private function.
private function.
int NUM_BLOCK | ( | int | len | ) |
private function.
int postprocessing | ( | char * | allStr, |
unsigned int * | allStrOffsets, | ||
Int2 * | uniquePairs, | ||
int | distance, | ||
char | measure, | ||
Int2 *& | pairOutput, | ||
char *& | distanceOutput, | ||
int | uniqueLen, | ||
int * | buffer, | ||
int | seqLen | ||
) |
private function.
int solve_bin_packing_lowerbounds | ( | int * | histograms, |
int *& | lowerboundsOutput, | ||
int | n, | ||
int | seqLen, | ||
int * | buffer, | ||
MemoryContext | ctx | ||
) |
solve bin packing for lower bound calculation.
histograms | flatten histogram matrix |
lowerboundsOutput | output assignment |
n | row count of histograms |
seqLen | array length of sequences |
buffer | reusable 4-byte buffer |
ctx | memory constraints and info |
int solve_bin_packing_offsets | ( | int * | histograms, |
int **& | offsetOutput, | ||
int | n, | ||
int * | buffer, | ||
MemoryContext | ctx | ||
) |
solve bin packing for 2 dimensional buffer.
histograms | flatten histogram matrix |
offsetOutput | output assignment |
n | row count of histograms |
buffer | reusable 4-byte buffer |
ctx | memory constraints and info |
int solve_next_bin | ( | int * | chunksizes, |
int | start, | ||
int | maxSize, | ||
int | n | ||
) |
solve bin packing on spot when precalculation is impossible.
chunksizes | array of chunk sizes |
start | offset of the latest processed chunk |
maxSize | bin size |
n | array length of chunkSizes |
void stream_handler1 | ( | Chunk< Int3 > | input, |
Int3 *& | deletionsOutput, | ||
int *& | indexOutput, | ||
std::vector< int *> & | histogramOutput, | ||
int & | outputLen, | ||
int | distance, | ||
int & | carry, | ||
MemoryContext | ctx | ||
) |
handle all GPU operations in stream 1.
input | input CDR3 sequences |
deletionsOutput | generated deletion forms of CDR3 sequence |
indexOutput | original index of each deletion forms |
histogramOutput | histogram of deletion forms |
outputLen | number of output deletion forms |
distance | distance threshold |
carry | index offset of the chunk |
ctx | memory context |
void stream_handler2 | ( | Chunk< Int3 > & | keyInOut, |
Chunk< int > & | valueInOut, | ||
std::vector< int *> & | histogramOutput, | ||
size_t & | throughput2B, | ||
int | distance, | ||
int | seqLen, | ||
int * | buffer, | ||
MemoryContext | ctx | ||
) |
handle all GPU operations in stream 2.
keyInOut | deletion forms of CDR3 sequence |
valueInOut | index of each deletion forms |
histogramOutput | histogram of indexes |
throughput2B | throughput counting variable |
distance | distance threshold |
seqLen | number of input CDR3 sequences |
buffer | integer buffer |
ctx | memory context |
void stream_handler3 | ( | Chunk< Int3 > & | keyInOut, |
Chunk< int > & | valueInOut, | ||
void | callbackInt2 *, int, | ||
std::vector< int *> & | histogramOutput, | ||
int | lowerbound, | ||
int | seqLen, | ||
int * | buffer, | ||
MemoryContext | ctx | ||
) |
handle all GPU operations in stream 3.
keyInOut | deletion forms of CDR3 sequence |
valueInOut | index of each deletion forms |
callback | pair outputs |
histogramOutput | histogram of generating pairs |
lowerbound | bound of generating pairs |
seqLen | number of input CDR3 sequences |
buffer | integer buffer |
ctx | memory context |
void stream_handler4_nn | ( | Chunk< Int2 > | pairInput, |
XTNOutput & | output, | ||
char * | allStr, | ||
unsigned int * | allStrOffsets, | ||
int | seqLen, | ||
int | distance, | ||
char | measure, | ||
int * | buffer | ||
) |
handle all GPU operations in stream 4 nn mode.
pairInput | nearest neighbor pairs |
output | returning output |
allStr | all CDR3 sequences |
allStrOffsets | offset of CDR3 sequences |
seqLen | number of input CDR3 sequences |
distance | distance threshold |
measure | type of measurement (levenshtein/hamming) |
buffer | integer buffer |
const int NUM_THREADS = 256 |
const unsigned int UINT_MIN = 0 |