GDAL
|
00001 /****************************************************************************** 00002 * $Id: gdalgrid_priv.h 29314 2015-06-05 20:21:11Z rouault $ 00003 * 00004 * Project: GDAL Gridding API. 00005 * Purpose: Prototypes, and definitions for of GDAL scattered data gridder. 00006 * Author: Even Rouault, <even dot rouault at mines dash paris dot org> 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 2013, Even Rouault <even dot rouault at mines-paris dot org> 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a 00012 * copy of this software and associated documentation files (the "Software"), 00013 * to deal in the Software without restriction, including without limitation 00014 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00015 * and/or sell copies of the Software, and to permit persons to whom the 00016 * Software is furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included 00019 * in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00022 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00024 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00026 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00027 * DEALINGS IN THE SOFTWARE. 00028 ****************************************************************************/ 00029 00030 #include "cpl_error.h" 00031 #include "cpl_quad_tree.h" 00032 00033 typedef struct 00034 { 00035 const double* padfX; 00036 const double* padfY; 00037 } GDALGridXYArrays; 00038 00039 typedef struct 00040 { 00041 GDALGridXYArrays* psXYArrays; 00042 int i; 00043 } GDALGridPoint; 00044 00045 typedef struct 00046 { 00047 CPLQuadTree* hQuadTree; 00048 double dfInitialSearchRadius; 00049 const float *pafX; 00050 const float *pafY; 00051 const float *pafZ; 00052 } GDALGridExtraParameters; 00053 00054 #ifdef HAVE_SSE_AT_COMPILE_TIME 00055 int CPLHaveRuntimeSSE(); 00056 00057 CPLErr 00058 GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE( 00059 const void *poOptions, 00060 GUInt32 nPoints, 00061 const double *unused_padfX, 00062 const double *unused_padfY, 00063 const double *unused_padfZ, 00064 double dfXPoint, double dfYPoint, 00065 double *pdfValue, 00066 void* hExtraParamsIn ); 00067 #endif 00068 00069 #ifdef HAVE_AVX_AT_COMPILE_TIME 00070 int CPLHaveRuntimeAVX(); 00071 00072 CPLErr GDALGridInverseDistanceToAPower2NoSmoothingNoSearchAVX( 00073 const void *poOptions, 00074 GUInt32 nPoints, 00075 const double *unused_padfX, 00076 const double *unused_padfY, 00077 const double *unused_padfZ, 00078 double dfXPoint, double dfYPoint, 00079 double *pdfValue, 00080 void* hExtraParamsIn ); 00081 #endif 00082 00083 #if defined(__GNUC__) 00084 #if defined(__x86_64) 00085 #define GCC_CPUID(level, a, b, c, d) \ 00086 __asm__ ("xchgq %%rbx, %q1\n" \ 00087 "cpuid\n" \ 00088 "xchgq %%rbx, %q1" \ 00089 : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ 00090 : "0" (level)) 00091 #else 00092 #define GCC_CPUID(level, a, b, c, d) \ 00093 __asm__ ("xchgl %%ebx, %1\n" \ 00094 "cpuid\n" \ 00095 "xchgl %%ebx, %1" \ 00096 : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ 00097 : "0" (level)) 00098 #endif 00099 #endif