-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalphabet.cuh
More file actions
36 lines (26 loc) · 720 Bytes
/
alphabet.cuh
File metadata and controls
36 lines (26 loc) · 720 Bytes
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
#ifndef ALPHABET_CUH
#define ALPHABET_CUH
#include <cstdint>
constexpr int alphabetSize = 5; // A, C, G, T/U, N
struct ConvertLetters_alphabet_4{
__host__ __device__
constexpr std::int8_t operator()(char c){
if(c == 'A') return 0;
if(c == 'C') return 1;
if(c == 'G') return 2;
if(c == 'T' || c == 'U') return 3;
return 0;
}
};
struct ConvertLetters_alphabet_5{
__host__ __device__
constexpr std::int8_t operator()(char c){
if(c == 'A') return 0;
if(c == 'C') return 1;
if(c == 'G') return 2;
if(c == 'T' || c == 'U') return 3;
return 4;
}
};
using ConvertLetters_functor = ConvertLetters_alphabet_5;
#endif