Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tile_processor_gpu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
tile_processor_gpu
Commits
b2ba5af2
Commit
b2ba5af2
authored
Jul 15, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CODEX: Add production-boundary timing gates
Co-authored-by:
Codex
<
codex@elphel.com
>
parent
0bab49b8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
137 additions
and
13 deletions
+137
-13
test_lma_products_jna.cu
jna/test_lma_products_jna.cu
+23
-0
test_pose_corr_jna.cu
jna/test_pose_corr_jna.cu
+114
-13
No files found.
jna/test_lma_products_jna.cu
View file @
b2ba5af2
...
@@ -7,12 +7,14 @@
...
@@ -7,12 +7,14 @@
// cd tile_processor_gpu && /usr/local/cuda-12.8/bin/nvcc -std=c++17 -O2 \
// cd tile_processor_gpu && /usr/local/cuda-12.8/bin/nvcc -std=c++17 -O2 \
// jna/test_lma_products_jna.cu -o tests_bin/test_lma_products_jna \
// jna/test_lma_products_jna.cu -o tests_bin/test_lma_products_jna \
// -L jna -ltileproc -Xlinker -rpath -Xlinker $PWD/jna
// -L jna -ltileproc -Xlinker -rpath -Xlinker $PWD/jna
// Run: tests_bin/test_lma_products_jna [srcdir] [libcudadevrt.a] [profile_calls]
//
//
// Created Jul 14, 2026 by Codex for Elphel.
// Created Jul 14, 2026 by Codex for Elphel.
#include <cstdio>
#include <cstdio>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <chrono>
#include <vector>
#include <vector>
extern "C" {
extern "C" {
...
@@ -37,6 +39,8 @@ int main(int argc, char** argv)
...
@@ -37,6 +39,8 @@ int main(int argc, char** argv)
const char* srcdir = (argc > 1) ? argv[1] : "src";
const char* srcdir = (argc > 1) ? argv[1] : "src";
const char* devrt = (argc > 2) ? argv[2] :
const char* devrt = (argc > 2) ? argv[2] :
"/usr/local/cuda-12.8/targets/x86_64-linux/lib/libcudadevrt.a";
"/usr/local/cuda-12.8/targets/x86_64-linux/lib/libcudadevrt.a";
const int profile_calls = (argc > 3) ? std::atoi(argv[3]) : 0;
if(profile_calls < 0){ std::fprintf(stderr,"profile_calls must be >= 0\n"); return EXIT_FAILURE; }
void* module = tp_create_module(srcdir, devrt);
void* module = tp_create_module(srcdir, devrt);
if(!module){ std::fprintf(stderr,"tp_create_module: %s\n",tp_last_error()); return EXIT_FAILURE; }
if(!module){ std::fprintf(stderr,"tp_create_module: %s\n",tp_last_error()); return EXIT_FAILURE; }
void* proc = tp_proc_create(module);
void* proc = tp_proc_create(module);
...
@@ -79,6 +83,25 @@ int main(int argc, char** argv)
...
@@ -79,6 +83,25 @@ int main(int argc, char** argv)
}
}
std::printf("NVRTC lma_normal_products: %zu doubles, bit-exact -> %s\n",
std::printf("NVRTC lma_normal_products: %zu doubles, bit-exact -> %s\n",
got.size(),bad?"FAIL":"PASS");
got.size(),bad?"FAIL":"PASS");
if(!bad && profile_calls > 0){
for(int i=0;i<20;i++) if(tp_proc_exec_lma_products(
proc,weights.data(),jt.data(),ymfx.data(),np,nv,got.data())){
std::fprintf(stderr,"profile warmup: %s\n",tp_last_error()); bad=1; break;
}
const auto profile = [&](){
const auto t0=std::chrono::steady_clock::now();
for(int i=0;i<profile_calls;i++) if(tp_proc_exec_lma_products(
proc,weights.data(),jt.data(),ymfx.data(),np,nv,got.data())) return -1.0;
const auto t1=std::chrono::steady_clock::now();
return std::chrono::duration<double,std::milli>(t1-t0).count()/profile_calls;
};
if(!bad){
const double a=profile(), b=profile();
if((a < 0)||(b < 0)){ std::fprintf(stderr,"profile: %s\n",tp_last_error()); bad=1; }
else std::printf("LMA products profile (%d calls, 3x303 -> 12 doubles): rounds=[%.6f, %.6f] ms, avg=%.6f ms/call\n",
profile_calls,a,b,0.5*(a+b));
}
}
tp_proc_destroy(proc); tp_destroy_module(module);
tp_proc_destroy(proc); tp_destroy_module(module);
return bad?EXIT_FAILURE:EXIT_SUCCESS;
return bad?EXIT_FAILURE:EXIT_SUCCESS;
}
}
jna/test_pose_corr_jna.cu
View file @
b2ba5af2
This diff is collapsed.
Click to expand it.
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