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
46256d14
Commit
46256d14
authored
Apr 01, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GenerateRgbaHost - from class instance
parent
1bf5e8bf
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
356 additions
and
18 deletions
+356
-18
GenerateRgbaHost.cu
src/GenerateRgbaHost.cu
+294
-0
GenerateRgbaHost.h
src/GenerateRgbaHost.h
+32
-0
test_tp.cu
src/test_tp.cu
+11
-18
tp_defines.h
src/tp_defines.h
+19
-0
No files found.
src/GenerateRgbaHost.cu
0 → 100644
View file @
46256d14
This diff is collapsed.
Click to expand it.
src/GenerateRgbaHost.h
0 → 100644
View file @
46256d14
#ifndef GENERATE_RGBA_HOST_H_
#define GENERATE_RGBA_HOST_H_
class
GenerateRgbaHost
{
public
:
GenerateRgbaHost
();
~
GenerateRgbaHost
();
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
};
#endif
src/test_tp.cu
View file @
46256d14
...
@@ -65,7 +65,8 @@
...
@@ -65,7 +65,8 @@
#include "tp_files.h"
#include "tp_files.h"
//#include "tp_paths.cuh"
//#include "tp_paths.cuh"
#include "tp_paths.h"
#include "tp_paths.h"
#include "GenerateRgbaHost.h"
/*
#if TEST_LWIR
#if TEST_LWIR
#define IMG_WIDTH 640
#define IMG_WIDTH 640
#define IMG_HEIGHT 512
#define IMG_HEIGHT 512
...
@@ -83,9 +84,9 @@
...
@@ -83,9 +84,9 @@
#define TILESX (IMG_WIDTH / DTT_SIZE)
#define TILESX (IMG_WIDTH / DTT_SIZE)
#define TILESY (IMG_HEIGHT / DTT_SIZE)
#define TILESY (IMG_HEIGHT / DTT_SIZE)
#define TILESYA ((TILESY +3) & (~3))
#define TILESYA ((TILESY +3) & (~3))
*/
#include "generate_RGBA_host.inc"
//
#include "generate_RGBA_host.inc"
#if 0
void generate_RBGA_host(
void generate_RBGA_host(
int num_cams, // number of cameras used
int num_cams, // number of cameras used
// Parameters to generate texture tasks
// Parameters to generate texture tasks
...
@@ -359,7 +360,7 @@ void generate_RBGA_host(
...
@@ -359,7 +360,7 @@ void generate_RBGA_host(
// checkCudaErrors(cudaFree(gpu_num_texture_tiles));
// checkCudaErrors(cudaFree(gpu_num_texture_tiles));
// __syncthreads();
// __syncthreads();
}
}
#endif // 0
/**
/**
...
@@ -392,6 +393,7 @@ int main(int argc, char **argv)
...
@@ -392,6 +393,7 @@ int main(int argc, char **argv)
#endif
#endif
TpPaths tpPaths(use_lwir);
TpPaths tpPaths(use_lwir);
GenerateRgbaHost generateRgbaHost{}; // = new GenerateRgbaHost();
#if TEST_LWIR
#if TEST_LWIR
...
@@ -474,22 +476,13 @@ int main(int argc, char **argv)
...
@@ -474,22 +476,13 @@ int main(int argc, char **argv)
int KERN_TILES = KERNELS_HOR * KERNELS_VERT * num_colors; // NUM_COLORS;
int KERN_TILES = KERNELS_HOR * KERNELS_VERT * num_colors; // NUM_COLORS;
int KERN_SIZE = KERN_TILES * 4 * 64;
int KERN_SIZE = KERN_TILES * 4 * 64;
int CORR_SIZE = (2 * CORR_OUT_RAD + 1) * (2 * CORR_OUT_RAD + 1);
int CORR_SIZE = (2 * CORR_OUT_RAD + 1) * (2 * CORR_OUT_RAD + 1);
float * host_kern_buf = (float *)malloc(KERN_SIZE * sizeof(float));
float * host_kern_buf = (float *)malloc(KERN_SIZE * sizeof(float));
// static - see https://stackoverflow.com/questions/20253267/segmentation-fault-before-main
/// static struct tp_task task_data [TILESX*TILESY]; // maximal length - each tile
/// static struct tp_task task_data1 [TILESX*TILESY]; // maximal length - each tile
float * ftask_data = (float *) malloc(TILESX * TILESY * task_size * sizeof(float));
float * ftask_data = (float *) malloc(TILESX * TILESY * task_size * sizeof(float));
float * ftask_data1 = (float *) malloc(TILESX * TILESY * task_size * sizeof(float));
float * ftask_data1 = (float *) malloc(TILESX * TILESY * task_size * sizeof(float));
trot_deriv rot_deriv;
trot_deriv rot_deriv;
/// int corr_indices [NUM_PAIRS*TILESX*TILESY];
int texture_indices [TILESX*TILESYA];
int texture_indices [TILESX*TILESYA];
int cpu_woi [4];
int cpu_woi [4];
...
@@ -521,7 +514,6 @@ int main(int argc, char **argv)
...
@@ -521,7 +514,6 @@ int main(int argc, char **argv)
float * gpu_generate_RBGA_params;
float * gpu_generate_RBGA_params;
int num_corrs;
int num_corrs;
int num_textures;
int num_textures;
/// int num_ports = NUM_CAMS;
// GPU pointers to GPU pointers to memory
// GPU pointers to GPU pointers to memory
float ** gpu_kernels; // [NUM_CAMS];
float ** gpu_kernels; // [NUM_CAMS];
struct CltExtra ** gpu_kernel_offsets; // [NUM_CAMS];
struct CltExtra ** gpu_kernel_offsets; // [NUM_CAMS];
...
@@ -532,7 +524,6 @@ int main(int argc, char **argv)
...
@@ -532,7 +524,6 @@ int main(int argc, char **argv)
// GPU pointers to GPU memory
// GPU pointers to GPU memory
/// struct tp_task * gpu_tasks; // TODO: ***** remove ! **** DONE
float * gpu_ftasks; // TODO: ***** allocate ! **** DONE
float * gpu_ftasks; // TODO: ***** allocate ! **** DONE
int * gpu_active_tiles;
int * gpu_active_tiles;
int * gpu_num_active;
int * gpu_num_active;
...
@@ -554,6 +545,7 @@ int main(int argc, char **argv)
...
@@ -554,6 +545,7 @@ int main(int argc, char **argv)
size_t dstride_textures_rbga; // in bytes ! for one rgba/ya 16x16 tile
size_t dstride_textures_rbga; // in bytes ! for one rgba/ya 16x16 tile
struct gc fgeometry_correction;
struct gc fgeometry_correction;
float* correction_vector;
float* correction_vector;
int correction_vector_length;
int correction_vector_length;
float * rByRDist;
float * rByRDist;
...
@@ -2044,7 +2036,7 @@ int main(int argc, char **argv)
...
@@ -2044,7 +2036,7 @@ int main(int argc, char **argv)
}
}
// FIXME: update to use new correlations and num_cams
// FIXME: update to use new correlations and num_cams
#ifdef NO_DP
#ifdef NO_DP
generate_RBGA_host (
generate
RgbaHost.generate
_RBGA_host (
num_cams, // int num_cams, // number of cameras used
num_cams, // int num_cams, // number of cameras used
// Parameters to generate texture tasks
// Parameters to generate texture tasks
gpu_ftasks, // float * gpu_ftasks, // flattened tasks, 27 floats for quad EO, 99 floats for LWIR16
gpu_ftasks, // float * gpu_ftasks, // flattened tasks, 27 floats for quad EO, 99 floats for LWIR16
...
@@ -2222,6 +2214,7 @@ int main(int argc, char **argv)
...
@@ -2222,6 +2214,7 @@ int main(int argc, char **argv)
free (correction_vector);
free (correction_vector);
free (ftask_data);
free (ftask_data);
free (ftask_data1);
free (ftask_data1);
// delete generateRgbaHost;
exit(0);
exit(0);
}
}
src/tp_defines.h
View file @
46256d14
...
@@ -155,6 +155,25 @@
...
@@ -155,6 +155,25 @@
#endif //#ifdef DEBUG_ANY
#endif //#ifdef DEBUG_ANY
#if TEST_LWIR
#define IMG_WIDTH 640
#define IMG_HEIGHT 512
#define KERNELS_HOR 82 // 80+2
#define KERNELS_VERT 66 // 64+2
#else
#define IMG_WIDTH 2592
#define IMG_HEIGHT 1936
#define KERNELS_HOR 164 // 2592 / 16 + 2
#define KERNELS_VERT 123 // 1936 / 16 + 2
#endif
#define CORR_OUT_RAD 7 // full tile (15x15), was 4 (9x9)
#define DBG_DISPARITY 0.0 // 56.0// 0.0 // 56.0 // disparity for which to calculate offsets (not needed in Java)
// only used in C++ test
#define TILESX (IMG_WIDTH / DTT_SIZE)
#define TILESY (IMG_HEIGHT / DTT_SIZE)
#define TILESYA ((TILESY +3) & (~3))
#endif //#ifndef JCUDA
#endif //#ifndef JCUDA
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