message: In gemv-ish cases, each byte of the big weights matrix is traversed only once, so any notion of data locality is irrelevant.  Ignore the 'cache locality score' by forcing it to be 0 in that case.
diff: @@ -186,7 +186,15 @@ int GetMultithreadingScore(int block_size_log2, int rows, int cols,
  // (e.g. L3) caches shared among all cores. Here we aim to fit in a fast,
  // local cache.
  int GetCacheLocalityScore(int block_size_log2, int rows, int cols, int depth,
  + int kernel_rows_log2, int kernel_cols_log2,
  int lhs_scalar_size, int rhs_scalar_size, Path path) {
  + // In the narrow case (e.g. matrix*vector), each byte of the big operand
  + // matrix (either LHS or RHS) is traversed only once, so any notion of data
  + // locality is irrelevant. Ignore the 'cache locality score' by forcing it to
  + // be 0 in that case.
  + if (rows <= (1 << kernel_rows_log2) || cols <= (1 << kernel_cols_log2)) {
  + return 0;
  + }
  const int block_rows = std::min(1 << block_size_log2, rows);
  const int block_cols = std::min(1 << block_size_log2, cols);
  #if RUY_PLATFORM(ARM_64)
  @@ -324,8 +332,8 @@ void MakeBlockMap(int rows, int cols, int depth, int kernel_rows,
  block_size_log2 <= max_block_size_log2; block_size_log2++) {
  const int multithreading_score = GetMultithreadingScore(
  block_size_log2, rows, cols, tentative_thread_count);
  - const int cache_locality_score =
  - GetCacheLocalityScore(block_size_log2, rows, cols, depth,
  + const int cache_locality_score = GetCacheLocalityScore(
  + block_size_log2, rows, cols, depth, kernel_rows_log2, kernel_cols_log2,
  lhs_scalar_size, rhs_scalar_size, path);
  const int kernel_amortization_score = GetKernelAmortizationScore(
  block_size_log2, rows, cols, kernel_rows_log2, kernel_cols_log2);
  