MLX
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1// Copyright © 2023 Apple Inc.
2
3#pragma once
4
5namespace mlx::core {
6
7struct Device {
8 enum class DeviceType {
9 cpu,
10 gpu,
11 };
12
13 static constexpr DeviceType cpu = DeviceType::cpu;
14 static constexpr DeviceType gpu = DeviceType::gpu;
15
17
19 int index;
20};
21
23
25
26bool operator==(const Device& lhs, const Device& rhs);
27bool operator!=(const Device& lhs, const Device& rhs);
28
29} // namespace mlx::core
Definition allocator.h:7
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)
Definition device.h:7
static constexpr DeviceType gpu
Definition device.h:14
Device(DeviceType type, int index=0)
Definition device.h:16
int index
Definition device.h:19
static constexpr DeviceType cpu
Definition device.h:13
DeviceType type
Definition device.h:18
DeviceType
Definition device.h:8