mlx/mlx/backend/no_metal/metal.cpp

33 lines
646 B
C++
Raw Normal View History

// 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 {
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() {
return nullptr;
}
2023-11-30 02:30:41 +08:00
std::function<void()> make_task(
array& arr,
std::vector<std::shared_future<void>> deps,
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