XT-neighbor
Functions | Variables
xtn.cu File Reference

The core algorithm on a low-level abstraction concerning how buffers, streamings, and memory management techniques fit together. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "xtn_overlap_inner.cu"

Functions

MemoryContext initMemory (int seqLen, bool isGPU)
 private function. More...
 
int cal_max_exponent (size_t input)
 private function. More...
 
MemoryContext cal_memory_stream1 (int seqLen, int distance)
 calculate memory constraint for stream 1 using the upper bound of the memory allocation during the operation. More...
 
MemoryContext cal_memory_stream2 (int seqLen)
 calculate memory constraint for stream 2 using the upper bound of the memory allocation during the operation. More...
 
MemoryContext cal_memory_stream3 (int seqLen)
 calculate memory constraint for stream 3 using the upper bound of the memory allocation during the operation. More...
 
MemoryContext cal_memory_stream4 (int seqLen, bool overlapMode)
 calculate memory constraint for stream 4 using the upper bound of the memory allocattion during the operation. More...
 
MemoryContext cal_memory_lowerbound (int seqLen)
 calculate RAM constraint for lower bound calculation. More...
 
void write_b3 (Int2 *pairOutput, int pairLen)
 callback function to write generated pairs. More...
 
int * concat_histograms (std::vector< int *> histograms, MemoryContext ctx)
 flatten histograms stored as vector<int*> to a 1D array. More...
 
int cal_lowerbounds (std::vector< int *> histograms, int *&lowerbounds, int seqLen, int *buffer)
 calculate the lowerbounds from the collected histogram and memory constraints. More...
 
template<typename T1 , typename T2 >
int ** set_d2_offsets (std::vector< int *> histograms, D2Stream< T1 > *s1, D2Stream< T2 > *s2, int *buffer, MemoryContext ctx)
 apply precalculated bin packing offset to the given 2D buffers. More...
 
void xtn_perform (XTNArgs args, SeqArray *seqArr, SeqInfo *seqInfo, void callback(XTNOutput))
 the main function for XT-neighbor algorithm. More...
 

Variables

D2Stream< Int2 > * b3 = NULL
 
const int MAX_PROCESSING = 1 << 30
 

Detailed Description

The core algorithm on a low-level abstraction concerning how buffers, streamings, and memory management techniques fit together.

Function Documentation

◆ cal_lowerbounds()

int cal_lowerbounds ( std::vector< int *>  histograms,
int *&  lowerbounds,
int  seqLen,
int *  buffer 
)

calculate the lowerbounds from the collected histogram and memory constraints.

◆ cal_max_exponent()

int cal_max_exponent ( size_t  input)

private function.

◆ cal_memory_lowerbound()

MemoryContext cal_memory_lowerbound ( int  seqLen)

calculate RAM constraint for lower bound calculation.

◆ cal_memory_stream1()

MemoryContext cal_memory_stream1 ( int  seqLen,
int  distance 
)

calculate memory constraint for stream 1 using the upper bound of the memory allocation during the operation.

◆ cal_memory_stream2()

MemoryContext cal_memory_stream2 ( int  seqLen)

calculate memory constraint for stream 2 using the upper bound of the memory allocation during the operation.

◆ cal_memory_stream3()

MemoryContext cal_memory_stream3 ( int  seqLen)

calculate memory constraint for stream 3 using the upper bound of the memory allocation during the operation.

◆ cal_memory_stream4()

MemoryContext cal_memory_stream4 ( int  seqLen,
bool  overlapMode 
)

calculate memory constraint for stream 4 using the upper bound of the memory allocattion during the operation.

◆ concat_histograms()

int* concat_histograms ( std::vector< int *>  histograms,
MemoryContext  ctx 
)

flatten histograms stored as vector<int*> to a 1D array.

◆ initMemory()

MemoryContext initMemory ( int  seqLen,
bool  isGPU 
)

private function.

◆ set_d2_offsets()

template<typename T1 , typename T2 >
int** set_d2_offsets ( std::vector< int *>  histograms,
D2Stream< T1 > *  s1,
D2Stream< T2 > *  s2,
int *  buffer,
MemoryContext  ctx 
)

apply precalculated bin packing offset to the given 2D buffers.

◆ write_b3()

void write_b3 ( Int2 pairOutput,
int  pairLen 
)

callback function to write generated pairs.

◆ xtn_perform()

void xtn_perform ( XTNArgs  args,
SeqArray seqArr,
SeqInfo seqInfo,
void   callbackXTNOutput 
)

the main function for XT-neighbor algorithm.

Parameters
argsall flags parsed from command line
seqArrsequence input
seqInfoinformation of each CDR3 sequence, only used in overlap mode
callbackfunction to be invoked once a chunk of output is ready

Variable Documentation

◆ b3

D2Stream<Int2>* b3 = NULL

◆ MAX_PROCESSING

const int MAX_PROCESSING = 1 << 30