Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
249561ff
Commit
249561ff
authored
Jul 20, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug cuda
parent
6833a295
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
GPUTileProcessor.java
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
+31
-1
No files found.
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
View file @
249561ff
...
@@ -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
;
...
@@ -506,8 +509,35 @@ public class GPUTileProcessor {
...
@@ -506,8 +509,35 @@ public class GPUTileProcessor {
// Use the NVRTC to create a program by compiling the source code
// Use the NVRTC to create a program by compiling the source code
nvrtcProgram
program
=
new
nvrtcProgram
();
nvrtcProgram
program
=
new
nvrtcProgram
();
nvrtcCreateProgram
(
program
,
sourceCode
,
null
,
0
,
null
,
null
);
nvrtcCreateProgram
(
program
,
sourceCode
,
null
,
0
,
null
,
null
);
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
);
int
max_arch
=
0
;
for
(
int
sa:
nvrtc_archs
)
{
max_arch
=
Math
.
max
(
max_arch
,
sa
);
}
for
(
int
sa:
nvrtc_archs
)
{
System
.
out
.
println
(
"Supported arch "
+
sa
);
}
System
.
out
.
println
(
"Max supported arch is "
+
max_arch
+
", gpu capability = "
+
capability
);
if
(
capability
>
max_arch
)
{
capability
=
max_arch
;
System
.
out
.
println
(
"Reduced capability to match NVRTC compiler to "
+
capability
);
}
System
.
out
.
println
();
String
options
[]
=
{
"--gpu-architecture=compute_"
+
capability
,
"--extensible-whole-program"
};
String
options
[]
=
{
"--gpu-architecture=compute_"
+
capability
,
"--extensible-whole-program"
};
System
.
out
.
println
(
"Running NVRTC with the following options:"
);
for
(
String
s:
options
)
{
System
.
out
.
println
(
s
);
}
System
.
out
.
println
();
try
{
try
{
nvrtcCompileProgram
(
program
,
options
.
length
,
options
);
nvrtcCompileProgram
(
program
,
options
.
length
,
options
);
OK
=
true
;
OK
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment