## 3 GPU-Accelerated Implementation for Multiresolution Grid Algorithm in SBR  
For the procedure of the GPU-accelerated multiresolution grid algorithm in the SBR, it is worth stating that we only need to track the newly generated corner rays of the first or second generation child ray tubes, rather than tracking all of their corner rays. Lastly, by superposing the integral result of each time, we obtain the TS value of the target in a particular incident direction.  
In order to take full advantage of the multi-core on GPU, we save the center ray of divergent ray tubes in the contiguous address space of global memory. Firstly, we use a group of 512 ray tubes and record the divergent information in the shared memory. In addition, by using the atomicAdd by CUDA, we calculate the number of divergent ray tubes per group. Due to the number of groups, there may be several times the maximum number of threads per block. Then, we use multi-blocks to scan the data [19]. Figure 4 shows the application of the multi-blocks Scan algorithm. By this way, we calculate the beginning address offset of each group of the ray tubes called _d_OffsetOfGroupDivRayTube_.  
Secondly, each divergent ray tube in a group should have its own index address value, and we use a compact algorithm [18] to calculate it, as shown in Table 1. The result is recorded in _d_IndexOfDivRayTube_, which is in the global memory. According to the beginning offset address value of each group of ray tubes and the index address value of each divergent ray tubes in a group, the center ray of the divergent ray tubes can densely locate its own position in a sequence. Then, each thread executes the center ray's tracing process in a parallel one-to-one correspondence. Overall, divergent ray tubes increases the ray-tracing performance by 50% on the GPU.  
The initial virtual plane is two dimensional. Then, a grid is organized into two-dimensional thread blocks, and each thread of the block traces a corner ray to obtain its intersection information of the triangular patches. After subdividing, the child ray tubes are organized into one-dimension. A thread block is one-dimensional, including a one-dimensional thread index. Since the divergent ray tubes are sparse on the origin virtual plane, we use two kinds of address value information which are described in the above table to densely save whole child ray tubes to another address space named _d_ChildRayTube_ in the global memory. In addition, the number of all child ray tubes can be certain.  
Figure 3: The space vector illustration during target intensity calculation.  
```
Begin Input: the dissected simulation target stackless KD-tree construction; __global_ void create_virtualface_gpu(...);//Generate virtual aperture surface, output ray tube and ray information; while(i < totalrasynum) then//Search all rays in global memory; __global_ void raytracekernel_gpu(...);//ray tracing if(valid ray tubes) then Scattered sound field integral calculation else if(unvalid ray tubes) then discard the ray; else then if(number of splits > threshold) then discard the ray; else then Sound tube bundle split; Store split sound ray bundles in global memory \(d\_ChildRayTube\) __global_ void reduce_add_sre(float*d_sum_re, float* integralConstRe, int raysBeamNum)//Summation of scattered sound fields using CUDA parallel reduction algorithm Calculate target strength TS end
```  
**Algorithm 1** The GPU-accelerated target strength prediction based on multiresolution SBR.  
Figure 5: The GPU-accelerated target strength prediction based on multiresolution SBR.