diff options
author | Kenneth Heafield <github@kheafield.com> | 2022-02-09 01:25:08 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2022-02-09 01:25:08 +0300 |
commit | 24ff82711ed0d7ade46a88e1ab14fe281ede42e3 (patch) | |
tree | 813f2de06981af694801796785a9efc417793a2c | |
parent | 1b8cbd6f611c21011325cfe0312940f0635dea33 (diff) |
Replace iostream with fprintf
This resolves a potential static initialization ordering problem if
INTGEMM_CPUID is an invalid value
-rw-r--r-- | intgemm/intgemm.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/intgemm/intgemm.cc b/intgemm/intgemm.cc index 31370e2..7ccd21b 100644 --- a/intgemm/intgemm.cc +++ b/intgemm/intgemm.cc @@ -12,10 +12,9 @@ #include "intgemm.h" #include "stats.h" +#include <stdio.h> #include <stdlib.h> -#include <iostream> - namespace intgemm { namespace { @@ -103,7 +102,7 @@ CPUType EnvironmentCPUID() { if (!strcmp(env_override, "AVX2")) return CPUType::AVX2; if (!strcmp(env_override, "SSSE3")) return CPUType::SSSE3; if (!strcmp(env_override, "SSE2")) return CPUType::SSE2; - std::cerr << "Unrecognized INTGEMM_CPUID " << env_override << std::endl; + fprintf(stderr, "Ignoring unrecognized INTGEMM_CPUID %s\n", env_override); return CPUType::AVX512VNNI; } @@ -120,7 +119,7 @@ void UnsupportedCPUError() { #if (defined(_MSC_VER) && !defined(__clang__)) ? (_HAS_EXCEPTIONS) : (__EXCEPTIONS) throw UnsupportedCPU(); #else - std::cerr << "intgemm does not support this CPU" << std::endl; + fprintf(stderr, "intgemm does not support this CPU.\n"); abort(); #endif } |