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
13ca3625
Commit
13ca3625
authored
Apr 10, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented testTextures, testTexturesRGBA
parent
3610b7a6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
886 additions
and
155 deletions
+886
-155
TpHostGpu.cu
src/TpHostGpu.cu
+846
-146
TpHostGpu.h
src/TpHostGpu.h
+28
-2
TpParams.h
src/TpParams.h
+3
-0
test_tp.cu
src/test_tp.cu
+9
-7
No files found.
src/TpHostGpu.cu
View file @
13ca3625
This diff is collapsed.
Click to expand it.
src/TpHostGpu.h
View file @
13ca3625
...
...
@@ -130,11 +130,14 @@ public:
void
testImcltRbgAll
(
int
num_runs
);
// 701
void
testCorrelate2DIntra
(
int
num_runs
);
// 762 - 885
void
testCorrelate2DInterSelf
(
int
num_runs
);
// 1136 - 1411
void
testCorrelate2DIntraTD
(
int
num_runs
,
int
quad_combine
);
// 886 - 1123
void
testCorrelate2DInterSelf
(
int
num_runs
);
// 1136 - 1411
void
testTextures
(
int
num_runs
,
int
use_dp
,
int
debug
);
// 1422-1664
void
testTexturesRGBA
(
int
num_runs
,
int
use_dp
,
int
debug
);
// 1669-1810
private
:
void
saveClt
(
const
char
**
paths
,
const
char
*
prompt
,
float
**
gpu_clt_h
);
void
saveRgb
(
const
char
**
paths
,
const
char
*
prompt
,
float
**
gpu_corr_images_h
);
...
...
@@ -144,9 +147,32 @@ public:
void
saveInterCorrFile
(
const
char
*
path
,
const
char
*
prompt
,
int
num_corrs
,
int
num_corr_indices
,
float
*
gpu_corrs_td
,
int
*
gpu_corr_indices
,
int
num_sel_sensors
);
void
saveInterCorrIndicesFile
(
const
char
*
path
,
const
char
*
prompt
,
int
num_corr_indices
,
int
*
gpu_corr_indices
,
int
num_sel_sensors
);
private
:
float
*
getCorrImg
(
int
corr_img_size
,
int
num_corr_indices
,
int
*
cpu_corr_indices
,
float
*
cpu_corr
,
int
num_sel_sensors
);
float
*
getCorrTdImg
(
int
corr_img_size
,
int
num_corr_indices
,
int
*
cpu_corr_indices
,
float
*
cpu_corr_td
,
int
num_sel_sensors
);
void
generate_RBGA_host
(
int
num_cams
,
// number of cameras used
// Parameters to generate texture tasks
float
*
gpu_ftasks
,
// flattened tasks, 27 floats for quad EO, 99 floats for LWIR16p// struct tp_task * gpu_tasks,
int
num_tiles
,
// number of tiles in task list
// declare arrays in device code?
int
*
gpu_texture_indices
,
// packed tile + bits (now only (1 << 7)
int
*
gpu_num_texture_tiles
,
// number of texture tiles to process (8 separate elements for accumulation)
int
*
gpu_woi
,
// x,y,width,height of the woi
int
width
,
// <= TILES-X, use for faster processing of LWIR images (should be actual + 1)
int
height
,
// <= TILES-Y, use for faster processing of LWIR images
// Parameters for the texture generation
float
**
gpu_clt
,
// [num_cams] ->[TILES-Y][TILES-X][colors][DTT_SIZE*DTT_SIZE]
// TODO: use geometry_correction rXY !
struct
gc
*
gpu_geometry_correction
,
int
colors
,
// number of colors (3/1)
int
is_lwir
,
// do not perform shot correction
const
float
cpu_params
[
5
],
// mitigating CUDA_ERROR_INVALID_PTX
const
float
weights
[
3
],
// scale for R,B,G should be host_array, not gpu
int
dust_remove
,
// Do not reduce average weight when only one image differs much from the average
int
keep_weights
,
// return channel weights after A in RGBA (was removed) (should be 0 if gpu_texture_rbg)?
const
int
texture_rbga_stride
,
// in floats
float
*
gpu_texture_tiles
);
// (number of colors +1 + ?)*16*16 rgba texture tiles
void
hfree
(
float
*
p
);
// {if (p) free (p);}
void
hfree
(
struct
CltExtra
*
p
);
void
gfree
(
float
*
p
);
...
...
src/TpParams.h
View file @
13ca3625
...
...
@@ -51,6 +51,9 @@ public:
static
constexpr
int
tp_task_xy_offset
=
TP_TASK_XY_OFFSET
;
// 6
static
constexpr
float
fat_zero
=
1000
.
0
f
;
// 300.0f; // 30.0;
static
constexpr
int
convert_direct_indexing_threads
=
CONVERT_DIRECT_INDEXING_THREADS
;
//
static
constexpr
int
convert_direct_indexing_threads_log2
=
CONVERT_DIRECT_INDEXING_THREADS_LOG2
;
//
#ifdef DBG_TILE
static
constexpr
int
debug_tile
{
1
};
static
constexpr
int
dbg_tile
{
DBG_TILE
};
...
...
src/test_tp.cu
View file @
13ca3625
...
...
@@ -33,7 +33,7 @@
// all of the next 5 were disabled
//#define NOCORR
//#define NOCORR_TD
#define NOTEXTURES //
//
#define NOTEXTURES //
#define NOTEXTURE_RGBA //
//#define NOTEXTURE_RGBAXXX //
...
...
@@ -1421,8 +1421,8 @@ int main(int argc, char **argv)
// -----------------
#ifndef NOTEXTURES
dim3 threads0(CONVERT_DIRECT_INDEXING_THREADS, 1, 1);
dim3 blocks0 ((tp_task_size + CONVERT_DIRECT_INDEXING_THREADS -1) >> CONVERT_DIRECT_INDEXING_THREADS_LOG2,1, 1);
dim3 threads0(CONVERT_DIRECT_INDEXING_THREADS, 1, 1);
dim3 blocks0 ((tp_task_size + CONVERT_DIRECT_INDEXING_THREADS -1) >> CONVERT_DIRECT_INDEXING_THREADS_LOG2,1, 1);
int linescan_order = 1; // output low-res in linescan order, 0 - in gpu_texture_indices order
printf("threads0=(%d, %d, %d)\n",threads0.x,threads0.y,threads0.z);
printf("blocks0=(%d, %d, %d)\n",blocks0.x,blocks0.y,blocks0.z);
...
...
@@ -1446,7 +1446,7 @@ int main(int argc, char **argv)
tpParams.num_cams, // int num_cams, // actual number of cameras
tpParams.texture_colors, // int num_colors, // actual number of colors: 3 for RGB, 1 for LWIR/mono
0); // int * offsets); // in floats
printf("\n1. shared_size=%d, num_cams=%d, colors=%d\n",shared_size, tpParams.num_cams, texture_colors);
printf("\n1. shared_size=%d, num_cams=%d, colors=%d\n",shared_size, tpParams.num_cams, t
pParams.t
exture_colors);
//*pnum_texture_tiles = 0;
cpu_pnum_texture_tiles = 0;
checkCudaErrors(cudaMemcpy(
...
...
@@ -1653,9 +1653,9 @@ int main(int argc, char **argv)
printf(" ");
}
}
#endif // DEBUG
9
#endif // DEBUG
10
#endif //#ifdef DBG_TILE
#endif
#endif
// #ifndef NSAVE_TEXTURES
free(cpu_textures);
free (cpu_diff_rgb_combo);
free (cpu_diff_rgb_combo_out);
...
...
@@ -1664,6 +1664,8 @@ int main(int argc, char **argv)
#endif //NOTEXTURES
#ifndef NOTEXTURE_RGBAXXX
dim3 threads_rgba(1, 1, 1);
dim3 grid_rgba(1,1,1);
...
...
@@ -1805,7 +1807,7 @@ int main(int argc, char **argv)
#endif // DEBUG11
#endif //#ifdef DBG_TILE
free(cpu_textures_rgba);
#endif // ifndef NOTEXTURE
S
#endif // ifndef NOTEXTURE
_RGBAXXX
...
...
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