Skip to content

Commit

Permalink
Merge pull request #6 from exapde/bugfix/julia-python-gpu-compilation
Browse files Browse the repository at this point in the history
Issue #5: Bugfix/julia python gpu compilation
  • Loading branch information
exapde authored Jan 13, 2021
2 parents abe80da + b4511fa commit 0c3013a
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Version0.1/Julia/Gencode/compilecode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ if app.platform == "cpu"
run(string2cmd(compilerstr[6]));
end
elseif app.platform == "gpu"
run(string2cmd(compilerstr[1]));
run(string2cmd(compilerstr[2]));
run(string2cmd(compilerstr[3]));
run(string2cmd(compilerstr[4]));
if app.mpiprocs==1
Expand Down
2 changes: 1 addition & 1 deletion Version0.1/Julia/Gencode/gencodeface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ for k = 1:nbc
else
tmp = tmp * "\telse if (ib == " * string(k) * ")\n";
end
tmp = tmp * "\t\t" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp * "\t\tkernel" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, ng, nc, ncu, nd, ncx, nco, ncw);\n";
end
tmp = tmp * "}\n\n";

Expand Down
2 changes: 2 additions & 0 deletions Version0.1/Python/Gencode/compilecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def compilecode(app):
else:
os.system(compilerstr[5]);
elif app['platform'] == "gpu":
os.system(compilerstr[0]);
os.system(compilerstr[1]);
os.system(compilerstr[2]);
os.system(compilerstr[3]);
if app['mpiprocs']==1:
Expand Down
2 changes: 1 addition & 1 deletion Version0.1/Python/Gencode/gencodeface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def gencodeface(filename, f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, tim
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
else:
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
tmp = tmp + "\t\t" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "\t\tkernel" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "}\n\n";

tmp = tmp + "template void " + gpufile;
Expand Down
2 changes: 2 additions & 0 deletions Version0.2/Julia/Gencode/compilecode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ if app.platform == "cpu"
run(string2cmd(compilerstr[6]));
end
elseif app.platform == "gpu"
run(string2cmd(compilerstr[1]));
run(string2cmd(compilerstr[2]));
run(string2cmd(compilerstr[3]));
run(string2cmd(compilerstr[4]));
if app.mpiprocs==1
Expand Down
2 changes: 1 addition & 1 deletion Version0.2/Julia/Gencode/gencodeface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ for k = 1:nbc
else
tmp = tmp * "\telse if (ib == " * string(k) * ")\n";
end
tmp = tmp * "\t\t" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp * "\t\tkernel" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
end
tmp = tmp * "}\n\n";

Expand Down
2 changes: 2 additions & 0 deletions Version0.2/Python/Gencode/compilecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def compilecode(app):
else:
os.system(compilerstr[5]);
elif app['platform'] == "gpu":
os.system(compilerstr[0]);
os.system(compilerstr[1]);
os.system(compilerstr[2]);
os.system(compilerstr[3]);
if app['mpiprocs']==1:
Expand Down
2 changes: 1 addition & 1 deletion Version0.2/Python/Gencode/gencodeface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def gencodeface(filename, f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, tim
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
else:
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
tmp = tmp + "\t\t" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "\t\tkernel" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "}\n\n";

tmp = tmp + "template void " + gpufile;
Expand Down
2 changes: 2 additions & 0 deletions Version0.3/Julia/Gencode/compilecode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ if app.platform == "cpu"
run(string2cmd(compilerstr[6]));
end
elseif app.platform == "gpu"
run(string2cmd(compilerstr[1]));
run(string2cmd(compilerstr[2]));
run(string2cmd(compilerstr[3]));
run(string2cmd(compilerstr[4]));
if app.mpiprocs==1
Expand Down
2 changes: 1 addition & 1 deletion Version0.3/Julia/Gencode/gencodeface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ for k = 1:nbc
else
tmp = tmp * "\telse if (ib == " * string(k) * ")\n";
end
tmp = tmp * "\t\t" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp * "\t\tkernel" * gpufile * string(k) * "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
end
tmp = tmp * "}\n\n";

Expand Down
2 changes: 2 additions & 0 deletions Version0.3/Python/Gencode/compilecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def compilecode(app):
else:
os.system(compilerstr[5]);
elif app['platform'] == "gpu":
os.system(compilerstr[0]);
os.system(compilerstr[1]);
os.system(compilerstr[2]);
os.system(compilerstr[3]);
if app['mpiprocs']==1:
Expand Down
2 changes: 1 addition & 1 deletion Version0.3/Python/Gencode/gencodeface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def gencodeface(filename, f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, tim
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
else:
tmp = tmp + "\telse if (ib == " + str(k) + ")\n";
tmp = tmp + "\t\t" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "\t\tkernel" + gpufile + str(k) + "<<<gridDim, blockDim>>>(f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time, modelnumber, ng, nc, ncu, nd, ncx, nco, ncw);\n";
tmp = tmp + "}\n\n";

tmp = tmp + "template void " + gpufile;
Expand Down

0 comments on commit 0c3013a

Please sign in to comment.