forked from beiwang2003/strip_clustering_gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.h
63 lines (51 loc) · 1.56 KB
/
cluster.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 _CLUSTER_
#define _CLUSTER_
#include <cstdlib>
#include <cstdint>
//#ifdef USE_GPU
#include <cuda_runtime_api.h>
//#endif
#if _OPENMP
#include <omp.h>
#endif
#define IDEAL_ALIGNMENT 64
#define CACHELINE_BYTES 64
#define MAX_STRIPS 600000
#define MAX_SEEDSTRIPS 150000
using detId_t = uint32_t;
typedef struct {
detId_t *detId;
uint16_t *stripId, *adc;
int *seedStripsNCIndex, *seedStripsMask, *seedStripsNCMask, *prefixSeedStripsNCMask;
size_t temp_storage_bytes = 0;
void *d_temp_storage = NULL;
int nSeedStripsNC;
int nStrips;
} sst_data_t;
typedef struct {
float *noise, *gain;
bool *bad;
} calib_data_t;
typedef struct {
int *clusterLastIndexLeft, *clusterLastIndexRight;
uint8_t *clusterADCs;
bool *trueCluster;
float *barycenter;
} clust_data_t;
typedef struct {
float setSeedStripsTime;
float setNCSeedStripsTime;
float setStripIndexTime;
float findBoundaryTime;
float checkClusterTime;
} cpu_timing_t;
void print_binding_info();
void allocateSSTData(int max_strips, sst_data_t *sst_data, cudaStream_t stream);
void allocateCalibData(int max_strips, calib_data_t *calib_data);
void allocateClustData(int max_seedstrips, clust_data_t *clust_data, cudaStream_t stream);
void freeSSTData(sst_data_t *sst_data);
void freeCalibData(calib_data_t *calib_data_t);
void freeClustData(clust_data_t *clust_data_t);
void setSeedStripsNCIndex(sst_data_t *sst_data, calib_data_t *calib_data, cpu_timing_t *cpu_timing);
void findCluster(sst_data_t *sst_data, calib_data_t *calib_data, clust_data_t *clust_data, cpu_timing_t *cpu_timing);
#endif