common.in 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. kernel void backproject_burst_{0} (
  2. {1}
  3. global float *volume,
  4. const sampler_t sampler,
  5. const int3 real_size,
  6. const float2 x_center,
  7. const float y_center,
  8. const float2 x_region,
  9. const float2 y_region,
  10. const float2 z_region,
  11. const float2 lamino_region,
  12. float sin_lamino,
  13. float cos_lamino,
  14. const float{2} sines,
  15. const float{2} cosines,
  16. const float norm_factor,
  17. const float sin_roll,
  18. const float cos_roll,
  19. const int cumulate)
  20. {{
  21. int idx = get_global_id (0);
  22. int idy = get_global_id (1);
  23. int idz = get_global_id (2);
  24. float result, tmp, tmp_x, tmp_y;
  25. float2 pixel;
  26. float3 voxel;
  27. if (idx < real_size.x && idy < real_size.y && idz < real_size.z) {{
  28. {3}
  29. if (cumulate) {{
  30. volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] += result * norm_factor;
  31. }} else {{
  32. volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] = result * norm_factor;
  33. }}
  34. }}
  35. }}