cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
cuMemcpyHtoD(gpu_texture_indices_ovlp,Pointer.to(cpu_texture_indices_ovlp),cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
Pointerkp_gen_texture_list=Pointer.to(
Pointer.to(newint[]{num_cams}),// int num_cams,
Pointer.to(gpu_ftasks),// float * gpu_ftasks, // flattened tasks, 29 floats for quad EO, 101 floats for LWIR16
Pointer.to(newint[]{num_task_tiles}),// int num_tiles, // number of tiles in task list
Pointer.to(newint[]{width}),// int width, // number of tiles in a row
Pointer.to(newint[]{height}),// int height, // number of tiles rows
Pointer.to(gpu_texture_indices_ovlp),// int * gpu_texture_indices, // packed tile + bits (now only (1 << 7)
Pointer.to(gpu_num_texture_tiles),// int * gpu_num_texture_tiles, // number of texture tiles to process
Pointer.to(gpu_woi));// int * woi, // min_x, min_y, max_x, max_y
// int [] cpu_texture_indices_ovlp = new int [tilesX * tilesYa];
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
0,null,// Shared memory size and stream (shared - only dynamic, static is in code)
kp_clear_texture_rbga,null);// Kernel- and extra parameters
cuCtxSynchronize();
booleanDEBUG8A=true;
// Testing parameters
// int [] cpu_texture_indices_ovlp = new int [tilesX * tilesYa];
cuMemcpyDtoH(Pointer.to(cpu_texture_indices_ovlp),gpu_texture_indices_ovlp,cpu_texture_indices_ovlp.length*Sizeof.INT);// hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
// cuMemcpyHtoD(gpu_texture_indices_ovlp, Pointer.to(cpu_texture_indices_ovlp), cpu_texture_indices_ovlp.length * Sizeof.INT); // hope that Float.floatToIntBits(fcorr_indices[i]) is not needed
// Run 8 times - first 4 1-tile offsets inner tiles (w/o verifying margins), then - 4 times with verification and ignoring 4-pixel
// oversize (border 16x 16 tiles overhang by 4 pixels)
Pointer.to(newfloat[]{(float)min_agree}),// float min_agree, // minimal number of channels to agree on a point (real number to work with fuzzy averages)
Pointer.to(gpu_color_weights),// float weights[3], // scale for R,B,G (or {1.0,0.0,0.0}
Pointer.to(newint[]{idust_remove}),// int dust_remove, // Do not reduce average weight when only one image differes much from the average
Pointer.to(newint[]{0}),// int keep_weights, // return channel weights after A in RGBA
// combining both non-overlap and overlap (each calculated if pointer is not null )
Pointer.to(newint[]{texture_stride_rgba}),// const size_t texture_rbga_stride, // in floats