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

Function new_stream

mlx/stream.cpp:66–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66Stream new_stream(Device d) {
67 auto& [streams, mtx] = all_streams();
68 std::unique_lock lock(mtx);
69 int index = streams.size();
70 auto& s = streams.emplace_back(index, d);
71 if (d == Device::gpu) {
72 gpu::new_stream(s);
73 }
74 return s;
75}
76
77ThreadLocalStream new_thread_local_stream(Device d) {
78 auto& [streams, mtx] = thread_local_streams();

Callers 7

default_streamFunction · 0.70
resolve_streamMethod · 0.70
compile_across_streamsFunction · 0.50
compile_tests.cppFile · 0.50
mainFunction · 0.50

Calls 2

emplace_backMethod · 0.80
sizeMethod · 0.45

Tested by 1

compile_across_streamsFunction · 0.40