-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdbscan_elements.cuh
106 lines (60 loc) · 1.67 KB
/
hdbscan_elements.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
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
106
#ifndef STRUCT_HDBSCAN_ELEMENT_CUH
#define STRUCT_HDBSCAN_ELEMENT_CUH
#include <cuda.h>
#include "vector"
#include "cuda_runtime.h"
const int numGPUs = 3;
const int blockSize = 256;
const int k = 32;
const int mpts=k;
const double GPU_SIZE = 8 - 1.85;
//const int dimensions=12;
struct Vertex {
int index;
int grau;
};
// Custom comparator to sort MyStruct based on the 'value' field
bool compareVertexByDegree(const Vertex &a, const Vertex &b);
struct Untie_hub
{
int index;
int score;
};
// Custom comparator to sort MyStruct based on the 'value' field
bool compareVertexByScore(const Untie_hub &a, const Untie_hub &b);
void CheckCUDA_();
struct MSTedge{
int from_node;
int to_node;
float weight;
};
bool compareEdgeByWeight(const MSTedge &a, const MSTedge &b);
struct SingleLinkageNode{
int left_node;
int right_node;
float weight;
int node_size;
};
struct CondensedTreeNode{
int parent;
int child;
float lambda_val;
int child_size;
};
int getMaxChild(CondensedTreeNode *condensed_tree, int size);
int getMaxParent(CondensedTreeNode *condensed_tree, int size);
int getMinParent(CondensedTreeNode *condensed_tree, int size);
float getMaxLambda(CondensedTreeNode *condensed_tree, int size);
std::vector<int> getIndexes(CondensedTreeNode *condesed_tree, int size, int node);
struct Stability{
int cluster_id;
float lambda;
};
struct HashLabels{
float *lambda_array;
};
void Check();
void avoid_pageFault(int numValues,long int *array,int is_cpu=false);
void avoid_pageFault(int numValues,int *array,int is_cpu=false);
void avoid_pageFault(int numValues,Vertex *array,int is_cpu=false);
#endif