         // Loop over sources in block.
         for (unsigned s = 0; s < sourcesInBlock; ++s) {
             // Calculate the geometric phase from the source.
-            phase = GEOMETRIC_PHASE_2D_HORIZONTAL(x, y,
-                    lsrc[s].z, lsrc[s].y, lsrc[s].x, k);
+            const float phase = GEOMETRIC_PHASE_2D_HORIZONTAL(x, y,
+                    csrc[s].z, csrc[s].y, csrc[s].x, k);
 
             // Perform complex multiply-accumulate.
-            sincosf(phase, &sinPhase, &cosPhase);
-            lsignal[threadIdx.x].x += (lsrc[s].w * cosPhase);
-            lsignal[threadIdx.x].y += (lsrc[s].w * sinPhase);
+            float sinPhase, cosPhase;
+            __sincosf(phase, &sinPhase, &cosPhase);
+            csig[threadIdx.x].x += (csrc[s].w * cosPhase);
+            csig[threadIdx.x].y += (csrc[s].w * sinPhase);
         }
 
         // Must synchronise again before loading in a new block of sources.

    }

    // Copy shared memory back into global memory.
    signals[a].x = lsignal[threadIdx.x].x;
    signals[a].y = lsignal[threadIdx.x].y;
}

        // sourcesInBlock pieces of data from global memory.
        for (unsigned t = threadIdx.x; t < sourcesInBlock; t += blockDim.x) {
            const unsigned sg = t + sourceStart; // global source index
            csrc[t].x = strig[sg].x;
            csrc[t].y = strig[sg].y;
            csrc[t].z = strig[sg].z;
            csrc[t].w = samp[sg];
        }

        // Must synchronise before computing the signal from these sources.
