Commit 38332d2f authored by Andrey Filippov's avatar Andrey Filippov

Added cuda debug

parent 8c98bb6c
...@@ -48,6 +48,9 @@ import static jcuda.nvrtc.JNvrtc.nvrtcCreateProgram; ...@@ -48,6 +48,9 @@ import static jcuda.nvrtc.JNvrtc.nvrtcCreateProgram;
import static jcuda.nvrtc.JNvrtc.nvrtcDestroyProgram; import static jcuda.nvrtc.JNvrtc.nvrtcDestroyProgram;
import static jcuda.nvrtc.JNvrtc.nvrtcGetPTX; import static jcuda.nvrtc.JNvrtc.nvrtcGetPTX;
import static jcuda.nvrtc.JNvrtc.nvrtcGetProgramLog; import static jcuda.nvrtc.JNvrtc.nvrtcGetProgramLog;
import static jcuda.nvrtc.JNvrtc.nvrtcVersion;
import static jcuda.nvrtc.JNvrtc.nvrtcGetNumSupportedArchs;
import static jcuda.nvrtc.JNvrtc.nvrtcGetSupportedArchs;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -505,7 +508,21 @@ public class GPUTileProcessor { ...@@ -505,7 +508,21 @@ public class GPUTileProcessor {
nvrtcProgram program = new nvrtcProgram(); nvrtcProgram program = new nvrtcProgram();
nvrtcCreateProgram( program, sourceCode, null, 0, null, null); nvrtcCreateProgram( program, sourceCode, null, 0, null, null);
String options[] = {"--gpu-architecture=compute_"+capability}; String options[] = {"--gpu-architecture=compute_"+capability};
int [][] nvrtc_version = new int[2][];
int nvrtc_rslt = -1;
/*
nvrtc_rslt= nvrtcVersion(nvrtc_version[0],nvrtc_version[0]);
System.out.println("nvrtcVersion="+nvrtc_version[0][0]+"."+nvrtc_version[1][0]+" (returned "+nvrtc_rslt+").");
*/
int [] nvrtc_num_arch = new int[1];
nvrtc_rslt= nvrtcGetNumSupportedArchs(nvrtc_num_arch);
System.out.println("nvrtc_num_arch="+nvrtc_num_arch[0]+" (returned "+nvrtc_rslt+").");
int [] nvrtc_archs = new int[nvrtc_num_arch[0]];
nvrtc_rslt= nvrtcGetSupportedArchs(nvrtc_archs);
for (int sa: nvrtc_archs) {
System.out.println("Supported arch "+sa);
}
System.out.println();
try { try {
nvrtcCompileProgram(program, options.length, options); nvrtcCompileProgram(program, options.length, options);
OK = true; OK = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment