1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-01 09:47:01 +03:00

-T0 detects number of physical cores

This commit is contained in:
Sean Purcell
2017-04-13 12:28:28 -07:00
parent 5c42d0edc8
commit afa48518e2
2 changed files with 177 additions and 0 deletions

View File

@ -602,6 +602,11 @@ int main(int argCount, const char* argv[])
DISPLAYLEVEL(4, "PLATFORM_POSIX_VERSION defined: %ldL\n", (long) PLATFORM_POSIX_VERSION);
#endif
if (nbThreads == 0) {
/* try to guess */
nbThreads = UTIL_countPhysicalCores();
DISPLAYLEVEL(3, "Note: %d physical core(s) detected\n", nbThreads);
}
g_utilDisplayLevel = g_displayLevel;
if (!followLinks) {