go-mlx/dist/include/mlx/device.h
Snider 2292557fd6 chore: vendor MLX C headers for Go module consumers
dist/include/ contains the MLX and MLX-C headers needed for CGo
compilation. Without these, go-mlx cannot be used as a module
dependency (headers not found in module cache).

Libraries (dylib/metallib) are still gitignored — users build
those locally via cmake.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:14:04 +00:00

31 lines
600 B
C++

// Copyright © 2023 Apple Inc.
#pragma once
namespace mlx::core {
struct Device {
enum class DeviceType {
cpu,
gpu,
};
static constexpr DeviceType cpu = DeviceType::cpu;
static constexpr DeviceType gpu = DeviceType::gpu;
Device(DeviceType type, int index = 0) : type(type), index(index) {}
DeviceType type;
int index;
};
const Device& default_device();
void set_default_device(const Device& d);
bool operator==(const Device& lhs, const Device& rhs);
bool operator!=(const Device& lhs, const Device& rhs);
bool is_available(const Device& d);
} // namespace mlx::core