Make each thread have its own default stream (#3281)

This commit is contained in:
Cheng
2026-03-25 15:48:49 +09:00
committed by GitHub
parent 57c813f042
commit df7f7db943
14 changed files with 175 additions and 123 deletions
+6 -2
View File
@@ -1,8 +1,10 @@
// Copyright © 2023-2025 Apple Inc.
#include <optional>
#include <sstream>
#include <nanobind/nanobind.h>
#include <nanobind/stl/optional.h>
#include <nanobind/stl/string.h>
#include <nanobind/stl/unordered_map.h>
#include <nanobind/stl/variant.h>
@@ -80,8 +82,10 @@ void init_device(nb::module_& m) {
)pbdoc");
m.def(
"device_info",
&mx::device_info,
nb::arg("d") = mx::default_device(),
[](std::optional<mx::Device> d) {
return mx::device_info(d.value_or(mx::default_device()));
},
"d"_a = nb::none(),
R"pbdoc(
Get information about a device.