Expose function to clear memory cache (#1032)

* expose function to clear memory cache

* fix linux build

* fix metal tests
This commit is contained in:
Awni Hannun
2024-04-24 16:48:51 -07:00
committed by GitHub
parent 20a01bbd9f
commit 771575d27b
9 changed files with 31 additions and 2 deletions

View File

@@ -90,6 +90,15 @@ void init_metal(nb::module_& m) {
Returns:
int: The previous cache limit in bytes.
)pbdoc");
metal.def(
"clear_cache",
&metal::clear_cache,
R"pbdoc(
Clear the memory cache.
After calling this, :func:`get_cache_memory` should return ``0``.
)pbdoc");
metal.def(
"start_capture",
&metal::start_capture,