Commit c216c7e4 authored by Andrey Filippov's avatar Andrey Filippov

Implemented CLT accumulation for virtual orientation

parent 952177ec
......@@ -1114,6 +1114,17 @@ public class GpuQuad{ // quad camera description
copyD2H.Height = img_height; // /4;
cuMemcpy2D(copyD2H); // run copy
}
public int [] getWH(boolean use_ref) {
return use_ref ? gpu_clt_ref_wh : gpu_clt_wh;
}
public int getNumColors() {
return num_colors;
}
public int getNumSensors() {
return num_cams;
}
public int getCltSize(boolean use_ref) { // per camera, in floats
int [] wh = use_ref ? gpu_clt_ref_wh : gpu_clt_wh;
......@@ -1121,7 +1132,16 @@ public class GpuQuad{ // quad camera description
int tilesY = wh[1] / GPUTileProcessor.DTT_SIZE;
return tilesY*tilesX*num_colors* 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
}
/*
public int getCltLength(boolean use_ref) {
int [] wh = use_ref ? gpu_clt_ref_wh : gpu_clt_wh;
int tilesX = wh[0] / GPUTileProcessor.DTT_SIZE;
int tilesY = wh[1] / GPUTileProcessor.DTT_SIZE;
int tile_size_td = getCltSize(use_ref); // 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
int num_tiles = tilesY*tilesX*num_colors;
return num_tiles* tile_size_td;
}
*/
public float [][] getCltData( // only for color=0
boolean use_ref){
CUdeviceptr [] gpu_sel_clt_h = use_ref ? gpu_clt_ref_h : gpu_clt_h;
......@@ -1208,24 +1228,36 @@ public class GpuQuad{ // quad camera description
}
return;
}
/*
public void setBayerImage(
float [] bayer_image,
int ncam) {
public void setCltData( // for testing only
int ncam,
float [] fclt, //
boolean use_ref){
int clt_size = getCltSize(use_ref);
if (fclt.length != clt_size) {
System.out.println("getCltData(): wrong array size: got ["+fclt.length+"], "+
"should be ["+clt_size+"]");
return;
}
CUdeviceptr [] gpu_sel_clt_h = use_ref ? gpu_clt_ref_h : gpu_clt_h;
int [] wh = use_ref ? gpu_clt_ref_wh : gpu_clt_wh;
int tilesX = wh[0] / GPUTileProcessor.DTT_SIZE;
int tilesY = wh[1] / GPUTileProcessor.DTT_SIZE;
int tile_size_td = 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
int num_tiles = tilesY*tilesX*num_colors;
CUDA_MEMCPY2D copyH2D = new CUDA_MEMCPY2D();
copyH2D.srcMemoryType = CUmemorytype.CU_MEMORYTYPE_HOST;
copyH2D.srcHost = Pointer.to(bayer_image);
copyH2D.srcPitch = img_width*Sizeof.FLOAT; // width_in_bytes;
copyH2D.srcHost = Pointer.to(fclt);
copyH2D.srcPitch = tile_size_td * Sizeof.FLOAT;
copyH2D.dstMemoryType = CUmemorytype.CU_MEMORYTYPE_DEVICE;
copyH2D.dstDevice = gpu_bayer_h[ncam]; // src_dpointer;
copyH2D.dstPitch = mclt_stride *Sizeof.FLOAT; // device_stride[0];
copyH2D.WidthInBytes = img_width*Sizeof.FLOAT; // width_in_bytes;
copyH2D.Height = img_height; // /4;
cuMemcpy2D(copyH2D);
copyH2D.dstDevice = gpu_sel_clt_h[ncam];
copyH2D.dstPitch = tile_size_td * Sizeof.FLOAT;
copyH2D.WidthInBytes = tile_size_td * Sizeof.FLOAT;
copyH2D.Height = num_tiles;
cuMemcpy2D(copyH2D); // run copy
return;
}
*/
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment