TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_gpu_choice.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <optional>
6#include <span>
7#include <string>
8#include <string_view>
9
10namespace tachyon
11{
14
16 enum class GpuKind : uint8_t { Other, Integrated, Discrete, Virtual, Cpu };
17
19 struct GpuInfo
20 {
21 std::string name;
23 };
24
27 std::string_view GpuKindName(GpuKind kind);
28
34 std::optional<size_t> ChooseGpu(std::span<const GpuInfo> gpus, std::string_view preference);
35
38 std::string GpuPreference(std::string_view appPreference);
39
41}
std::optional< size_t > ChooseGpu(std::span< const GpuInfo > gpus, std::string_view preference)
Which of gpus preference asks for:
GpuKind
What kind of GPU a device is.
Definition gui_gpu_choice.h:16
std::string_view GpuKindName(GpuKind kind)
The kind's name, as a preference names it: "integrated", "discrete", "virtual", "cpu",...
std::string GpuPreference(std::string_view appPreference)
The GPU preference in effect: the TACHYON_GPU environment variable when it's set, for a run without c...
@ Discrete
Definition gui_gpu_choice.h:16
@ Cpu
Definition gui_gpu_choice.h:16
@ Virtual
Definition gui_gpu_choice.h:16
@ Other
Definition gui_gpu_choice.h:16
@ Integrated
Definition gui_gpu_choice.h:16
Definition gui_logging.h:24
A GPU as the graphics API reports it, for ChooseGpu.
Definition gui_gpu_choice.h:20
GpuKind kind
Definition gui_gpu_choice.h:22
std::string name
Definition gui_gpu_choice.h:21