         {
             static __shared__ scalar shared_min[32]; // Shared mem for 32 partial minmax comparisons
             static __shared__ scalar shared_max[32]; // Shared mem for 32 partial minmax comparisons
+
             int lane = threadIdx.x % warpSize;
             int wid = threadIdx.x / warpSize;
 

        {
            for (int offset = warpSize/2; offset > 0; offset /= 2)
            {
                val  = min(val,  __shfl_down(val, offset));
            }
            return val;
        }

        void set_c_cross(const scalar & c, const Vector3 & a, const vectorfield & b, vectorfield & out)
        {
            int n = out.size();
            cu_set_c_cross<<<(n+1023)/1024, 1024>>>(c, a, b.data(), out.data(), n);
            cudaDeviceSynchronize();
        }

