TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
metal_private.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2#pragma once
3
4#import <Metal/Metal.h>
5
6#include <cstddef>
7#include <mutex>
8
9namespace tmk::gpu::metal {
10
11// One stable, registry-ID-ordered snapshot shared by discovery and field dispatch.
12std::size_t device_count();
13id<MTLDevice> device_at_index(int index);
14
15// Process working-set budget, not free VRAM: currentAllocatedSize excludes other processes.
16std::size_t working_set_headroom(id<MTLDevice> device);
17
18// Serialize admission and allocation so callers cannot admit against the same headroom.
19std::mutex& allocation_mutex();
20
21} // namespace tmk::gpu::metal
std::size_t working_set_headroom(id< MTLDevice > device)
Process working-set budget, not free VRAM: currentAllocatedSize excludes other processes.
std::mutex & allocation_mutex()
Serialize admission and allocation so callers cannot admit against the same headroom.
id< MTLDevice > device_at_index(int index)
std::size_t device_count()
One stable, registry-ID-ordered snapshot shared by discovery and field dispatch.