5
for i in `seq 0 $lines`; do
6
for j in `seq 0 $lines`; do
7
echo "$text" | sed -e "s/res\[i\]\[j\]/res_${i}_${j}/g" -e "s/\([^a-zA-Z]\)i\([^a-zA-Z]\)/\1$i\2/g" -e "s/\([^a-zA-Z]\)j\([^a-zA-Z]\)/\1$j\2/g"
17
unroll $size 'float res[i][j] = 0;'
18
#unroll $size 'res[i][j] += subh_cache(subh + (i * BLOCK_SIZE) * all.y + (j * BLOCK_SIZE) * all.x);'
19
#unroll $size 'slice[(idy + BLOCK_SIZE * i) * slice_width + idx + BLOCK_SIZE * j] = res[i][j];'
20
#unroll $size 'res[i][j] += read_imagef(sinogram, volumeSampler, (float2)(subh + i * BLOCK_SIZE * all.y + j * BLOCK_SIZE * all.x, proj + .5f)).x;'
21
unroll $size 'slice[(idy + get_local_size(1) * i) * slice_width + idx + get_local_size(0) * j] = res[i][j];'
22
unroll $size 'res[i][j] += subh_cache(h + (i * get_local_size(0)) * all.y + (j * get_local_size(0)) * all.x);'
23
unroll $size 'subh = h + (i * get_local_size(0)) * all.y + (j * get_local_size(0)) * all.x; isubh = floor(subh); v = subh_cache(isubh); res[i][j] += v.x + (subh - isubh) * v.y;'