00001 /* 00002 Copyright 2010-2011, D. E. Shaw Research. 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are 00007 met: 00008 00009 * Redistributions of source code must retain the above copyright 00010 notice, this list of conditions, and the following disclaimer. 00011 00012 * Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions, and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 * Neither the name of D. E. Shaw Research nor the names of its 00017 contributors may be used to endorse or promote products derived from 00018 this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00021 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00023 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00024 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00025 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00026 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00027 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00028 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00029 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00030 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00173 /* 00174 N.B. When something is added to the list of features, it should be 00175 added to each of the *features.h files, AND to examples/ut_features.cpp. 00176 */ 00177 00178 /* N.B. most other compilers (icc, nvcc, open64, llvm) will also define __GNUC__, so order matters. */ 00179 #if defined(__ICC) 00180 #include "iccfeatures.h" 00181 #elif defined(__CUDACC__) 00182 #include "nvccfeatures.h" 00183 #elif defined(__OPENCL_VERSION__) && __OPENCL_VERSION__ > 0 00184 #include "openclfeatures.h" 00185 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) 00186 #include "sunprofeatures.h" 00187 #elif defined(__OPEN64__) 00188 #include "open64features.h" 00189 #elif defined(__llvm__) 00190 #include "llvmfeatures.h" 00191 #elif defined(__GNUC__) 00192 #include "gccfeatures.h" 00193 #elif defined(_MSC_FULL_VER) 00194 #include "msvcfeatures.h" 00195 #else 00196 #error "Can't identify compiler. You'll need to add a new xxfeatures.hpp" 00197 { /* maybe an unbalanced brace will terminate the compilation */ 00198 #endif 00199 00200 #ifndef R123_STATIC_ASSERT 00201 #if R123_USE_CXX0X 00202 #define R123_STATIC_ASSERT(expr, msg) static_assert(expr, msg) 00203 #else 00204 /* if msg always_looked_like_this, we could paste it into the name. Worth it? */ 00205 #define R123_STATIC_ASSERT(expr, msg) typedef char static_assertion[(!!(expr))*2-1] 00206 #endif 00207 #endif 00208 00209 #ifndef R123_USE_PHILOX_64BIT 00210 #define R123_USE_PHILOX_64BIT (R123_USE_MULHILO64_ASM || R123_USE_MULHILO64_MSVC_INTRIN || R123_USE_MULHILO64_CUDA_INTRIN || R123_USE_GNU_UINT128 || R123_USE_MULHILO64_C99 || R123_USE_MULHILO64_OPENCL_INTRIN) 00211 #endif 00212 00213 #ifndef R123_ULONG_LONG 00214 #if defined(__cplusplus) && !R123_USE_CXX0X 00215 /* C++98 doesn't have long long, so fall back to uint64_t which 00216 might be typedefed to something that doesn't elicit 00217 complaints from -pedantic. Cross your fingers... */ 00218 #define R123_ULONG_LONG uint64_t 00219 #else 00220 #define R123_ULONG_LONG unsigned long long 00221 #endif 00222 #endif 00223 00224 /* UINT64_C should have been #defined by XXXfeatures.h, either by 00225 #include <stdint.h> or through compiler-dependent hacks */ 00226 #ifndef R123_64BIT 00227 #define R123_64BIT(x) UINT64_C(x) 00228 #endif 00229 00230 #ifndef R123_THROW 00231 #define R123_THROW(x) throw (x) 00232 #endif 00233