Skip to content

Commit 59a1114

Browse files
committed
sbgemm: cooperlake: tuning for small matrix
1 parent 682d665 commit 59a1114

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

kernel/x86_64/sbgemm_small_kernel_permit_cooperlake.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3838

3939
int CNAME(int transa, int transb, BLASLONG M, BLASLONG N, BLASLONG K, FLOAT alpha, FLOAT beta)
4040
{
41-
return 1;
41+
double MNK = (double) M * (double) N * (double) K;
42+
if (MNK > 256.0*256.0*256.0) // disable for big size matrix
43+
return 0;
44+
/* small matrix kernel works well for N = 8, 16, 32 */
45+
if (N == 8 || N == 16 || N == 32)
46+
return 1;
47+
return 0;
4248
}

0 commit comments

Comments
 (0)