-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinder_kernel.cuh
62 lines (51 loc) · 1.64 KB
/
finder_kernel.cuh
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
#ifndef MOTIF_FINDER_FINDER_KERNEL_CUH
#define MOTIF_FINDER_FINDER_KERNEL_CUH
#include <sequence_hashes.h>
#include "gpu_memory.h"
#include "gpu_cuda_params.h"
// these are wrapper functions for cuda kernels
// EXTERNAL
class GpuExternalMemory {
public:
GpuExternalMemory(const GpuCudaParams ¶ms, const SequenceHashes &sequence_hashes);
~GpuExternalMemory();
GpuMemoryPtr alloc;
uint32_t shared_memory_size {0};
uint32_t sequences_count {0};
uint32_t weights_count {0};
uint16_t *weights_out {nullptr};
uint32_t *seq_hashes {nullptr};
uint32_t *seq_lengths {nullptr};
uint32_t *seq_begins {nullptr};
uint32_t *motif_hashes {nullptr};
};
void motif_finder_gpu_external(
const std::vector<uint32_t> &_motif_hashes,
const GpuExternalMemory &gpu_mem,
const GpuCudaParams ¶ms,
std::vector<uint16_t> &out_motif_weights,
uint32_t motif_idx_offset,
uint32_t motifs_count,
int device_id);
// INTERNAL
class GpuInternalMemory {
public:
GpuInternalMemory(const GpuCudaParams ¶ms, const SequenceHashes &sequence_hashes);
~GpuInternalMemory();
GpuMemoryPtr alloc;
uint32_t shared_memory_size {0};
uint32_t sequences_count {0};
uint32_t weights_count {0};
uint16_t *weights_out {nullptr};
uint32_t *seq_hashes {nullptr};
uint32_t *seq_lengths {nullptr};
uint32_t *seq_begins {nullptr};
};
void motif_finder_gpu_internal(
const GpuInternalMemory &gpu_mem,
const GpuCudaParams ¶ms,
std::vector<uint16_t> &out_motif_weights,
uint32_t motif_idx_offset,
uint32_t motifs_count,
int device_id);
#endif //MOTIF_FINDER_FINDER_KERNEL_CUH