core.dot_mm() preparation for optimization for C-contig and F-contig matrices