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
bd04c118
Commit
bd04c118
authored
Apr 14, 2020
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing WOI to variables
parent
36abc57d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
336 deletions
+82
-336
TileProcessor.cuh
src/TileProcessor.cuh
+49
-302
TileProcessor.h
src/TileProcessor.h
+8
-1
geometry_correction.h
src/geometry_correction.h
+3
-3
test_tp.cu
src/test_tp.cu
+22
-30
No files found.
src/TileProcessor.cuh
View file @
bd04c118
This diff is collapsed.
Click to expand it.
src/TileProcessor.h
View file @
bd04c118
...
@@ -51,7 +51,12 @@ __global__ void convert_correct_tiles(
...
@@ -51,7 +51,12 @@ __global__ void convert_correct_tiles(
float
**
gpu_clt
,
// [NUM_CAMS][TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
float
**
gpu_clt
,
// [NUM_CAMS][TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
size_t
dstride
,
// in floats (pixels)
size_t
dstride
,
// in floats (pixels)
int
num_tiles
,
// number of tiles in task
int
num_tiles
,
// number of tiles in task
int
lpf_mask
);
// apply lpf to colors : bit 0 - red, bit 1 - blue, bit2 - green. Now - always 0 !
int
lpf_mask
,
// apply lpf to colors : bit 0 - red, bit 1 - blue, bit2 - green. Now - always 0 !
int
woi_width
,
int
woi_height
,
int
kernels_hor
,
int
kernels_vert
);
extern
"C"
__global__
void
clear_texture_list
(
extern
"C"
__global__
void
clear_texture_list
(
int
*
gpu_texture_indices
,
// packed tile + bits (now only (1 << 7)
int
*
gpu_texture_indices
,
// packed tile + bits (now only (1 << 7)
...
@@ -112,6 +117,8 @@ extern "C" __global__ void imclt_rbg(
...
@@ -112,6 +117,8 @@ extern "C" __global__ void imclt_rbg(
int
color
,
// defines location of clt data
int
color
,
// defines location of clt data
int
v_offset
,
int
v_offset
,
int
h_offset
,
int
h_offset
,
int
woi_twidth
,
int
woi_theight
,
const
size_t
dstride
);
// in floats (pixels)
const
size_t
dstride
);
// in floats (pixels)
extern
"C"
extern
"C"
...
...
src/geometry_correction.h
View file @
bd04c118
...
@@ -114,9 +114,9 @@ struct gc {
...
@@ -114,9 +114,9 @@ struct gc {
float
distortionA7
;
//r^7 (normalized to focal length or to sensor half width?)
float
distortionA7
;
//r^7 (normalized to focal length or to sensor half width?)
float
distortionA8
;
//r^8 (normalized to focal length or to sensor half width?)
float
distortionA8
;
//r^8 (normalized to focal length or to sensor half width?)
#ifndef NVRTC_BUG
#ifndef NVRTC_BUG
//
};
};
//
float rad_coeff [7];
float
rad_coeff
[
7
];
//
};
};
#endif
#endif
// parameters, common for all sensors
// parameters, common for all sensors
float
elevation
;
// degrees, up - positive;
float
elevation
;
// degrees, up - positive;
...
...
src/test_tp.cu
View file @
bd04c118
...
@@ -333,9 +333,7 @@ int main(int argc, char **argv)
...
@@ -333,9 +333,7 @@ int main(int argc, char **argv)
float tile_coords_h [NUM_CAMS][TILESX * TILESY][2];
float tile_coords_h [NUM_CAMS][TILESX * TILESY][2];
float * gpu_clt_h [NUM_CAMS];
float * gpu_clt_h [NUM_CAMS];
float * gpu_lpf_h [NUM_COLORS]; // never used
float * gpu_lpf_h [NUM_COLORS]; // never used
#ifndef NOICLT
float * gpu_corr_images_h [NUM_CAMS];
float * gpu_corr_images_h [NUM_CAMS];
#endif
float * gpu_corrs;
float * gpu_corrs;
int * gpu_corr_indices;
int * gpu_corr_indices;
...
@@ -354,6 +352,7 @@ int main(int argc, char **argv)
...
@@ -354,6 +352,7 @@ int main(int argc, char **argv)
struct CltExtra ** gpu_kernel_offsets; // [NUM_CAMS];
struct CltExtra ** gpu_kernel_offsets; // [NUM_CAMS];
float ** gpu_images; // [NUM_CAMS];
float ** gpu_images; // [NUM_CAMS];
float ** gpu_clt; // [NUM_CAMS];
float ** gpu_clt; // [NUM_CAMS];
float ** gpu_corr_images; // [NUM_CAMS];
float ** gpu_lpf; // [NUM_CAMS]; // never referenced
float ** gpu_lpf; // [NUM_CAMS]; // never referenced
// GPU pointers to GPU memory
// GPU pointers to GPU memory
...
@@ -433,12 +432,10 @@ int main(int argc, char **argv)
...
@@ -433,12 +432,10 @@ int main(int argc, char **argv)
// Image is extended by 4 pixels each side to avoid checking (mclt tiles extend by 4)
// Image is extended by 4 pixels each side to avoid checking (mclt tiles extend by 4)
//host array of pointers to GPU arrays
//host array of pointers to GPU arrays
#ifndef NOICLT
gpu_corr_images_h[ncam] = alloc_image_gpu(
gpu_corr_images_h[ncam] = alloc_image_gpu(
&dstride_rslt, // size_t* dstride, // in bytes!!
&dstride_rslt, // size_t* dstride, // in bytes!!
IMG_WIDTH + DTT_SIZE, // int width,
IMG_WIDTH + DTT_SIZE, // int width,
3*(IMG_HEIGHT + DTT_SIZE)); // int height);
3*(IMG_HEIGHT + DTT_SIZE)); // int height);
#endif
}
}
// allocates one correlation kernel per line (15x15 floats), number of rows - number of tiles * number of pairs
// allocates one correlation kernel per line (15x15 floats), number of rows - number of tiles * number of pairs
gpu_corrs = alloc_image_gpu(
gpu_corrs = alloc_image_gpu(
...
@@ -579,7 +576,7 @@ int main(int argc, char **argv)
...
@@ -579,7 +576,7 @@ int main(int argc, char **argv)
gpu_kernel_offsets = (struct CltExtra **) copyalloc_pointers_gpu ((float **) gpu_kernel_offsets_h, NUM_CAMS);
gpu_kernel_offsets = (struct CltExtra **) copyalloc_pointers_gpu ((float **) gpu_kernel_offsets_h, NUM_CAMS);
gpu_images = copyalloc_pointers_gpu (gpu_images_h, NUM_CAMS);
gpu_images = copyalloc_pointers_gpu (gpu_images_h, NUM_CAMS);
gpu_clt = copyalloc_pointers_gpu (gpu_clt_h, NUM_CAMS);
gpu_clt = copyalloc_pointers_gpu (gpu_clt_h, NUM_CAMS);
//
gpu_corr_images = copyalloc_pointers_gpu (gpu_corr_images_h, NUM_CAMS);
gpu_corr_images = copyalloc_pointers_gpu (gpu_corr_images_h, NUM_CAMS);
#ifdef DBG_TILE
#ifdef DBG_TILE
...
@@ -772,9 +769,11 @@ int main(int argc, char **argv)
...
@@ -772,9 +769,11 @@ int main(int argc, char **argv)
gpu_clt, // float ** gpu_clt, // [NUM_CAMS][TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
gpu_clt, // float ** gpu_clt, // [NUM_CAMS][TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
dstride/sizeof(float), // size_t dstride, // for gpu_images
dstride/sizeof(float), // size_t dstride, // for gpu_images
tp_task_size, // int num_tiles) // number of tiles in task
tp_task_size, // int num_tiles) // number of tiles in task
0); // 7); // 0); // 7); // int lpf_mask) // apply lpf to colors : bit 0 - red, bit 1 - blue, bit2 - green
0, // int lpf_mask) // apply lpf to colors : bit 0 - red, bit 1 - blue, bit2 - green
IMG_WIDTH, // int woi_width,
IMG_HEIGHT, // int woi_height,
KERNELS_HOR, // int kernels_hor,
KERNELS_VERT); // int kernels_vert);
getLastCudaError("Kernel execution failed");
getLastCudaError("Kernel execution failed");
checkCudaErrors(cudaDeviceSynchronize());
checkCudaErrors(cudaDeviceSynchronize());
printf("%d\n",i);
printf("%d\n",i);
...
@@ -823,7 +822,6 @@ int main(int argc, char **argv)
...
@@ -823,7 +822,6 @@ int main(int argc, char **argv)
#endif
#endif
#ifndef NOICLT
// testing imclt
// testing imclt
dim3 threads_imclt(IMCLT_THREADS_PER_TILE, IMCLT_TILES_PER_BLOCK, 1);
dim3 threads_imclt(IMCLT_THREADS_PER_TILE, IMCLT_TILES_PER_BLOCK, 1);
printf("threads_imclt=(%d, %d, %d)\n",threads_imclt.x,threads_imclt.y,threads_imclt.z);
printf("threads_imclt=(%d, %d, %d)\n",threads_imclt.x,threads_imclt.y,threads_imclt.z);
...
@@ -841,13 +839,8 @@ int main(int argc, char **argv)
...
@@ -841,13 +839,8 @@ int main(int argc, char **argv)
for (int ncam = 0; ncam < NUM_CAMS; ncam++) {
for (int ncam = 0; ncam < NUM_CAMS; ncam++) {
for (int color = 0; color < NUM_COLORS; color++) {
for (int color = 0; color < NUM_COLORS; color++) {
#ifdef IMCLT14
for (int v_offs = 0; v_offs < 1; v_offs++){ // temporarily for debugging
for (int h_offs = 0; h_offs < 1; h_offs++){ // temporarily for debugging
#else
for (int v_offs = 0; v_offs < 2; v_offs++){
for (int v_offs = 0; v_offs < 2; v_offs++){
for (int h_offs = 0; h_offs < 2; h_offs++){
for (int h_offs = 0; h_offs < 2; h_offs++){
#endif
int tilesy_half = (TILESY + (v_offs ^ 1)) >> 1;
int tilesy_half = (TILESY + (v_offs ^ 1)) >> 1;
int tilesx_half = (TILESX + (h_offs ^ 1)) >> 1;
int tilesx_half = (TILESX + (h_offs ^ 1)) >> 1;
int tiles_in_pass = tilesy_half * tilesx_half;
int tiles_in_pass = tilesy_half * tilesx_half;
...
@@ -857,10 +850,12 @@ int main(int argc, char **argv)
...
@@ -857,10 +850,12 @@ int main(int argc, char **argv)
gpu_clt_h[ncam], // float * gpu_clt, // [TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
gpu_clt_h[ncam], // float * gpu_clt, // [TILESY][TILESX][NUM_COLORS][DTT_SIZE*DTT_SIZE]
gpu_corr_images_h[ncam], // float * gpu_rbg, // WIDTH, 3 * HEIGHT
gpu_corr_images_h[ncam], // float * gpu_rbg, // WIDTH, 3 * HEIGHT
1, // int apply_lpf,
1, // int apply_lpf,
0, // int mono
, // defines lpf filter
NUM_COLORS, // int colors
, // defines lpf filter
color, // int color, // defines location of clt data
color, // int color, // defines location of clt data
v_offs, // int v_offset,
v_offs, // int v_offset,
h_offs, // int h_offset,
h_offs, // int h_offset,
TILESX, // int woi_twidth,
TILESY, // int woi_theight,
dstride_rslt/sizeof(float)); //const size_t dstride); // in floats (pixels)
dstride_rslt/sizeof(float)); //const size_t dstride); // in floats (pixels)
}
}
}
}
...
@@ -901,7 +896,6 @@ int main(int argc, char **argv)
...
@@ -901,7 +896,6 @@ int main(int argc, char **argv)
}
}
free(cpu_corr_image);
free(cpu_corr_image);
#endif
#ifndef NOCORR
#ifndef NOCORR
...
@@ -1269,16 +1263,14 @@ int main(int argc, char **argv)
...
@@ -1269,16 +1263,14 @@ int main(int argc, char **argv)
checkCudaErrors(cudaFree(gpu_kernel_offsets_h[ncam]));
checkCudaErrors(cudaFree(gpu_kernel_offsets_h[ncam]));
checkCudaErrors(cudaFree(gpu_images_h[ncam]));
checkCudaErrors(cudaFree(gpu_images_h[ncam]));
checkCudaErrors(cudaFree(gpu_clt_h[ncam]));
checkCudaErrors(cudaFree(gpu_clt_h[ncam]));
#ifndef NOICLT
checkCudaErrors(cudaFree(gpu_corr_images_h[ncam]));
checkCudaErrors(cudaFree(gpu_corr_images_h[ncam]));
#endif
}
}
checkCudaErrors(cudaFree(gpu_tasks));
checkCudaErrors(cudaFree(gpu_tasks));
checkCudaErrors(cudaFree(gpu_kernels));
checkCudaErrors(cudaFree(gpu_kernels));
checkCudaErrors(cudaFree(gpu_kernel_offsets));
checkCudaErrors(cudaFree(gpu_kernel_offsets));
checkCudaErrors(cudaFree(gpu_images));
checkCudaErrors(cudaFree(gpu_images));
checkCudaErrors(cudaFree(gpu_clt));
checkCudaErrors(cudaFree(gpu_clt));
//
checkCudaErrors(cudaFree(gpu_corr_images));
checkCudaErrors(cudaFree(gpu_corr_images));
checkCudaErrors(cudaFree(gpu_corrs));
checkCudaErrors(cudaFree(gpu_corrs));
checkCudaErrors(cudaFree(gpu_corr_indices));
checkCudaErrors(cudaFree(gpu_corr_indices));
checkCudaErrors(cudaFree(gpu_texture_indices));
checkCudaErrors(cudaFree(gpu_texture_indices));
...
...
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