swr/auto_matrix: move layouts to local variables