| 136 | } |
| 137 | |
| 138 | void time_matvec() { |
| 139 | int M = 2000, N = 200; |
| 140 | auto a = mx::random::uniform({M, N}); |
| 141 | auto b = mx::random::uniform({N}); |
| 142 | auto c = mx::random::uniform({M}); |
| 143 | mx::eval(a, b, c); |
| 144 | auto matvec = [&]() { return mx::matmul(a, b); }; |
| 145 | TIME(matvec); |
| 146 | |
| 147 | auto matvec_transpose = [&]() { return mx::matmul(mx::transpose(a), c); }; |
| 148 | TIME(matvec_transpose); |
| 149 | } |
| 150 | |
| 151 | void time_matmul() { |
| 152 | int M = 1000, N = 1000, K = 1000; |