MLX
Loading...
Searching...
No Matches
mlx
backend
metal
resident.h
Go to the documentation of this file.
1
// Copyright © 2024 Apple Inc.
2
3
#pragma once
4
5
#include "
mlx/backend/metal/device.h
"
6
7
namespace
mlx::core::metal
{
8
9
class
ResidencySet
{
10
public
:
11
ResidencySet
(MTL::Device* d);
12
~ResidencySet
();
13
14
ResidencySet
(
const
ResidencySet
&) =
delete
;
15
ResidencySet
&
operator=
(
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
buf
MTL::Buffer * buf
Definition
allocator.h:39
device.h
mlx::core::metal::ResidencySet
Definition
resident.h:9
mlx::core::metal::ResidencySet::resize
void resize(size_t size)
mlx::core::metal::ResidencySet::~ResidencySet
~ResidencySet()
mlx::core::metal::ResidencySet::insert
void insert(MTL::Allocation *buf)
mlx::core::metal::ResidencySet::ResidencySet
ResidencySet(const ResidencySet &)=delete
mlx::core::metal::ResidencySet::ResidencySet
ResidencySet(MTL::Device *d)
mlx::core::metal::ResidencySet::mtl_residency_set
const MTL::ResidencySet * mtl_residency_set()
Definition
resident.h:17
mlx::core::metal::ResidencySet::erase
void erase(MTL::Allocation *buf)
mlx::core::metal::ResidencySet::operator=
ResidencySet & operator=(const ResidencySet &)=delete
mlx::core::metal
Definition
allocator.h:13
Generated by
1.12.0