forked from olearczuk/gpu-louvain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodularity_optimisation.cuh
36 lines (29 loc) · 1.13 KB
/
modularity_optimisation.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
#ifndef __MODULARITY_OPTIMISATION__CUH__
#define __MODULARITY_OPTIMISATION__CUH__
#include "utils.cuh"
__constant__ float M;
const int bucketsSize = 8;
const int buckets[] = {0, 4, 8, 16, 32, 84, 319, INT_MAX};
const int primes[] = {7, 13, 29, 53, 127, 479};
// x - number of neighbours processed concurrently, y - vertices per block
const dim3 dims[] {
{4, 32},
{8, 16},
{16, 8},
{32, 4},
{32, 4},
{128, 1},
{128, 1},
};
/**
* Function responsible for executing 1 phase (modularity optimisation)
* @param minGain minimum gain for going to next iteration of this phase
* @param deviceStructures structures kept in device memory
* @param hostStructures structures kept in host memory
* @return information whether any changes were applied
*/
bool optimiseModularity(float minGain, device_structures& deviceStructures, host_structures& hostStructures);
float calculateModularity(int V, float M, device_structures deviceStructures);
void printOriginalToCommunity(device_structures& deviceStructures, host_structures& hostStructures);
void initM(host_structures& hostStructures);
#endif /* __MODULARITY_OPTIMISATION__CUH__ */