System & Debug¶
System Info¶
-
namespace system¶
Functions
-
bool is_metal_available()¶
Checks if a Metal-capable GPU is available on the system.
- Returns:
True if a Metal device is found, false otherwise. This will always be false on non-Apple platforms.
-
bool should_run_gpu_tests()¶
Checks if GPU tests should be run.
Returns false if:
Metal is not available
The AXIOM_SKIP_GPU_TESTS environment variable is set to “1”
- Returns:
True if GPU tests should be executed, false otherwise.
-
bool is_metal_available()¶
Threading¶
-
namespace parallel¶
Functions
-
inline size_t get_num_threads()¶
Get the maximum number of threads available for parallel regions.
-
inline void set_num_threads(size_t n)¶
Set the number of threads for parallel regions (0 = use all available)
-
inline size_t get_thread_id()¶
Get the current thread ID within a parallel region.
-
inline bool should_parallelize(size_t elements, size_t min_elements = DEFAULT_MIN_ELEMENTS)¶
Check if parallelization would be beneficial for the given element count.
-
inline bool should_parallelize_reduction(size_t elements)¶
Check if parallelization would be beneficial for reductions.
-
inline bool should_parallelize_matmul(size_t M, size_t N, size_t K)¶
Check if parallelization would be beneficial for matrix multiplication.
Variables
-
constexpr size_t DEFAULT_MIN_ELEMENTS = 65536¶
-
constexpr size_t REDUCTION_MIN_ELEMENTS = 262144¶
-
constexpr size_t MATMUL_MIN_PRODUCT = 1000000¶
-
class ThreadGuard¶
- #include <parallel.hpp>
RAII guard for temporarily changing the thread count Restores the previous thread count when destroyed.
Public Functions
-
inline explicit ThreadGuard(size_t)¶
-
ThreadGuard(const ThreadGuard&) = delete¶
-
ThreadGuard &operator=(const ThreadGuard&) = delete¶
-
inline explicit ThreadGuard(size_t)¶
-
inline size_t get_num_threads()¶
Tracing¶
-
namespace trace¶
Functions
-
inline void enable()¶
-
inline void disable()¶
-
inline void clear()¶
-
inline std::string dump()¶
-
inline bool is_enabled()¶
-
struct TraceEvent¶
- #include <debug.hpp>
-
class Tracer¶
- #include <debug.hpp>
Public Functions
-
inline void enable()¶
-
inline void disable()¶
-
inline bool is_enabled() const¶
-
inline void clear()¶
-
void record(const std::string &op_name, const std::string &desc, std::chrono::nanoseconds duration, size_t memory_bytes, bool materialized)¶
-
std::string dump() const¶
-
inline const std::vector<TraceEvent> &events() const¶
-
inline void enable()¶
-
class ScopedTrace¶
- #include <debug.hpp>
-
inline void enable()¶
Profiling¶
CPU Info¶
-
namespace cpu_info¶