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

Function time_divmod

benchmarks/cpp/single_ops.cpp:260–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void time_divmod() {
261 auto a = mx::random::normal({1000});
262 auto b = mx::random::normal({1000});
263 mx::eval({a, b});
264
265 auto divmod_fused = [&a, &b]() { return mx::divmod(a, b); };
266 TIME(divmod_fused);
267
268 auto divmod_separate = [&a, &b]() {
269 return std::vector<mx::array>{mx::floor_divide(a, b), mx::remainder(a, b)};
270 };
271 TIME(divmod_separate);
272}
273
274int main() {
275 std::cout << "Benchmarks for " << mx::default_device() << std::endl;

Callers 1

mainFunction · 0.85

Calls 5

divmodFunction · 0.85
floor_divideFunction · 0.85
remainderFunction · 0.85
normalFunction · 0.50
evalFunction · 0.50

Tested by

no test coverage detected