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

Function time_irregular_binary_ops_1D

benchmarks/cpp/irregular_strides.cpp:12–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10namespace mx = mlx::core;
11
12void time_irregular_binary_ops_1D() {
13 auto device = mx::default_device();
14 int size = 1000000;
15 int step = 2;
16 auto a = mx::random::uniform({size});
17 auto b = mx::random::uniform({size});
18 mx::eval(a, b);
19 a = slice(a, {0}, {size}, {step});
20 b = slice(b, {0}, {size}, {step});
21 TIMEM("1D strided", mx::add, a, b, device);
22}
23
24void time_irregular_binary_ops_2D() {
25 auto device = mx::default_device();

Callers 1

mainFunction · 0.85

Calls 3

uniformFunction · 0.50
evalFunction · 0.50
sliceFunction · 0.50

Tested by

no test coverage detected