 	}
 }
 
+// Math to add two intermediate steps of mean & stddev 
+// See http://www.johndcook.com/blog/skewness_kurtosis/
 __device__ void combine_running_totals(float &M1_1, float M1_2, float &M2_1, float M2_2, unsigned int &n_1, unsigned int n_2)
 {
 	unsigned int combined_n = n_1 + n_2;

}
#define SAFE_CALL(call,msg) _safe_cuda_call((call),(msg),__FILE__,__LINE__)

__global__ void global_contrast_normalization_kernel(const cv::gpu::PtrStepSz<float> *input,
									const float *mean,
									const float *stddev,


	gemm(dFlattenedImages, weights, 1.0, buf, 0.0, zcaOut);

	unflatten_kernel<<<grid,block>>>(zcaOut, input[0].rows, input[0].cols, output);
	SAFE_CALL(cudaDeviceSynchronize(),"GCN kernel launch failed");

	SAFE_CALL(cudaFree(d_M1),"CUDA Free Failed");
	SAFE_CALL(cudaFree(d_M2),"CUDA Free Failed");
	SAFE_CALL(cudaFree(d_n),"CUDA Free Failed");
}

