Add clear_streams API for cleanup before exit (#3395)
This commit is contained in:
@@ -133,6 +133,10 @@ void init_stream(nb::module_& m) {
|
||||
&mx::new_stream,
|
||||
"device"_a,
|
||||
R"pbdoc(Make a new stream on the given device.)pbdoc");
|
||||
m.def(
|
||||
"clear_streams",
|
||||
&mx::clear_streams,
|
||||
R"pbdoc(Destroy all streams created in current thread.)pbdoc");
|
||||
|
||||
nb::class_<PyStreamContext>(m, "StreamContext", R"pbdoc(
|
||||
A context manager for setting the current device and stream.
|
||||
|
||||
Reference in New Issue
Block a user