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

Name

Description

Num

Thread count as a string, or "0", empty, or "all".

Default

Strategy used when Num is empty, "0", or omitted.

Created with MrDocs