mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-27 11:31:21 +08:00

* add synchronize function * fix linux * fix linux * fix and fix docs * fix test * try synchronize in stream destroy * synchronize works for both cpu and gpu
24 lines
471 B
C++
24 lines
471 B
C++
// Copyright © 2023-2024 Apple Inc.
|
|
|
|
#pragma once
|
|
|
|
#include <future>
|
|
#include <memory>
|
|
|
|
#include "mlx/array.h"
|
|
#include "mlx/stream.h"
|
|
|
|
namespace mlx::core::metal {
|
|
|
|
void new_stream(Stream stream);
|
|
|
|
std::unique_ptr<void, std::function<void(void*)>> new_scoped_memory_pool();
|
|
|
|
std::function<void()> make_task(array arr, bool signal);
|
|
|
|
std::function<void()> make_synchronize_task(
|
|
Stream s,
|
|
std::shared_ptr<std::promise<void>> p);
|
|
|
|
} // namespace mlx::core::metal
|