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

Function time_irregular_binary_ops_2D

benchmarks/cpp/irregular_strides.cpp:24–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void time_irregular_binary_ops_2D() {
25 auto device = mx::default_device();
26 int size = 2048;
27 auto a = mx::random::uniform({size, size});
28 auto b = mx::random::uniform({size, size});
29 mx::eval(a, b);
30 TIMEM("2D regular", mx::add, a, b, device);
31
32 b = mx::transpose(b);
33 mx::eval(b);
34 TIMEM("2D mx::transpose", mx::add, a, b, device);
35
36 b = mx::random::uniform({size});
37 mx::eval(b);
38 TIMEM("2D broadcast dim 0", mx::add, a, b, device);
39
40 b = mx::reshape(b, {size, 1});
41 mx::eval(b);
42 TIMEM("2D broadcast dim 1", mx::add, a, b, device);
43}
44
45void time_irregular_binary_ops_3D() {
46 auto device = mx::default_device();

Callers 1

mainFunction · 0.85

Calls 4

uniformFunction · 0.50
evalFunction · 0.50
transposeFunction · 0.50
reshapeFunction · 0.50

Tested by

no test coverage detected