-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecution_pipeline.cuh
More file actions
105 lines (86 loc) · 3.16 KB
/
execution_pipeline.cuh
File metadata and controls
105 lines (86 loc) · 3.16 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef EXECUTION_PIPELINE_CUH
#define EXECUTION_PIPELINE_CUH
#include "raii_cudaevent.cuh"
#include <vector>
#include <string>
#include <future>
#include "common.cuh"
#include "parasail_helpers.hpp"
struct BatchData{
size_t batchId = 0;
const SequenceCollection* referenceSequences;
SequenceCollection readSequences;
CudaEvent h2d_Start;
CudaEvent h2d_Stop;
CudaEvent otherkernels_Start;
CudaEvent otherkernels_Stop;
CudaEvent alignmentkernels_Start;
CudaEvent alignmentkernels_Stop;
CudaEvent d2h_Start;
CudaEvent d2h_Stop;
size_t computedCells{};
std::vector<int, PinnedAllocator<int>> h_permutationlist{};
std::vector<int, PinnedAllocator<int>> h_scores{};
std::vector<int, PinnedAllocator<int>> h_readIndexPerReferenceSequence{};
std::vector<int, PinnedAllocator<int>> h_referenceSequenceIdsOfMax{};
std::vector<int, PinnedAllocator<int>> h_numReferenceSequenceIdsPerRead{};
std::vector<int, PinnedAllocator<int>> h_numReferenceSequenceIdsPerReadPrefixSum{};
std::vector<int, PinnedAllocator<int>> h_queryStartPositions_inclusive{};
std::vector<int, PinnedAllocator<int>> h_subjectStartPositions_inclusive{};
std::vector<int, PinnedAllocator<int>> h_queryEndPositions_inclusive{};
std::vector<int, PinnedAllocator<int>> h_subjectEndPositions_inclusive{};
std::vector<ParasailResultData> parasailResultData{};
std::vector<std::string> samresultStrings{};
void clear(){
readSequences.clear();
h_permutationlist.clear();
h_scores.clear();
h_readIndexPerReferenceSequence.clear();
h_referenceSequenceIdsOfMax.clear();
h_numReferenceSequenceIdsPerRead.clear();
h_numReferenceSequenceIdsPerReadPrefixSum.clear();
h_queryStartPositions_inclusive.clear();
h_subjectStartPositions_inclusive.clear();
h_queryEndPositions_inclusive.clear();
h_subjectEndPositions_inclusive.clear();
parasailResultData.clear();
computedCells = 0;
}
};
using BatchDataQueue = SimpleConcurrentQueue<BatchData*>;
std::future<void> launchReadParser(
const Options* options,
BatchDataQueue* inputQueue,
BatchDataQueue* outputQueue,
int deviceId
);
std::future<void> launchOutputWriter(
const Options* options,
BatchDataQueue* inputQueue,
BatchDataQueue* outputQueue,
int deviceId
);
std::future<void> launchCPUTracebackWorker(
const Options* options,
BatchDataQueue* inputQueue,
BatchDataQueue* outputQueue,
const std::vector<std::vector<int>>* substitutionMatrix2D,
parasail_matrix_t* parasailScoringMatrix
);
std::future<void> launchLocalAlignmentGPUTopscoresWorker(
const Options* options,
BatchDataQueue* inputQueue,
BatchDataQueue* outputQueue,
const std::vector<std::vector<int>>* substitutionMatrix2D,
parasail_matrix_t* parasailScoringMatrix,
int deviceId
);
std::future<void> launchSemiglobalAlignmentGPUTopscoresWorker(
const Options* options,
BatchDataQueue* inputQueue,
BatchDataQueue* outputQueue,
const std::vector<std::vector<int>>* substitutionMatrix2D,
parasail_matrix_t* parasailScoringMatrix,
int deviceId
);
#endif