Cleaned up code in gpu kernel templates and added missing __syncthreads in V3, causing results to match V1.
Cleaned up code in gpu kernel templates and added missing __syncthreads in V3, causing results to match V1.

mbdriscoll/asp-old,mbdriscoll/asp-old,mbdriscoll/asp-old,mbdriscoll/asp-old