2024-02-25 14:20:57 +08:00
|
|
|
// Copyright © 2023-2024 Apple Inc.
|
2023-12-01 03:12:53 +08:00
|
|
|
|
2023-11-30 02:30:41 +08:00
|
|
|
#include <stdexcept>
|
|
|
|
|
|
|
|
#include "mlx/backend/metal/metal.h"
|
|
|
|
|
|
|
|
namespace mlx::core::metal {
|
|
|
|
|
2024-02-25 14:20:57 +08:00
|
|
|
bool is_available() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-11-30 02:30:41 +08:00
|
|
|
void new_stream(Stream) {}
|
2023-12-24 11:18:10 +08:00
|
|
|
std::shared_ptr<void> new_scoped_memory_pool() {
|
2023-12-23 03:01:26 +08:00
|
|
|
return nullptr;
|
|
|
|
}
|
2023-11-30 02:30:41 +08:00
|
|
|
|
|
|
|
std::function<void()> make_task(
|
|
|
|
array& arr,
|
|
|
|
std::vector<std::shared_future<void>> deps,
|
2024-01-08 07:16:51 +08:00
|
|
|
std::shared_ptr<std::promise<void>> p) {
|
2023-11-30 02:30:41 +08:00
|
|
|
throw std::runtime_error(
|
|
|
|
"[metal::make_task] Cannot make GPU task without metal backend");
|
|
|
|
}
|
|
|
|
|
2024-01-19 02:01:59 +08:00
|
|
|
// No cache for CPU only
|
|
|
|
bool cache_enabled(void) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void set_cache_enabled(bool) {}
|
|
|
|
|
2023-11-30 02:30:41 +08:00
|
|
|
} // namespace mlx::core::metal
|