-
Notifications
You must be signed in to change notification settings - Fork 6
/
kernel.hpp
61 lines (48 loc) · 2.64 KB
/
kernel.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef KERNEL_HPP
#define KERNEL_HPP
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sys/time.h>
#define NUM_OF_AA 21
#define ENCOD_MAT_SIZE 91
#define SCORE_MAT_SIZE 576
namespace gpu_bsw{
__device__ short
warpReduceMax_with_index(short val, short& myIndex, short& myIndex2, unsigned lengthSeqB);
__device__ short
warpReduceMax_with_index_reverse(short val, short& myIndex, short& myIndex2, unsigned lengthSeqB);
__device__ short
warpReduceMax(short val, unsigned lengthSeqB);
__device__ short
blockShuffleReduce_with_index(short myVal, short& myIndex, short& myIndex2, unsigned lengthSeqB);
__device__ short
blockShuffleReduce_with_index_reverse(short myVal, short& myIndex, short& myIndex2, unsigned lengthSeqB);
__device__ short
blockShuffleReduce(short val, unsigned lengthSeqB);
__device__ __host__ short
findMax(short array[], int length, int* ind);
__device__ __host__ short
findMaxFour(short first, short second, short third, short fourth);
__device__ void
traceBack(short current_i, short current_j, short* seqA_align_begin,
short* seqB_align_begin, const char* seqA, const char* seqB, short* I_i,
short* I_j, unsigned lengthSeqB, unsigned lengthSeqA, unsigned int* diagOffset);
__global__ void
sequence_dna_kernel(char* seqA_array, char* seqB_array, unsigned* prefix_lengthA,
unsigned* prefix_lengthB, short* seqA_align_begin, short* seqA_align_end,
short* seqB_align_begin, short* seqB_align_end, short* top_scores, short matchScore, short misMatchScore, short startGap, short extendGap);
__global__ void
sequence_dna_reverse(char* seqA_array, char* seqB_array, unsigned* prefix_lengthA,
unsigned* prefix_lengthB, short* seqA_align_begin, short* seqA_align_end,
short* seqB_align_begin, short* seqB_align_end, short* top_scores, short matchScore, short misMatchScore, short startGap, short extendGap);
__global__ void
sequence_aa_kernel(char* seqA_array, char* seqB_array, unsigned* prefix_lengthA,
unsigned* prefix_lengthB, short* seqA_align_begin, short* seqA_align_end,
short* seqB_align_begin, short* seqB_align_end, short* top_scores, short startGap, short extendGap, short* scoring_matrix, short* encoding_matrix);
__global__ void
sequence_aa_reverse(char* seqA_array, char* seqB_array, unsigned* prefix_lengthA,
unsigned* prefix_lengthB, short* seqA_align_begin, short* seqA_align_end,
short* seqB_align_begin, short* seqB_align_end, short* top_scores, short startGap, short extendGap, short* scoring_matrix, short* encoding_matrix);
}
#endif