MLX
Loading...
Searching...
No Matches
stream.h
Go to the documentation of this file.
1// Copyright © 2023 Apple Inc.
2
3#pragma once
4
5#include "mlx/device.h"
6
7namespace mlx::core {
8
9struct Stream {
10 int index;
13};
14
17
20
23
24inline bool operator==(const Stream& lhs, const Stream& rhs) {
25 return lhs.index == rhs.index;
26}
27
28inline bool operator!=(const Stream& lhs, const Stream& rhs) {
29 return !(lhs == rhs);
30}
31
32/* Synchronize with the default stream. */
34
35/* Synchronize with the provided stream. */
37
38} // namespace mlx::core
Definition allocator.h:7
void synchronize()
Stream new_stream(Device d)
Make a new stream on the given device.
bool operator==(const Device &lhs, const Device &rhs)
bool operator!=(const Device &lhs, const Device &rhs)
Stream default_stream(Device d)
Get the default stream for the given device.
void set_default_stream(Stream s)
Make the stream the default for its device.
Definition device.h:7
Definition stream.h:9
Device device
Definition stream.h:11
Stream(int index, Device device)
Definition stream.h:12
int index
Definition stream.h:10