1. A computer-executable method for performing a general matrix-matrix multiplication (GEMM) operation, comprising: generating a set of kernels that includes at least one of a variable-K GEMM kernel and a constant-K GEMM kernel; receiving data representing at least two matrices; determining a set of row and column parameters associated with the two matrices, wherein the set of row and column parameters indicate a number of rows and a number of columns of a first matrix and a number of columns of a second matrix; selecting a kernel from the set of kernels for performing the GEMM operation, which involves accessing a set of rules, wherein a rule of the set of rules maps a respective set of row and column parameters to a respective kernel from the set of kernels, and wherein the selected kernel performs the GEMM operation faster than any other kernel in the set of kernels for the respective set of row and column parameters; and performing the GEMM operation on the two matrices using the selected kernel.