Browse Source

Don't read early again

Because it crashes, probably some synchronization issue in ufo-core, revert this
commit once it's fixed.
Tomas Farago 8 years ago
parent
commit
6e9469a764
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/kernels/templates/common.in

+ 5 - 2
src/kernels/templates/common.in

@@ -20,13 +20,16 @@ kernel void backproject_burst_{0} (
     int idy = get_global_id (1);
     int idz = get_global_id (2);
     float result, tmp, tmp_x, tmp_y;
-    float old = cumulate ? volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] : 0.0f;
     float2 pixel;
     float3 voxel;
 
     if (idx < real_size.x && idy < real_size.y && idz < real_size.z) {{
 {3}
 
-        volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] = old + result * norm_factor;
+        if (cumulate) {{
+            volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] += result * norm_factor;
+        }} else {{
+            volume[idz * real_size.x * real_size.y + idy * real_size.x + idx] = result * norm_factor;
+        }}
     }}
 }}