implemented SCudaMatrix
fixed gridDim in CudaMatrix