MCPcopy Create free account
hub / github.com/ml-explore/mlx / time_matvec

Function time_matvec

benchmarks/cpp/single_ops.cpp:138–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void 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
151void time_matmul() {
152 int M = 1000, N = 1000, K = 1000;

Callers 1

mainFunction · 0.85

Calls 4

uniformFunction · 0.50
evalFunction · 0.50
matmulFunction · 0.50
transposeFunction · 0.50

Tested by

no test coverage detected