Commit 31772785 authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: GpuQuadJna updateTasks + getWH + native tp_proc_get_tasks (pre-empt task-readback NPE)

updateTasks is called all over ImageDtt right after execSetTilesOffsets (reads gpu_ftasks back to
rebuild TpTask[] with computed centerXY/disp_dist) -> tp_proc_get_tasks (DtoH). getWH returns full
frame (base returns null gpu_clt_wh). Proactive (locating same-cause base-method derefs of null
JCuda fields).
Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
parent df0ac36a
...@@ -196,6 +196,18 @@ public class GpuQuadJna extends GpuQuad { ...@@ -196,6 +196,18 @@ public class GpuQuadJna extends GpuQuad {
lib.tp_proc_set_tasks(proc, ftasks, num_task_tiles, task_size * num_task_tiles); lib.tp_proc_set_tasks(proc, ftasks, num_task_tiles, task_size * num_task_tiles);
} }
// Read tasks back after calculate_tiles_offsets (computed centerXY/disp_dist) -> rebuild TpTask[].
@Override public void updateTasks(TpTask[] tile_tasks, boolean use_aux) {
num_task_tiles = tile_tasks.length;
int task_size = getTaskSize();
float[] ftasks = new float[task_size * num_task_tiles];
lib.tp_proc_get_tasks(proc, ftasks, task_size * num_task_tiles);
for (int i = 0; i < num_task_tiles; i++)
tile_tasks[i] = new TpTask(getNumSensors(), ftasks, i, use_aux);
}
// Full-frame dims (base returns the null gpu_clt_wh).
@Override public int[] getWH(boolean use_ref) { return new int[]{img_width, img_height}; }
// ---- geometry execution (calc_reverse_distortions + rot_derivs + calculate_tiles_offsets) ---- // ---- geometry execution (calc_reverse_distortions + rot_derivs + calculate_tiles_offsets) ----
@Override public void execSetTilesOffsets(boolean uniform_grid) { @Override public void execSetTilesOffsets(boolean uniform_grid) {
setGeometryCorrection(); // gc setGeometryCorrection(); // gc
......
...@@ -74,6 +74,7 @@ public interface TpJna extends Library { ...@@ -74,6 +74,7 @@ public interface TpJna extends Library {
/** use_center_image: broadcast one center image to all sensors (FPN back-prop mode). */ /** use_center_image: broadcast one center image to all sensors (FPN back-prop mode). */
int tp_proc_set_center_image(Pointer proc, float[] d); int tp_proc_set_center_image(Pointer proc, float[] d);
int tp_proc_set_tasks(Pointer proc, float[] ftasks, int ntiles, int totalFloats); int tp_proc_set_tasks(Pointer proc, float[] ftasks, int ntiles, int totalFloats);
int tp_proc_get_tasks(Pointer proc, float[] out, int totalFloats);
int tp_proc_exec_geometry(Pointer proc, int uniformGrid); int tp_proc_exec_geometry(Pointer proc, int uniformGrid);
/** convert_direct: ref_scene (0/1 -> clt vs clt_ref), erase_clt (-1/0/1), no_kernels (0/1). */ /** convert_direct: ref_scene (0/1 -> clt vs clt_ref), erase_clt (-1/0/1), no_kernels (0/1). */
int tp_proc_exec_convert_direct(Pointer proc, int refScene, int eraseClt, int noKernels); int tp_proc_exec_convert_direct(Pointer proc, int refScene, int eraseClt, int noKernels);
......
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