-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsw_no_path.cl
executable file
·64 lines (56 loc) · 1.34 KB
/
sw_no_path.cl
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
62
63
64
template <typename T>
__kernel void sw(__global char* seq1,
__global char* seq2,
__global char* subs_matrix,
__global T gap_open,
__global T gap_extend,
__global T* aH,
__global T* aF,
__global T* max_score,
__global int* i_max,
__global int* j_max,
__global int x,
__global int y,
__global int wave_width
)
{
int id = get_global_id(0);
T inf = gap_open + gap_extend + 1;
T up, left, diagonal;
T E, F;
T max_score;
int temp_i_max, temp_j_max;
E = 0;
for(int i = 1; i < x; i++)
{
H[0] = 0;
}
for(int j = 1; j < y; j++)
{
aH[0] = 0;
aF[0] = -inf;
}
for(int i = 1; i < x; i++)
{
E = -inf;
H_diag = 0;
H = 0;
path[0] = 0;
for(int j = 1; j < x; j++)
{
diagonal = H_diag + subs_matrix(func(i,j));
left = max(H_left - gap_open, E - gap_extend);
up = max(H_up - gap_open, F - gap_extend);
H = max(E, F);
H = max(H, diagonal);
H = max(H, 0);
aH[i] = H;
if(H > max_score)
{
max_score = H;
temp_i_max = i;
temp_j_max = j;
}
} //for
} //for
}