mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 17:31:16 +08:00
49 lines
932 B
C++
49 lines
932 B
C++
// Copyright © 2023-2024 Apple Inc.
|
|
|
|
#include <stdexcept>
|
|
|
|
#include "mlx/backend/metal/metal.h"
|
|
#include "mlx/backend/metal/metal_impl.h"
|
|
|
|
namespace mlx::core::metal {
|
|
|
|
bool is_available() {
|
|
return false;
|
|
}
|
|
|
|
void new_stream(Stream) {}
|
|
std::shared_ptr<void> new_scoped_memory_pool() {
|
|
return nullptr;
|
|
}
|
|
|
|
std::function<void()> make_task(
|
|
array& arr,
|
|
std::vector<std::shared_future<void>> deps,
|
|
std::shared_ptr<std::promise<void>> p) {
|
|
throw std::runtime_error(
|
|
"[metal::make_task] Cannot make GPU task without metal backend");
|
|
}
|
|
|
|
// No-ops when Metal is not available.
|
|
size_t get_active_memory() {
|
|
return 0;
|
|
}
|
|
size_t get_peak_memory() {
|
|
return 0;
|
|
}
|
|
size_t get_cache_memory() {
|
|
return 0;
|
|
}
|
|
size_t set_memory_limit(size_t, bool) {
|
|
return 0;
|
|
}
|
|
size_t set_cache_limit(size_t) {
|
|
return 0;
|
|
}
|
|
bool start_capture(std::string path) {
|
|
return false;
|
|
}
|
|
void stop_capture() {}
|
|
|
|
} // namespace mlx::core::metal
|