|
TraceMaker
C++ API of the engine
|
Namespaces | |
| namespace | metal |
Classes | |
| struct | DeviceInfo |
| struct | FieldProblem |
| struct | GpuStatus |
Enumerations | |
| enum class | Backend { Cpu , Cuda , Metal } |
Functions | |
| Backend | compiled_backend () |
| Backend compiled into this build. CPU references are always available. | |
| std::vector< DeviceInfo > | list_devices () |
| All visible devices with current memory budget. Empty without an available GPU. | |
| std::optional< DeviceInfo > | find_device (std::string_view uuid_or_name) |
| Finds a device by exact UUID or by a case-sensitive substring of its name ("V100", "P100"). | |
| bool | has_free_memory (int device_index, std::size_t bytes) |
| True when bytes plus a safety margin fit in the device's free memory right now. | |
| int | field_cpu (const FieldProblem &p, std::vector< std::int32_t > &out) |
| CPU reference. out is resized to layers*h*w. Returns the number of sweep rounds. | |
| GpuStatus | field_gpu (int device_index, const FieldProblem &p, std::vector< std::int32_t > &out) |
| Compiled GPU backend; on failure (no device, no memory) returns !ok and leaves out empty. | |
| std::vector< std::uint64_t > | philox_fill_cpu (std::uint64_t seed, std::uint32_t stage, std::uint64_t item, std::size_t n) |
| GpuStatus | philox_fill_cuda (int cuda_index, std::uint64_t seed, std::uint32_t stage, std::uint64_t item, std::size_t n, std::vector< std::uint64_t > &out) |
| GPU version. On failure (no CUDA, not enough free memory, launch error) returns !ok and leaves out empty. | |
Variables | |
| constexpr std::size_t | kDeviceMemoryMargin = std::size_t{256} << 20 |
| Safety margin kept free on every device for other processes and runtime overheads. | |
| constexpr std::int32_t | kFieldInf = std::numeric_limits<std::int32_t>::max() / 4 |
|
strong |
| Enumerator | |
|---|---|
| Cpu | |
| Cuda | |
| Metal | |
Definition at line 16 of file device.hpp.
| Backend tmk::gpu::compiled_backend | ( | ) |
Backend compiled into this build. CPU references are always available.
| int tmk::gpu::field_cpu | ( | const FieldProblem & | p, |
| std::vector< std::int32_t > & | out ) |
CPU reference. out is resized to layers*h*w. Returns the number of sweep rounds.
| GpuStatus tmk::gpu::field_gpu | ( | int | device_index, |
| const FieldProblem & | p, | ||
| std::vector< std::int32_t > & | out ) |
Compiled GPU backend; on failure (no device, no memory) returns !ok and leaves out empty.
| std::optional< DeviceInfo > tmk::gpu::find_device | ( | std::string_view | uuid_or_name | ) |
Finds a device by exact UUID or by a case-sensitive substring of its name ("V100", "P100").
| bool tmk::gpu::has_free_memory | ( | int | device_index, |
| std::size_t | bytes ) |
True when bytes plus a safety margin fit in the device's free memory right now.
| std::vector< DeviceInfo > tmk::gpu::list_devices | ( | ) |
All visible devices with current memory budget. Empty without an available GPU.
| std::vector< std::uint64_t > tmk::gpu::philox_fill_cpu | ( | std::uint64_t | seed, |
| std::uint32_t | stage, | ||
| std::uint64_t | item, | ||
| std::size_t | n ) |
| GpuStatus tmk::gpu::philox_fill_cuda | ( | int | cuda_index, |
| std::uint64_t | seed, | ||
| std::uint32_t | stage, | ||
| std::uint64_t | item, | ||
| std::size_t | n, | ||
| std::vector< std::uint64_t > & | out ) |
GPU version. On failure (no CUDA, not enough free memory, launch error) returns !ok and leaves out empty.
|
inlineconstexpr |
Safety margin kept free on every device for other processes and runtime overheads.
Definition at line 40 of file device.hpp.