MLX
 
Loading...
Searching...
No Matches
resident.h
Go to the documentation of this file.
1// Copyright © 2024 Apple Inc.
2
3#pragma once
4
6
7namespace mlx::core::metal {
8
10 public:
11 ResidencySet(MTL::Device* d);
13
14 ResidencySet(const ResidencySet&) = delete;
16
17 const MTL::ResidencySet* mtl_residency_set() {
18 return wired_set_;
19 }
20
21 void insert(MTL::Allocation* buf);
22 void erase(MTL::Allocation* buf);
23
24 void resize(size_t size);
25
26 private:
27 MTL::ResidencySet* wired_set_{nullptr};
28 std::unordered_set<const MTL::Allocation*> unwired_set_;
29 size_t capacity_{0};
30};
31
32} // namespace mlx::core::metal
void insert(MTL::Allocation *buf)
ResidencySet(const ResidencySet &)=delete
const MTL::ResidencySet * mtl_residency_set()
Definition resident.h:17
void erase(MTL::Allocation *buf)
ResidencySet & operator=(const ResidencySet &)=delete
Definition allocator.h:13