Modify the kernels to support nonsquare input