-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC changes and autotuner support for GPU backend
- Loading branch information
1 parent
6754d68
commit 08c3ae8
Showing
27 changed files
with
968 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ | |
.settings/ | ||
.idea/ | ||
build/ | ||
autotune/*.json | ||
*.graphit_bin | ||
*.graphit_sbin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
python ../build/bin/graphitc.py -a algotorun.gt -f schedule_0 -o test.cu | ||
/usr/local/cuda/bin/nvcc -ccbin /usr/bin/c++ -std=c++11 -I ../src/runtime_lib/ -o test -Xcompiler "-w" -O3 test.cu -DNUM_CTA=80 -DCTA_SIZE=512 -Wno-deprecated-gpu-targets -gencode arch=compute_70,code=sm_70 --use_fast_math -Xptxas "-v -dlcm=ca --maxrregcount=64" -rdc=true -DFRONTIER_MULTIPLIER=3 | ||
#/usr/local/cuda/bin/nvcc -ccbin /usr/bin/c++ -std=c++11 -I ../src/runtime_lib/ -o test -Xcompiler "-w" -O3 test.cu -DNUM_CTA=60 -DCTA_SIZE=512 -Wno-deprecated-gpu-targets -gencode arch=compute_61,code=sm_61 --use_fast_math -Xptxas "-v -dlcm=ca --maxrregcount=64" -rdc=true -DFRONTIER_MULTIPLIER=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
element Vertex end | ||
element Edge end | ||
|
||
const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]); | ||
const vertices : vertexset{Vertex} = edges.getVertices(); | ||
const parent : vector{Vertex}(int) = -1; | ||
|
||
|
||
func updateEdge(src : Vertex, dst : Vertex) | ||
parent[dst] = src; | ||
end | ||
|
||
func toFilter(v : Vertex) -> output : bool | ||
output = parent[v] == -1; | ||
end | ||
|
||
func reset(v: Vertex) | ||
parent[v] = -1; | ||
end | ||
|
||
func main() | ||
for trail in 0:10 | ||
var frontier : vertexset{Vertex} = new vertexset{Vertex}(0); | ||
startTimer(); | ||
vertices.apply(reset); | ||
var start_vertex : int = atoi(argv[2]); | ||
frontier.addVertex(start_vertex); | ||
parent[start_vertex] = start_vertex; | ||
|
||
#s0# while (frontier.getVertexSetSize() != 0) | ||
#s1# var output : vertexset{Vertex} = edges.from(frontier).to(toFilter).applyModified(updateEdge,parent, true); | ||
delete frontier; | ||
frontier = output; | ||
end | ||
var elapsed_time : float = stopTimer(); | ||
delete frontier; | ||
print "elapsed time: "; | ||
print elapsed_time; | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
element Vertex end | ||
element Edge end | ||
|
||
const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]); | ||
|
||
const vertices : vertexset{Vertex} = edges.getVertices(); | ||
const IDs : vector{Vertex}(int) = 1; | ||
|
||
const update: vector[1](int); | ||
|
||
func updateEdge(src : Vertex, dst : Vertex) | ||
var src_id: Vertex = IDs[src]; | ||
var dst_id: Vertex = IDs[dst]; | ||
|
||
IDs[dst_id] min= IDs[src_id]; | ||
IDs[src_id] min= IDs[dst_id]; | ||
end | ||
|
||
func init(v : Vertex) | ||
IDs[v] = v; | ||
end | ||
|
||
func pjump(v: Vertex) | ||
var y: Vertex = IDs[v]; | ||
var x: Vertex = IDs[y]; | ||
if x != y | ||
IDs[v] = x; | ||
update[0] = 1; | ||
end | ||
end | ||
|
||
func main() | ||
var n : int = edges.getVertices(); | ||
for trail in 0:10 | ||
var frontier : vertexset{Vertex} = new vertexset{Vertex}(n); | ||
startTimer(); | ||
vertices.apply(init); | ||
#s0# while (frontier.getVertexSetSize() != 0) | ||
#s1# var output: vertexset{Vertex} = edges.from(frontier).applyModified(updateEdge,IDs); | ||
delete frontier; | ||
frontier = output; | ||
update[0] = 1; | ||
while update[0] != 0 | ||
update[0] = 0; | ||
vertices.apply(pjump); | ||
end | ||
end | ||
var elapsed_time : float = stopTimer(); | ||
delete frontier; | ||
print "elapsed time: "; | ||
print elapsed_time; | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
element Vertex end | ||
element Edge end | ||
const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]); | ||
const vertices : vertexset{Vertex} = edges.getVertices(); | ||
const old_rank : vector{Vertex}(float) = 1.0/vertices.size(); | ||
const new_rank : vector{Vertex}(float) = 0.0; | ||
const out_degree : vector {Vertex}(int) = edges.getOutDegrees(); | ||
const contrib : vector{Vertex}(float) = 0.0; | ||
const error : vector{Vertex}(float) = 0.0; | ||
const damp : float = 0.85; | ||
const beta_score : float = (1.0 - damp) / vertices.size(); | ||
|
||
func computeContrib(v : Vertex) | ||
contrib[v] = old_rank[v] / out_degree[v]; | ||
end | ||
|
||
func updateEdge(src : Vertex, dst : Vertex) | ||
new_rank[dst] += contrib[src]; | ||
end | ||
|
||
func updateVertex(v : Vertex) | ||
var old_score : float = old_rank[v]; | ||
new_rank[v] = beta_score + damp*(new_rank[v]); | ||
error[v] = fabs(new_rank[v] - old_rank[v]); | ||
old_rank[v] = new_rank[v]; | ||
new_rank[v] = 0.0; | ||
end | ||
|
||
func printRank(v : Vertex) | ||
print old_rank[v]; | ||
end | ||
|
||
func reset(v: Vertex) | ||
old_rank[v] = 1.0/vertices.size(); | ||
new_rank[v] = 0.0; | ||
end | ||
|
||
func main() | ||
for trail in 0:10 | ||
startTimer(); | ||
vertices.apply(reset); | ||
#s0# for i in 0:20 | ||
vertices.apply(computeContrib); | ||
#s1# edges.apply(updateEdge); | ||
vertices.apply(updateVertex); | ||
end | ||
|
||
var elapsed_time : float = stopTimer(); | ||
print "elapsed time: "; | ||
print elapsed_time; | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.