-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclustering.hpp
42 lines (38 loc) · 921 Bytes
/
clustering.hpp
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
#ifndef CLUSTERING_HPP
#define CLUSTERING_HPP
#include <string>
#include "cuda_wrapper.hpp"
#include "types.hpp"
class Clustering
{
private:
GraphElem nv_;
GraphElem* commIds_;
//GraphElem* commIdsHost_;
void singleton_partition();
public:
Clustering(const GraphElem& nv) : nv_(nv)
{
commIds_ = new GraphElem [nv_];
//CudaMallocHost(commIdsHost_, sizeof(GraphElem)*nv_);
singleton_partition();
}
~Clustering()
{
delete [] commIds_;
//CudaFreeHost(commIdsHost_);
}
/*
void move_community_to_host
(
GraphElem* commIds,
const GraphElem& nv,
cudaStream_t stream = 0
)
{
CudaMemcpyAsyncDtoH(commIdsHost_, commIds, sizeof(GraphElem)*nv, stream);
}*/
void update_clustering(GraphElem* commIdsHost_);
void dump_partition(const std::string&, GraphElem* new_orders);
};
#endif