llvm::get_threadpool_strategy

Build a strategy from a number of threads as a string provided in Num.

Synopsis

Declared in <llvm/Support/Threading.h>

std::optional<ThreadPoolStrategy>
get_threadpool_strategy(
    StringRef Num,
    ThreadPoolStrategy Default = {});

Description

When Num is above the max number of threads specified by the Default strategy, we attempt to equally allocate the threads on all CPU sockets. "0" or an empty string will return the Default strategy. "all" for using all hardware threads.

Return Value

Parsed strategy, Default for empty/"0", or nullopt if invalid.

Parameters

NameDescription
NumThread count as a string, or "0", empty, or "all".
DefaultStrategy used when Num is empty, "0", or omitted.