GDAL
cpl_cpu_features.h
00001 /******************************************************************************
00002  *
00003  * Project:  CPL - Common Portability Library
00004  * Purpose:  Prototypes, and definitions for of CPU features detection
00005  * Author:   Even Rouault, <even dot rouault at spatialys dot com>
00006  *
00007  ******************************************************************************
00008  * Copyright (c) 2016, Even Rouault <even dot rouault at spatialys dot com>
00009  *
00010  * Permission is hereby granted, free of charge, to any person obtaining a
00011  * copy of this software and associated documentation files (the "Software"),
00012  * to deal in the Software without restriction, including without limitation
00013  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014  * and/or sell copies of the Software, and to permit persons to whom the
00015  * Software is furnished to do so, subject to the following conditions:
00016  *
00017  * The above copyright notice and this permission notice shall be included
00018  * in all copies or substantial portions of the Software.
00019  *
00020  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00022  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00023  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00024  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00025  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00026  * DEALINGS IN THE SOFTWARE.
00027  ****************************************************************************/
00028 
00029 #ifndef CPL_CPU_FEATURES_H
00030 #define CPL_CPU_FEATURES_H
00031 
00032 #include "cpl_port.h"
00033 #include "cpl_string.h"
00034 
00036 
00037 #ifdef HAVE_SSE_AT_COMPILE_TIME
00038 #if (defined(_M_X64) || defined(__x86_64))
00039 #define HAVE_INLINE_SSE
00040 static bool inline CPLHaveRuntimeSSE() { return true; }
00041 #else
00042 bool CPLHaveRuntimeSSE();
00043 #endif
00044 #endif
00045 
00046 #ifdef HAVE_SSSE3_AT_COMPILE_TIME
00047 #if __SSSE3__
00048 #define HAVE_INLINE_SSSE3
00049 static bool inline CPLHaveRuntimeSSSE3()
00050 {
00051 #ifdef DEBUG
00052     if( !CPLTestBool(CPLGetConfigOption("GDAL_USE_SSSE3", "YES")) )
00053         return false;
00054 #endif
00055     return true;
00056 }
00057 #else
00058 bool CPLHaveRuntimeSSSE3();
00059 #endif
00060 #endif
00061 
00062 #ifdef HAVE_AVX_AT_COMPILE_TIME
00063 #if __AVX__
00064 #define HAVE_INLINE_AVX
00065 static bool inline CPLHaveRuntimeAVX() { return true; }
00066 #else
00067 bool CPLHaveRuntimeAVX();
00068 #endif
00069 #endif
00070 
00072 
00073 #endif // CPL_CPU_FEATURES_H

Generated for GDAL by doxygen 1.7.6.1.