From cb9ebedaeff37c3eee5f72a836528c97acd36e05 Mon Sep 17 00:00:00 2001 From: liaogang Date: Fri, 9 Dec 2016 16:54:58 +0800 Subject: [PATCH] Remove ostream and add intrin header file --- paddle/utils/CpuId.cpp | 4 +++- paddle/utils/CpuId.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/utils/CpuId.cpp b/paddle/utils/CpuId.cpp index 734b2e09246..ae1fb40f04f 100644 --- a/paddle/utils/CpuId.cpp +++ b/paddle/utils/CpuId.cpp @@ -14,6 +14,8 @@ limitations under the License. */ #ifdef _WIN32 +#include + /// for MSVC #define CPUID(info, x) __cpuidex(info, x, 0) @@ -49,7 +51,7 @@ SIMDFlags::SIMDFlags() { simd_flags_ |= cpuInfo[2] & (1 << 16) ? SIMD_FMA4 : SIMD_NONE; } -SIMDFlags* SIMDFlags::instance() { +const SIMDFlags* SIMDFlags::instance() { static SIMDFlags instance; return &instance; } diff --git a/paddle/utils/CpuId.h b/paddle/utils/CpuId.h index d15e58d1ddd..19096332b62 100644 --- a/paddle/utils/CpuId.h +++ b/paddle/utils/CpuId.h @@ -11,7 +11,6 @@ limitations under the License. */ #pragma once -#include #include "DisableCopy.h" namespace paddle { @@ -22,7 +21,7 @@ public: SIMDFlags(); - static SIMDFlags* instance(); + static const SIMDFlags* instance(); inline bool isSSE() const { return simd_flags_ & SIMD_SSE; } inline bool isSSE2() const { return simd_flags_ & SIMD_SSE2; } -- GitLab