-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.h
63 lines (59 loc) · 1.48 KB
/
func.h
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
#ifndef FUNCH
#define FUNCH
#include <iostream>
#include <fstream>
#include <ctime>
#include <vector>
#include <cstring>
#include <algorithm>
#include <CL/sycl.hpp>
struct Option {
std::string inputFile;
std::string outputFile;
float threshold;
int wordLength;
};
struct Read {
std::string name;
std::string data;
};
struct Data {
int readsCount;
long readsLength;
int *lengths_dev;
long *offsets_dev;
char *reads_dev;
int *prefix_dev;
unsigned short *words_dev;
int *wordCounts_dev;
unsigned short *orders_dev;
int *gaps_dev;
unsigned int *compressed_dev;
int *wordCutoff_dev;
int *baseCutoff_dev;
};
struct Bench {
unsigned short *table_dev;
int *cluster;
int *remainList;
int remainCount;
int *jobList;
int jobCount;
int representative;
int *result;
};
void checkOption(int argc, char **argv, Option &option);
void selectDevice(Option &option);
void readFile(std::vector<Read> &reads, Option &option);
void copyData(std::vector<Read> &reads, Data &data, Option &option);
void baseToNumber(Data &data);
void createPrefix(Data &data);
void createWords(Data &data, Option &option);
void sortWords(Data &data, Option &option);
void mergeWords(Data &data);
void createCutoff(Data &data, Option &option);
void deleteGap(Data &data);
void compressData(Data &data);
void clustering(Option &option, Data &data, Bench &bench);
void saveFile(Option &option, std::vector<Read> &reads, Bench &bench);
#endif