-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainSerial.cpp
74 lines (58 loc) · 1.68 KB
/
MainSerial.cpp
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
#include "serial/Graph.h"
#include "serial/COO.h"
#include "serial/CSR.h"
#include "serial/DCSR.h"
#include "serial/SequentialKernelization.h"
#include "serial/SequentialBuss.h"
#include "serial/SequentialB1.h"
//#include "gpu/COO.cuh"
int main(int argc, char *argv[])
{
/* Num edges, N, N, random entries? */
//COO coo1(4, 4, 4, true);
Graph g(10);
int k = 4;
SequentialKernelization sk(g, k);
if (sk.noSolutionExists)
exit(0);
//for (auto v : sk.GetS())
// g.GetCSR()->removeVertexEdges(v);
//std::cout << g.GetCSR()->toString();
/* Create Induced Subgraph */
//Graph gPrime(g);
SequentialB1 sb1(new Graph(g, sk.GetS()), sk.GetS(), sk.GetKPrime());
sb1.IterateTreeStructure(&sb1);
//SequentialBuss sb(g, k, sk.GetKPrime());
//sb.PrintVCSets();
//SequentialDFKernelization(g, sk, k);
//std::cout << "Calling Insert Elements" << std::endl;
//csr1.insertElements(coo1);
//std::cout << csr1.toString();
/*
int N = 2e7;
float *x, *y;
// Allocate Unified Memory – accessible from CPU or GPU
cudaMallocManaged(&x, N*sizeof(float));
cudaMallocManaged(&y, N*sizeof(float));
// initialize x and y arrays on the host
for (int i = 0; i < N; i++)
{
x[i] = 1.0f;
y[i] = 2.0f;
}
// Run kernel on 20M elements on the GPU
add<<<1, 512>>>(N, x, y);
// Wait for GPU to finish before accessing on host
cudaDeviceSynchronize();
// Free memory
cudaFree(x);
cudaFree(y);
return 0;
// std::cout << coo1.toString();
// std::cout << coo2.toString();
// DCSR dcsr(csr1, 2);
// std::cout << dcsr.toString();
// dcsr.allocateSegments(csr2);
// std::cout << dcsr.toString();
*/
}