Merge "Merge release-5-0 into master"
authorRoland Schulz <roland@utk.edu>
Mon, 28 Jul 2014 19:05:08 +0000 (21:05 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 28 Jul 2014 19:05:08 +0000 (21:05 +0200)
42 files changed:
CMakeLists.txt
CPackInit.cmake
cmake/FindFFTW.cmake
cmake/FindPandoc.cmake
cmake/TestFloatFormat.c [deleted file]
cmake/TestFloatFormat.cpp [new file with mode: 0644]
cmake/gmxTestFloatFormat.cmake
cmake/gmxTestLibXml2.cmake
cmake/gmxTestSimd.cmake
src/contrib/fftw/CMakeLists.txt
src/external/Random123-1.08/README [new file with mode: 0644]
src/external/Random123-1.08/include/Random123/array.h
src/external/Random123-1.08/include/Random123/features/clangfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
src/external/Random123-1.08/include/Random123/features/gccfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/iccfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/msvcfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/nvccfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/open64features.h [deleted file]
src/external/Random123-1.08/include/Random123/features/openclfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/pgccfeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/sse.h [deleted file]
src/external/Random123-1.08/include/Random123/features/sunprofeatures.h [deleted file]
src/external/Random123-1.08/include/Random123/features/xlcfeatures.h [deleted file]
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/arraydata.cpp
src/gromacs/analysisdata/tests/average.cpp
src/gromacs/analysisdata/tests/datatest.h
src/gromacs/analysisdata/tests/histogram.cpp
src/gromacs/analysisdata/tests/lifetime.cpp
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/fileio/mdoutf.c
src/gromacs/mdlib/forcerec.c
src/gromacs/mdlib/nbnxn_search.c
src/gromacs/random/CMakeLists.txt
src/gromacs/random/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/random/tests/random.cpp [new file with mode: 0644]
src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_0.xml [new file with mode: 0644]
src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_1.xml [new file with mode: 0644]
src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_2.xml [new file with mode: 0644]
src/gromacs/utility/stringutil.cpp

index 3adbee4b6654885585df6907a9ccb2e4ea0c692e..834693f4e64466844692ba8a144a3dfe79d7a85a 100644 (file)
@@ -131,7 +131,9 @@ set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBUGINFO RELWITHASSERT
 enable_language(C)
 enable_language(CXX)
 
+set(CPACK_PACKAGE_NAME "gromacs")
 set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
 set(CPACK_PACKAGE_VENDOR "gromacs.org")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Gromacs - a toolkit for high-performance molecular simulation")
 set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/admin/InstallWelcome.txt")
@@ -146,6 +148,7 @@ set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackInit.cmake")
 # part of the configuration or build.
 set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final;${CMAKE_BINARY_DIR}/install-guide/final;/")
 set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
+set(CPACK_GMX_BUILD_HELP "${GMX_BUILD_HELP}") #Works even though GMX_BUILD_HELP is defined later because it is off by default.
 
 #must come after all cpack settings!
 include(CPack)
@@ -449,6 +452,9 @@ include(gmxManageSharedLibraries)
 # tests. This exports LIBXML2_FOUND, which we should not use because
 # it does not tell us that linking will succeed. Instead, we test that
 # next.
+if(DEFINED LIBXML2_LIBRARIES)
+  set(LibXml2_FIND_QUIETLY TRUE)
+endif()
 find_package(LibXml2)
 include(gmxTestLibXml2)
 gmx_test_libxml2(HAVE_LIBXML2)
index 7d3985f99450122b22e1ebe9ecdbe2788fc3c17a..12be4fdeef022c0101b12ba1d22a144df623b8f6 100644 (file)
@@ -33,7 +33,7 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 #TODO: add check that source doesn't contain any untracked files
-if(CPACK_SOURCE_PACKAGE_FILE_NAME) #building source package
+if(NOT CPACK_INSTALL_CMAKE_PROJECTS) #building source package
     get_filename_component(CMAKE_BINARY_DIR ${CPACK_OUTPUT_CONFIG_FILE} PATH)
     if (NOT EXISTS "${CMAKE_BINARY_DIR}/share/man/man1/gmx-view.1" OR
         NOT EXISTS "${CMAKE_BINARY_DIR}/install-guide/final/INSTALL" OR
@@ -47,4 +47,14 @@ if(CPACK_SOURCE_PACKAGE_FILE_NAME) #building source package
             "these parts. You can also configure with "
             "GMX_BUILD_HELP=ON to automatically build the HTML parts.")
     endif()
+else()
+    if (NOT CPACK_GMX_BUILD_HELP)
+        message(WARNING
+            "To create a complete binary package, bash completions, and "
+            "man and HTML pages need to be generated. "
+            "You need to configure with GMX_BUILD_HELP=ON to include all "
+            "in the binary package.")
+        # Building the man, html, ... targets is not sufficient because than the
+        # install is still not done.
+    endif()
 endif()
index 09343ebc5c964ed1022b955e5e62c39e99139688..326805a163df244547184e715a4f0e03ff61b9d0 100644 (file)
@@ -124,7 +124,7 @@ if (${FFTW}_FOUND)
     endif()
   endforeach()
   #Verify FFTW is compiled with fPIC (necessary for shared libraries)
-  if (CMAKE_OBJDUMP AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND BUILD_SHARED_LIBS)
+  if (CMAKE_OBJDUMP AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND BUILD_SHARED_LIBS AND NOT CYGWIN)
       execute_process(COMMAND ${CMAKE_OBJDUMP} --reloc ${${FFTW}_LIBRARY} OUTPUT_VARIABLE ${FFTW}_OBJDUMP)
       if (${${FFTW}_OBJDUMP} MATCHES "R_X86_64" #Should always be true for static libraries. Checks that objdump works properly and that the library isn't dynamic
               AND NOT ${${FFTW}_OBJDUMP} MATCHES "R_X86_64_PLT32")
index 3c8499136c44b9f8488bfe71322e5edbcf297732..3981d59406ede7aaae4181e6e526d7c81af3281e 100644 (file)
@@ -39,8 +39,8 @@
 
 include(FindPackageHandleStandardArgs)
 
-if(Pandoc_FIND_QUIETLY OR DEFINED PANDOC_EXECUTABLE)
-  set(PANDOC_FIND_QUIETLY TRUE)
+if(DEFINED PANDOC_EXECUTABLE)
+  set(Pandoc_FIND_QUIETLY TRUE)
 endif()
 
 find_program(PANDOC_EXECUTABLE
diff --git a/cmake/TestFloatFormat.c b/cmake/TestFloatFormat.c
deleted file mode 100644 (file)
index d0676d5..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-int
-main()
-{
-  /* Check that a double is 8 bytes - compilation dies if it isnt */
-  extern char xyz [sizeof(double) == 8 ? 1 : -1];
-  int i;
-  double d;
-
-  double abc [10] = {
-    /* Zero-terminated strings encoded as floating-point numbers */
-    /* "GROMACSX" in ascii    */
-    (double)  3.80279098314984902657e+35 , (double) 0.0,
-    /* "GROMACSX" in ebcdic   */
-    (double) -1.37384666579378297437e+38 , (double) 0.0,
-    /* "D__float" (vax)       */
-    (double)  3.53802595280598432000e+18 , (double) 0.0,
-    /* "IBMHEXFP" s390/ascii  */
-    (double)  1.77977764695171661377e+10 , (double) 0.0,
-    /* "IBMHEXFP" s390/ebcdic */
-    (double) -5.22995989424860458374e+10 , (double) 0.0,
-  };
-
-  /* Make sure some compilers do not optimize away the entire structure
-   * with floating-point data by using it to produce a return value.
-   */
-  for(i=0,d=0;i<10;i++)
-  {
-    d+=abc[i];
-  }
-
-  return (d==12345.0);
-}
diff --git a/cmake/TestFloatFormat.cpp b/cmake/TestFloatFormat.cpp
new file mode 100644 (file)
index 0000000..ea661dc
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include <stdio.h>
+
+volatile const double abc [10] = {
+    /* Zero-terminated strings encoded as floating-point numbers */
+    /* "GROMACSX" in ascii    */
+    (double)  3.80279098314984902657e+35, (double) 0.0,
+    /* "GROMACSX" in ebcdic   */
+    (double) -1.37384666579378297437e+38, (double) 0.0,
+    /* "D__float" (vax)       */
+    (double)  3.53802595280598432000e+18, (double) 0.0,
+    /* "IBMHEXFP" s390/ascii  */
+    (double)  1.77977764695171661377e+10, (double) 0.0,
+    /* "IBMHEXFP" s390/ebcdic */
+    (double) -5.22995989424860458374e+10, (double) 0.0,
+};
+
+int
+main()
+{
+    /* Check that a double is 8 bytes - compilation dies if it isnt */
+    extern char xyz [sizeof(double) == 8 ? 1 : -1];
+    int         i;
+    double      d;
+
+    /* Make sure some compilers do not optimize away the entire structure
+     * with floating-point data by using it to produce a return value.
+     */
+    for (i = 0, d = 0; i < 10; i++)
+    {
+        d += abc[i];
+    }
+    return (d == 12345.0);
+}
index e20c49d8c4f8a37946f69345311a3437f40ad945..91f6d453035175870fbfe08d2e7f6f7621ff0943 100644 (file)
@@ -50,7 +50,7 @@ MACRO(GMX_TEST_FLOAT_FORMAT FP_IEEE754 FP_BIG_ENDIAN_BYTE FP_BIG_ENDIAN_WORD)
         MESSAGE(STATUS "Checking floating point format")
 
         TRY_COMPILE(HAVE_${FP_IEEE754} "${CMAKE_BINARY_DIR}"    
-                    "${CMAKE_SOURCE_DIR}/cmake/TestFloatFormat.c"
+                    "${CMAKE_SOURCE_DIR}/cmake/TestFloatFormat.cpp"
                     COPY_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestFloatFormat.bin")  
 
         if(HAVE_${FP_IEEE754})
index 9b3173a2c99d980d7d694db7591dcb662bcaea7c..4546bfcd7cd03524d01d286ec2d242f642abdda1 100644 (file)
@@ -47,7 +47,7 @@ function(GMX_TEST_LIBXML2 VARIABLE)
     if(LIBXML2_FOUND)
         gmx_check_if_changed(_do_libxml2_recompile LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)
         if(_do_libxml2_recompile)
-            unset(LIBXML2_COMPILES_OK CACHE)
+            unset(LIBXML2_LINKS_OK CACHE)
         endif()
         check_library_exists("${LIBXML2_LIBRARIES}" "xmlTextWriterEndAttribute" "" LIBXML2_LINKS_OK)
         set(${VARIABLE} ${LIBXML2_LINKS_OK} PARENT_SCOPE)
index 44bdd202cba78574cf1612802236fc556405a2ff..f99a43f6de8303caa41c2f5da0f4b108cdceedc9 100644 (file)
@@ -231,12 +231,12 @@ elseif(${GMX_SIMD} STREQUAL "AVX2_256")
 
     gmx_find_cflag_for_source(CFLAGS_AVX2 "C compiler AVX2 flag"
                               "#include<immintrin.h>
-                              int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}"
+                              int main(){__m256i x=_mm256_set1_epi32(5);x=_mm256_add_epi32(x,x);return _mm256_movemask_epi8(x);}"
                               SIMD_C_FLAGS
                               "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
     gmx_find_cxxflag_for_source(CXXFLAGS_AVX2 "C++ compiler AVX2 flag"
                                 "#include<immintrin.h>
-                                int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}"
+                                int main(){__m256i x=_mm256_set1_epi32(5);x=_mm256_add_epi32(x,x);return _mm256_movemask_epi8(x);}"
                                 SIMD_CXX_FLAGS
                                 "-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
 
index 549b5766d43e6d2e3e9dceb59238e1b26a19bad5..b553c405899e650810ca23da118735b0d24a9bd4 100644 (file)
@@ -91,8 +91,8 @@ externalproject_get_property(${EXTERNAL_FFTW_BUILD_TARGET} INSTALL_DIR)
 string(TOUPPER "${FFTW}" UPPERFFTW)
 string(TOLOWER "${FFTW}" LOWERFFTW)
 string(REGEX REPLACE "fftw" "fftw3" FFTW_LIBNAME ${LOWERFFTW})
-set(${UPPERFFTW}_LIBRARIES ${CMAKE_BINARY_PREFIX}/${INSTALL_DIR}/lib/lib${FFTW_LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
-set(${UPPERFFTW}_INCLUDE_DIRS ${CMAKE_BINARY_PREFIX}/${INSTALL_DIR}/include PARENT_SCOPE)
+set(${UPPERFFTW}_LIBRARIES ${INSTALL_DIR}/lib/lib${FFTW_LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
+set(${UPPERFFTW}_INCLUDE_DIRS ${INSTALL_DIR}/include PARENT_SCOPE)
 set(${UPPERFFTW}_FOUND TRUE PARENT_SCOPE)
 set(${UPPERFFTW}_HAVE_SIMD TRUE PARENT_SCOPE)
 
diff --git a/src/external/Random123-1.08/README b/src/external/Random123-1.08/README
new file mode 100644 (file)
index 0000000..da3a057
--- /dev/null
@@ -0,0 +1,4 @@
+This folder contains the threefry algorithm from Random123.
+threefry.h: is unmodified
+array.h: the sections for SSE and cplusplus are removed
+compilerfeatures.h: our own file
index ab85392d8d6868ff631a8ce74737db7d37aee84f..e52d198eae3286615d6c6c0b4eeea0aa213c0746 100644 (file)
@@ -32,245 +32,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef _r123array_dot_h__
 #define _r123array_dot_h__
 #include "features/compilerfeatures.h"
-#include "features/sse.h"
 
-#ifndef __cplusplus
 #define CXXMETHODS(_N, W, T)
 #define CXXOVERLOADS(_N, W, T)
-#else
-
-#include <stddef.h>
-#include <algorithm>
-#include <stdexcept>
-#include <iterator>
-#include <limits>
-#include <iostream>
-
-/** @defgroup arrayNxW The r123arrayNxW classes 
-
-    Each of the r123arrayNxW is a fixed size array of N W-bit unsigned integers.
-    It is functionally equivalent to the C++0x std::array<N, uintW_t>,
-    but does not require C++0x features or libraries.
-
-    In addition to meeting most of the requirements of a Container,
-    it also has a member function, incr(), which increments the zero-th
-    element and carrys overflows into higher indexed elements.  Thus,
-    by using incr(), sequences of up to 2^(N*W) distinct values
-    can be produced. 
-
-    If SSE is supported by the compiler, then the class
-    r123array1xm128i is also defined, in which the data member is an
-    array of one r123128i object.
-
-    @cond HIDDEN_FROM_DOXYGEN
-*/
-
-template <typename value_type>
-inline R123_CUDA_DEVICE value_type assemble_from_u32(uint32_t *p32){
-    value_type v=0;
-    for(size_t i=0; i<(3+sizeof(value_type))/4; ++i)
-        v |= ((value_type)(*p32++)) << (32*i);
-    return v;
-}
-
-// Work-alike methods and typedefs modeled on std::array:
-#define CXXMETHODS(_N, W, T)                                            \
-    typedef T value_type;                                               \
-    typedef T* iterator;                                                \
-    typedef const T* const_iterator;                                    \
-    typedef value_type& reference;                                      \
-    typedef const value_type& const_reference;                          \
-    typedef size_t size_type;                                           \
-    typedef ptrdiff_t difference_type;                                  \
-    typedef T* pointer;                                                 \
-    typedef const T* const_pointer;                                     \
-    typedef std::reverse_iterator<iterator> reverse_iterator;           \
-    typedef std::reverse_iterator<const_iterator> const_reverse_iterator; \
-    /* Boost.array has static_size.  C++11 specializes tuple_size */    \
-    enum {static_size = _N};                                            \
-    R123_CUDA_DEVICE reference operator[](size_type i){return v[i];}                     \
-    R123_CUDA_DEVICE const_reference operator[](size_type i) const {return v[i];}        \
-    R123_CUDA_DEVICE reference at(size_type i){ if(i >=  _N) R123_THROW(std::out_of_range("array index out of range")); return (*this)[i]; } \
-    R123_CUDA_DEVICE const_reference at(size_type i) const { if(i >=  _N) R123_THROW(std::out_of_range("array index out of range")); return (*this)[i]; } \
-    R123_CUDA_DEVICE size_type size() const { return  _N; }                              \
-    R123_CUDA_DEVICE size_type max_size() const { return _N; }                           \
-    R123_CUDA_DEVICE bool empty() const { return _N==0; };                               \
-    R123_CUDA_DEVICE iterator begin() { return &v[0]; }                                  \
-    R123_CUDA_DEVICE iterator end() { return &v[_N]; }                                   \
-    R123_CUDA_DEVICE const_iterator begin() const { return &v[0]; }                      \
-    R123_CUDA_DEVICE const_iterator end() const { return &v[_N]; }                       \
-    R123_CUDA_DEVICE const_iterator cbegin() const { return &v[0]; }                     \
-    R123_CUDA_DEVICE const_iterator cend() const { return &v[_N]; }                      \
-    R123_CUDA_DEVICE reverse_iterator rbegin(){ return reverse_iterator(end()); }        \
-    R123_CUDA_DEVICE const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); } \
-    R123_CUDA_DEVICE reverse_iterator rend(){ return reverse_iterator(begin()); }        \
-    R123_CUDA_DEVICE const_reverse_iterator rend() const{ return const_reverse_iterator(begin()); } \
-    R123_CUDA_DEVICE const_reverse_iterator crbegin() const{ return const_reverse_iterator(cend()); } \
-    R123_CUDA_DEVICE const_reverse_iterator crend() const{ return const_reverse_iterator(cbegin()); } \
-    R123_CUDA_DEVICE pointer data(){ return &v[0]; }                                     \
-    R123_CUDA_DEVICE const_pointer data() const{ return &v[0]; }                         \
-    R123_CUDA_DEVICE reference front(){ return v[0]; }                                   \
-    R123_CUDA_DEVICE const_reference front() const{ return v[0]; }                       \
-    R123_CUDA_DEVICE reference back(){ return v[_N-1]; }                                 \
-    R123_CUDA_DEVICE const_reference back() const{ return v[_N-1]; }                     \
-    R123_CUDA_DEVICE bool operator==(const r123array##_N##x##W& rhs) const{ \
-       /* CUDA3 does not have std::equal */ \
-       for (size_t i = 0; i < _N; ++i) \
-           if (v[i] != rhs.v[i]) return false; \
-       return true; \
-    } \
-    R123_CUDA_DEVICE bool operator!=(const r123array##_N##x##W& rhs) const{ return !(*this == rhs); } \
-    /* CUDA3 does not have std::fill_n */ \
-    R123_CUDA_DEVICE void fill(const value_type& val){ for (size_t i = 0; i < _N; ++i) v[i] = val; } \
-    R123_CUDA_DEVICE void swap(r123array##_N##x##W& rhs){ \
-       /* CUDA3 does not have std::swap_ranges */ \
-       for (size_t i = 0; i < _N; ++i) { \
-           T tmp = v[i]; \
-           v[i] = rhs.v[i]; \
-           rhs.v[i] = tmp; \
-       } \
-    } \
-    R123_CUDA_DEVICE r123array##_N##x##W& incr(R123_ULONG_LONG n=1){                         \
-        /* This test is tricky because we're trying to avoid spurious   \
-           complaints about illegal shifts, yet still be compile-time   \
-           evaulated. */                                                \
-        if(sizeof(T)<sizeof(n) && n>>((sizeof(T)<sizeof(n))?8*sizeof(T):0) ) \
-            return incr_carefully(n);                                   \
-        if(n==1){                                                       \
-            ++v[0];                                                     \
-            if(_N==1 || R123_BUILTIN_EXPECT(!!v[0], 1)) return *this;   \
-        }else{                                                          \
-            v[0] += n;                                                  \
-            if(_N==1 || R123_BUILTIN_EXPECT(n<=v[0], 1)) return *this;  \
-        }                                                               \
-        /* We expect that the N==?? tests will be                       \
-           constant-folded/optimized away by the compiler, so only the  \
-           overflow tests (!!v[i]) remain to be done at runtime.  For  \
-           small values of N, it would be better to do this as an       \
-           uncondtional sequence of adc.  An experiment/optimization    \
-           for another day...                                           \
-           N.B.  The weird subscripting: v[_N>3?3:0] is to silence      \
-           a spurious error from icpc                                   \
-           */                                                           \
-        ++v[_N>1?1:0];                                                  \
-        if(_N==2 || R123_BUILTIN_EXPECT(!!v[_N>1?1:0], 1)) return *this; \
-        ++v[_N>2?2:0];                                                  \
-        if(_N==3 || R123_BUILTIN_EXPECT(!!v[_N>2?2:0], 1)) return *this;  \
-        ++v[_N>3?3:0];                                                  \
-        for(size_t i=4; i<_N; ++i){                                     \
-            if( R123_BUILTIN_EXPECT(!!v[i-1], 1) ) return *this;        \
-            ++v[i];                                                     \
-        }                                                               \
-        return *this;                                                   \
-    }                                                                   \
-    /* seed(SeedSeq) would be a constructor if having a constructor */  \
-    /* didn't cause headaches with defaults */                          \
-    template <typename SeedSeq>                                         \
-    R123_CUDA_DEVICE static r123array##_N##x##W seed(SeedSeq &ss){      \
-        r123array##_N##x##W ret;                                        \
-        const size_t Ngen = _N*((3+sizeof(value_type))/4);              \
-        uint32_t u32[Ngen];                                             \
-        uint32_t *p32 = &u32[0];                                        \
-        ss.generate(&u32[0], &u32[Ngen]);                               \
-        for(size_t i=0; i<_N; ++i){                                     \
-            ret.v[i] = assemble_from_u32<value_type>(p32);              \
-            p32 += (3+sizeof(value_type))/4;                            \
-        }                                                               \
-        return ret;                                                     \
-    }                                                                   \
-protected:                                                              \
-    R123_CUDA_DEVICE r123array##_N##x##W& incr_carefully(R123_ULONG_LONG n){ \
-        /* n may be greater than the maximum value of a single value_type */ \
-        value_type vtn;                                                 \
-        vtn = n;                                                        \
-        v[0] += n;                                                      \
-        const unsigned rshift = 8* ((sizeof(n)>sizeof(value_type))? sizeof(value_type) : 0); \
-        for(size_t i=1; i<_N; ++i){                                     \
-            if(rshift){                                                 \
-                n >>= rshift;                                           \
-            }else{                                                      \
-                n=0;                                                    \
-            }                                                           \
-            if( v[i-1] < vtn )                                          \
-                ++n;                                                    \
-            if( n==0 ) break;                                           \
-            vtn = n;                                                    \
-            v[i] += n;                                                  \
-        }                                                               \
-        return *this;                                                   \
-    }                                                                   \
-    
-                                                                        
-// There are several tricky considerations for the insertion and extraction
-// operators:
-// - we would like to be able to print r123array16x8 as a sequence of 16 integers,
-//   not as 16 bytes.
-// - we would like to be able to print r123array1xm128i.
-// - we do not want an int conversion operator in r123m128i because it causes
-//   lots of ambiguity problems with automatic promotions.
-// Solution: r123arrayinsertable and r123arrayextractable
-
-template<typename T>
-struct r123arrayinsertable{
-    const T& v;
-    r123arrayinsertable(const T& t_) : v(t_) {} 
-    friend std::ostream& operator<<(std::ostream& os, const r123arrayinsertable<T>& t){
-        return os << t.v;
-    }
-};
-
-template<>
-struct r123arrayinsertable<uint8_t>{
-    const uint8_t& v;
-    r123arrayinsertable(const uint8_t& t_) : v(t_) {} 
-    friend std::ostream& operator<<(std::ostream& os, const r123arrayinsertable<uint8_t>& t){
-        return os << (int)t.v;
-    }
-};
-
-template<typename T>
-struct r123arrayextractable{
-    T& v;
-    r123arrayextractable(T& t_) : v(t_) {}
-    friend std::istream& operator>>(std::istream& is, r123arrayextractable<T>& t){
-        return is >> t.v;
-    }
-};
-
-template<>
-struct r123arrayextractable<uint8_t>{
-    uint8_t& v;
-    r123arrayextractable(uint8_t& t_) : v(t_) {} 
-    friend std::istream& operator>>(std::istream& is, r123arrayextractable<uint8_t>& t){
-        int i;
-        is >>  i;
-        t.v = i;
-        return is;
-    }
-};
-
-#define CXXOVERLOADS(_N, W, T)                                          \
-                                                                        \
-inline std::ostream& operator<<(std::ostream& os, const r123array##_N##x##W& a){   \
-    os << r123arrayinsertable<T>(a.v[0]);                                  \
-    for(size_t i=1; i<_N; ++i)                                          \
-        os << " " << r123arrayinsertable<T>(a.v[i]);                       \
-    return os;                                                          \
-}                                                                       \
-                                                                        \
-inline std::istream& operator>>(std::istream& is, r123array##_N##x##W& a){         \
-    for(size_t i=0; i<_N; ++i){                                         \
-        r123arrayextractable<T> x(a.v[i]);                                 \
-        is >> x;                                                        \
-    }                                                                   \
-    return is;                                                          \
-}                                                                       \
-                                                                        \
-namespace r123{                                                        \
- typedef r123array##_N##x##W Array##_N##x##W;                          \
-}
-                                                                        
-#endif /* __cplusplus */
 
 /* _r123array_tpl expands to a declaration of struct r123arrayNxW.  
 
@@ -308,10 +72,6 @@ _r123array_tpl(4, 64, uint64_t)  /* r123array4x64 */
 
 _r123array_tpl(16, 8, uint8_t)  /* r123array16x8 for ARSsw, AESsw */
 
-#if R123_USE_SSE
-_r123array_tpl(1, m128i, r123m128i) /* r123array1x128i for ARSni, AESni */
-#endif
-
 /* In C++, it's natural to use sizeof(a::value_type), but in C it's
    pretty convoluted to figure out the width of the value_type of an
    r123arrayNxW:
diff --git a/src/external/Random123-1.08/include/Random123/features/clangfeatures.h b/src/external/Random123-1.08/include/Random123/features/clangfeatures.h
deleted file mode 100644 (file)
index 908aee8..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __clangfeatures_dot_hpp
-#define __clangfeatures_dot_hpp
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H ((defined(__x86_64__)||defined(__i386__)))
-#endif
-
-#ifndef R123_USE_CXX11_UNRESTRICTED_UNIONS
-#define R123_USE_CXX11_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
-#endif
-
-#ifndef R123_USE_CXX11_STATIC_ASSERT
-#define R123_USE_CXX11_STATIC_ASSERT __has_feature(cxx_static_assert)
-#endif
-
-#ifndef R123_USE_CXX11_CONSTEXPR
-#define R123_USE_CXX11_CONSTEXPR __has_feature(cxx_constexpr)
-#endif
-
-#ifndef R123_USE_CXX11_EXPLICIT_CONVERSIONS
-#define R123_USE_CXX11_EXPLICIT_CONVERSIONS __has_feature(cxx_explicit_conversions)
-#endif
-
-// With clang-3.0, the apparently simpler:
-//  #define R123_USE_CXX11_RANDOM __has_include(<random>)
-// dumps core.
-#ifndef R123_USE_CXX11_RANDOM
-#if __cplusplus>=201103L && __has_include(<random>)
-#define R123_USE_CXX11_RANDOM 1
-#else
-#define R123_USE_CXX11_RANDOM 0
-#endif
-#endif
-
-#ifndef R123_USE_CXX11_TYPE_TRAITS
-#if __cplusplus>=201103L && __has_include(<type_traits>)
-#define R123_USE_CXX11_TYPE_TRAITS 1
-#else
-#define R123_USE_CXX11_TYPE_TRAITS 0
-#endif
-#endif
-
-#include "gccfeatures.h"
-
-#endif
index 4039790823a7e42868e19dc76828ef3bf1461325..f5f110209dae425979d17c947d46ed791fc77742 100644 (file)
 /*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**
-
-@page porting Preprocessor symbols for porting Random123 to different platforms.
-
-The Random123 library is portable across C, C++, CUDA, OpenCL environments,
-and multiple operating systems (Linux, Windows 7, Mac OS X, FreeBSD, Solaris).
-This level of portability requires the abstraction of some features
-and idioms that are either not standardized (e.g., asm statments), or for which 
-different vendors have their own standards (e.g., SSE intrinsics) or for
-which vendors simply refuse to conform to well-established standards (e.g., <inttypes.h>).
-
-Random123/features/compilerfeatures.h
-conditionally includes a compiler-or-OS-specific Random123/featires/XXXfeatures.h file which
-defines appropriate values for the preprocessor symbols which can be used with
-a specific compiler or OS.  Those symbols will then
-be used by other header files and source files in the Random123
-library (and may be used by applications) to control what actually
-gets presented to the compiler.
-
-Most of the symbols are boolean valued.  In general, they will
-\b always be defined with value either 1 or 0, so do
-\b NOT use \#ifdef.  Use \#if R123_USE_SOMETHING instead.
-
-Library users can override any value by defining the pp-symbol with a compiler option,
-e.g.,
-
-    cc -DR123_USE_MULHILO64_C99 
-
-will use a strictly c99 version of the full-width 64x64->128-bit multiplication
-function, even if it would be disabled by default.
-
-All boolean-valued pre-processor symbols in Random123/features/compilerfeatures.h start with the prefix R123_USE_
-@verbatim
-         AES_NI
-         AES_OPENSSL
-         SSE4_2
-         SSE4_1
-         SSE
-
-         STD_RANDOM
-
-         GNU_UINT128
-         ASM_GNU
-         ASM_MSASM
-
-         CPUID_MSVC
-
-         CXX11_RANDOM
-         CXX11_TYPE_TRAITS
-         CXX11_STATIC_ASSERT
-         CXX11_CONSTEXPR
-         CXX11_UNRESTRICTED_UNIONS
-         CXX11_EXPLICIT_CONVERSIONS
-         CXX11_LONG_LONG
-         CXX11 
-   
-         X86INTRIN_H
-         IA32INTRIN_H
-         XMMINTRIN_H
-         EMMINTRIN_H
-         SMMINTRIN_H
-         WMMINTRIN_H
-         INTRIN_H
-
-         MULHILO32_ASM
-         MULHILO64_ASM
-         MULHILO64_MSVC_INTRIN
-         MULHILO64_CUDA_INTRIN
-         MULHILO64_OPENCL_INTRIN
-         MULHILO64_C99
-
-         U01_DOUBLE
-        
-@endverbatim
-Most have obvious meanings.  Some non-obvious ones:
-
-AES_NI and AES_OPENSSL are not mutually exclusive.  You can have one,
-both or neither.
-
-GNU_UINT128 says that it's safe to use __uint128_t, but it
-does not require its use.  In particular, it should be
-used in mulhilo<uint64_t> only if MULHILO64_ASM is unset.
-
-If the XXXINTRIN_H macros are true, then one should
-@code
-#include <xxxintrin.h>
-@endcode
-to gain accesss to compiler intrinsics.
-
-The CXX11_SOME_FEATURE macros allow the code to use specific
-features of the C++11 language and library.  The catchall
-In the absence of a specific CXX11_SOME_FEATURE, the feature
-is controlled by the catch-all R123_USE_CXX11 macro.
-
-U01_DOUBLE defaults on, and can be turned off (set to 0)
-if one does not want the utility functions that convert to double
-(i.e. u01_*_53()), e.g. on OpenCL without the cl_khr_fp64 extension.
-
-There are a number of invariants that are always true.  Application code may
-choose to rely on these:
-
-<ul>
-<li>ASM_GNU and ASM_MASM are mutually exclusive
-<li>The "higher" SSE values imply the lower ones.
-</ul>
-
-There are also non-boolean valued symbols:
-
-<ul>
-<li>R123_STATIC_INLINE -
-  According to both C99 and GNU99, the 'static inline' declaration allows
-  the compiler to not emit code if the function is not used.  
-  Note that the semantics of 'inline', 'static' and 'extern' in
-  gcc have changed over time and are subject to modification by
-  command line options, e.g., -std=gnu89, -fgnu-inline.
-  Nevertheless, it appears that the meaning of 'static inline' 
-  has not changed over time and (with a little luck) the use of 'static inline'
-  here will be portable between versions of gcc and to other C99
-  compilers.
-  See: http://gcc.gnu.org/onlinedocs/gcc/Inline.html
-       http://www.greenend.org.uk/rjk/2003/03/inline.html
-
-<li>R123_FORCE_INLINE(decl) -
-  which expands to 'decl', adorned with the compiler-specific
-  embellishments to strongly encourage that the declared function be
-  inlined.  If there is no such compiler-specific magic, it should
-  expand to decl, unadorned.
-   
-<li>R123_CUDA_DEVICE - which expands to __device__ (or something else with
-  sufficiently similar semantics) when CUDA is in use, and expands
-  to nothing in other cases.
-
-<li>R123_ASSERT(x) - which expands to assert(x), or maybe to nothing at
-  all if we're in an environment so feature-poor that you can't even
-  call assert (I'm looking at you, CUDA and OpenCL), or even include
-  assert.h safely (OpenCL).
-
-<li>R123_STATIC_ASSERT(expr,msg) - which expands to
-  static_assert(expr,msg), or to an expression that
-  will raise a compile-time exception if expr is not true.
-
-<li>R123_ULONG_LONG - which expands to a declaration of the longest available
-  unsigned integer.
-
-<li>R123_64BIT(x) - expands to something equivalent to
-  UINT64_C(x) from <stdint.h>, even in environments where <stdint.h>
-  is not available, e.g., MSVC and OpenCL.
-
-<li>R123_BUILTIN_EXPECT(expr,likely_value) - expands to something with
-  the semantics of gcc's __builtin_expect(expr,likely_value).  If
-  the environment has nothing like __builtin_expect, it should expand
-  to just expr.
-</ul>
-
-
-\cond HIDDEN_FROM_DOXYGEN
-*/
-
-/* 
-N.B.  When something is added to the list of features, it should be
-added to each of the *features.h files, AND to examples/ut_features.cpp.
-*/
-
-/* N.B.  most other compilers (icc, nvcc, open64, llvm) will also define __GNUC__, so order matters. */
-#if defined(__OPENCL_VERSION__) && __OPENCL_VERSION__ > 0
-#include "openclfeatures.h"
-#elif defined(__CUDACC__)
-#include "nvccfeatures.h"
-#elif defined(__ICC)
-#include "iccfeatures.h"
-#elif defined(__xlC__)
-#include "xlcfeatures.h"
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#include "sunprofeatures.h"
-#elif defined(__OPEN64__)
-#include "open64features.h"
-#elif defined(__clang__)
-#include "clangfeatures.h"
-#elif defined(__GNUC__)
-#include "gccfeatures.h"
-#elif defined(__PGI)
-#include "pgccfeatures.h"
-#elif defined(_MSC_FULL_VER)
-#include "msvcfeatures.h"
-#else
-#error "Can't identify compiler.  You'll need to add a new xxfeatures.hpp"
-{ /* maybe an unbalanced brace will terminate the compilation */
-#endif
-
-#ifndef R123_USE_CXX11
-#define R123_USE_CXX11 (__cplusplus >= 201103L)
-#endif
-
-#ifndef R123_USE_CXX11_UNRESTRICTED_UNIONS
-#define R123_USE_CXX11_UNRESTRICTED_UNIONS R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_STATIC_ASSERT
-#define R123_USE_CXX11_STATIC_ASSERT R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_CONSTEXPR
-#define R123_USE_CXX11_CONSTEXPR R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_EXPLICIT_CONVERSIONS
-#define R123_USE_CXX11_EXPLICIT_CONVERSIONS R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_RANDOM
-#define R123_USE_CXX11_RANDOM R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_TYPE_TRAITS
-#define R123_USE_CXX11_TYPE_TRAITS R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_CXX11_LONG_LONG
-#define R123_USE_CXX11_LONG_LONG R123_USE_CXX11
-#endif
-
-#ifndef R123_USE_MULHILO64_C99
-#define R123_USE_MULHILO64_C99 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MULHI_INTRIN
-#define R123_USE_MULHILO64_MULHI_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO32_MULHI_INTRIN
-#define R123_USE_MULHILO32_MULHI_INTRIN 0
-#endif
-
-#ifndef R123_STATIC_ASSERT
-#if R123_USE_CXX11_STATIC_ASSERT
-#define R123_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
-#else
-    /* if msg always_looked_like_this, we could paste it into the name.  Worth it? */
-#define R123_STATIC_ASSERT(expr, msg) typedef char static_assertion[(!!(expr))*2-1]
-#endif
-#endif
-
-#ifndef R123_CONSTEXPR
-#if R123_USE_CXX11_CONSTEXPR
-#define R123_CONSTEXPR constexpr
-#else
-#define R123_CONSTEXPR
-#endif
-#endif
-
-#ifndef R123_USE_PHILOX_64BIT
-#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 || R123_USE_MULHILO64_MULHI_INTRIN)
-#endif
-
-#ifndef R123_ULONG_LONG
-#if defined(__cplusplus) && !R123_USE_CXX11_LONG_LONG
-/* C++98 doesn't have long long.  It doesn't have uint64_t either, but
-   we will have typedef'ed uint64_t to something in the xxxfeatures.h.
-   With luck, it won't elicit complaints from -pedantic.  Cross your
-   fingers... */
-#define R123_ULONG_LONG uint64_t
-#else
-#define R123_ULONG_LONG unsigned long long
-#endif
-#endif
-
-/* UINT64_C should have been #defined by XXXfeatures.h, either by
-   #include <stdint.h> or through compiler-dependent hacks */
-#ifndef R123_64BIT
-#define R123_64BIT(x) UINT64_C(x)
-#endif
-
-#ifndef R123_THROW
-#define R123_THROW(x)    throw (x)
-#endif
-
-/*
- * Windows.h (and perhaps other "well-meaning" code define min and
- * max, so there's a high chance that our definition of min, max
- * methods or use of std::numeric_limits min and max will cause
- * complaints in any program that happened to include Windows.h or
- * suchlike first.  We use the null macro below in our own header
- * files definition or use of min, max to defensively preclude
- * this problem.  It may not be enough; one might need to #define
- * NOMINMAX before including Windows.h or compile with -DNOMINMAX.
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
-#define R123_NO_MACRO_SUBST
 
-/** \endcond */
+#include <assert.h>
+
+#include "gromacs/utility/basedefinitions.h"
+
+/* We only use the C interface of ThreeFry and r123array2x64. This file is a
+   replacment for the original from the Random123 distribution. It sets all
+   defines (they all start with R123_), which are used by those parts of
+   Random123 being used. Instead of determining values based on the Compiler
+   (Name, Version, ..) we set values based on our assumptions in Gromacs, and
+   the defines used in Gromacs */
+
+/* Random123 isn't used from Cuda thus this can always be empty */
+#define R123_CUDA_DEVICE
+/* For "inline" use the Gromacs own gmx_inline */
+#define R123_STATIC_INLINE static gmx_inline
+/* force_inline isn't used in Gromacs - if it matters for a compiler it probably
+   not only matters here and should be defined in basedefinitions.h */
+#define R123_FORCE_INLINE(decl) decl
+/* We assume in Gromacs that assert is available outside of Cuda */
+#define R123_ASSERT assert
+/* Not used  (only used by C++ interface of ThreeFry) */
+#define R123_STATIC_ASSERT(expr, msg)
diff --git a/src/external/Random123-1.08/include/Random123/features/gccfeatures.h b/src/external/Random123-1.08/include/Random123/features/gccfeatures.h
deleted file mode 100644 (file)
index d6bb060..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __gccfeatures_dot_hpp
-#define __gccfeatures_dot_hpp
-
-#define R123_GNUC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-
-#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__)
-#  error "This code has only been tested on x86 and powerpc platforms."
-#include <including_a_nonexistent_file_will_stop_some_compilers_from_continuing_with_a_hopeless_task>
-{ /* maybe an unbalanced brace will terminate the compilation */
- /* Feel free to try the Random123 library on other architectures by changing
- the conditions that reach this error, but you should consider it a
- porting exercise and expect to encounter bugs and deficiencies.
- Please let the authors know of any successes (or failures). */
-#endif
-
-#ifdef __powerpc__
-#include <ppu_intrinsics.h>
-#endif
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static __inline__
-#endif
-
-#ifndef R123_FORCE_INLINE
-#if R123_GNUC_VERSION >= 40000
-#define R123_FORCE_INLINE(decl) decl __attribute__((always_inline))
-#else
-#define R123_FORCE_INLINE(decl) decl
-#endif
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) __builtin_expect(expr,likely)
-#endif
-
-/* According to the C++0x standard, we should be able to test the numeric
-   value of __cplusplus == 199701L for C++98, __cplusplus == 201103L for C++0x
-   But gcc has had an open bug  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
-   since early 2001, which was finally fixed in 4.7 (early 2012).  For
-   earlier versions, the only way  to detect whether --std=c++0x was requested
-   on the command line is to look at the __GCC_EXPERIMENTAL_CXX0X__ pp-symbol.
-*/
-#define GNU_CXX11 (__cplusplus>=201103L || (R123_GNUC_VERSION<40700 && defined(__GCC_EXPERIMENTAL_CXX0X__) ))
-
-#ifndef R123_USE_CXX11_UNRESTRICTED_UNIONS
-#define R123_USE_CXX11_UNRESTRICTED_UNIONS ((R123_GNUC_VERSION >= 40600) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_CXX11_STATIC_ASSERT
-#define R123_USE_CXX11_STATIC_ASSERT ((R123_GNUC_VERSION >= 40300) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_CXX11_CONSTEXPR
-#define R123_USE_CXX11_CONSTEXPR ((R123_GNUC_VERSION >= 40600) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_CXX11_EXPLICIT_CONVERSIONS
-#define R123_USE_CXX11_EXPLICIT_CONVERSIONS ((R123_GNUC_VERSION >= 40500) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_CXX11_RANDOM
-#define R123_USE_CXX11_RANDOM ((R123_GNUC_VERSION>=40500) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_CXX11_TYPE_TRAITS
-#define R123_USE_CXX11_TYPE_TRAITS ((R123_GNUC_VERSION>=40400) && GNU_CXX11)
-#endif
-
-#ifndef R123_USE_AES_NI
-#ifdef __AES__
-#define R123_USE_AES_NI 1
-#else
-#define R123_USE_AES_NI 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE4_2
-#ifdef __SSE4_2__
-#define R123_USE_SSE4_2 1
-#else
-#define R123_USE_SSE4_2 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE4_1
-#ifdef __SSE4_1__
-#define R123_USE_SSE4_1 1
-#else
-#define R123_USE_SSE4_1 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE
-/* There's no point in trying to compile SSE code in Random123
-   unless SSE2 is available. */
-#ifdef __SSE2__
-#define R123_USE_SSE 1
-#else
-#define R123_USE_SSE 0
-#endif
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-/* There isn't really a good way to tell at compile time whether
-   openssl is available.  Without a pre-compilation configure-like
-   tool, it's less error-prone to guess that it isn't available.  Add
-   -DR123_USE_AES_OPENSSL=1 and any necessary LDFLAGS or LDLIBS to
-   play with openssl */
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#ifdef __x86_64__
-#define R123_USE_GNU_UINT128 1
-#else
-#define R123_USE_GNU_UINT128 0
-#endif
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU (defined(__x86_64__)||defined(__i386__))
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 0
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H ((defined(__x86_64__)||defined(__i386__)) && R123_GNUC_VERSION >= 40402)
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 0
-#endif
-
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-/* gcc -m64 on Solaris 10 defines __SSE2__ but doesn't have 
-   emmintrin.h in the include search path.  This is
-   so broken that I refuse to try to work around it.  If this
-   affects you, figure out where your emmintrin.h lives and
-   add an appropriate -I to your CPPFLAGS.  Or add -DR123_USE_SSE=0. */
-#define R123_USE_EMMINTRIN_H (R123_USE_SSE && (R123_GNUC_VERSION < 40402))
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H ((R123_USE_SSE4_1 || R123_USE_SSE4_2) && (R123_GNUC_VERSION < 40402))
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#define R123_USE_INTRIN_H 0
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MULHI_INTRIN
-#define R123_USE_MULHILO64_MULHI_INTRIN (defined(__powerpc64__))
-#endif
-
-#ifndef R123_MULHILO64_MULHI_INTRIN
-#define R123_MULHILO64_MULHI_INTRIN __mulhdu
-#endif
-
-#ifndef R123_USE_MULHILO32_MULHI_INTRIN
-#define R123_USE_MULHILO32_MULHI_INTRIN 0
-#endif
-
-#ifndef R123_MULHILO32_MULHI_INTRIN
-#define R123_MULHILO32_MULHI_INTRIN __mulhwu
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-/* If you add something, it must go in all the other XXfeatures.hpp
-   and in ../ut_features.cpp */
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/iccfeatures.h b/src/external/Random123-1.08/include/Random123/features/iccfeatures.h
deleted file mode 100644 (file)
index b64e5c2..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __icpcfeatures_dot_hpp
-#define __icpcfeatures_dot_hpp
-
-// icc relies on gcc libraries and other toolchain components.
-#define R123_GNUC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-
-#if !defined(__x86_64__) && !defined(__i386__)
-#  error "This code has only been tested on x86 platforms."
-{ // maybe an unbalanced brace will terminate the compilation
-// You are invited to try Easy123 on other architectures, by changing
-// the conditions that reach this error, but you should consider it a
-// porting exercise and expect to encounter bugs and deficiencies.
-// Please let the authors know of any successes (or failures).
-#endif
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static inline
-#endif
-
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) decl __attribute__((always_inline))
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) __builtin_expect(expr,likely)
-#endif
-
-// The basic idiom is:
-// #ifndef R123_SOMETHING
-// #if some condition
-// #define R123_SOMETHING 1
-// #else
-// #define R123_SOMETHING 0
-// #endif
-// #endif
-// This idiom allows an external user to override any decision
-// in this file with a command-line -DR123_SOMETHING=1 or -DR123_SOMETHINE=0
-
-// An alternative idiom is:
-// #ifndef R123_SOMETHING
-// #define R123_SOMETHING (some boolean expression)
-// #endif
-// where the boolean expression might contain previously-defined R123_SOMETHING_ELSE
-// pp-symbols.
-
-#ifndef R123_USE_SSE4_2
-#ifdef __SSE4_2__
-#define R123_USE_SSE4_2 1
-#else
-#define R123_USE_SSE4_2 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE4_1
-#ifdef __SSE4_1__
-#define R123_USE_SSE4_1 1
-#else
-#define R123_USE_SSE4_1 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE
-#ifdef __SSE2__
-#define R123_USE_SSE 1
-#else
-#define R123_USE_SSE 0
-#endif
-#endif
-
-#ifndef R123_USE_AES_NI
-// Unlike gcc, icc (version 12) does not pre-define an __AES__
-// pp-symbol when -maes or -xHost is on the command line.  This feels
-// like a defect in icc (it defines __SSE4_2__ in analogous
-// circumstances), but until Intel fixes it, we're better off erring
-// on the side of caution and not generating instructions that are
-// going to raise SIGILL when executed.  To get the AES-NI
-// instructions with icc, the caller must puts something like
-// -DR123_USE_AES_NI=1 or -D__AES__ on the command line.  FWIW, the
-// AES-NI Whitepaper by Gueron says that icc has supported AES-NI from
-// 11.1 onwards.
-//
-#define R123_USE_AES_NI ((__ICC>=1101) && defined(__AES__))
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-/* There isn't really a good way to tell at compile time whether
-   openssl is available.  Without a pre-compilation configure-like
-   tool, it's less error-prone to guess that it isn't available.  Add
-   -DR123_USE_AES_OPENSSL=1 and any necessary LDFLAGS or LDLIBS to
-   play with openssl */
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU 1
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 0
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H 0
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 1
-#endif
-
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-#define R123_USE_EMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#define R123_USE_INTRIN_H 0
-#endif
-
-#ifndef R123_USE_MULHILO16_ASM
-#define R123_USE_MULHILO16_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 1
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-// If you add something, it must go in all the other XXfeatures.hpp
-// and in ../ut_features.cpp
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/msvcfeatures.h b/src/external/Random123-1.08/include/Random123/features/msvcfeatures.h
deleted file mode 100644 (file)
index 9eb9520..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __msvcfeatures_dot_hpp
-#define __msvcfeatures_dot_hpp
-
-//#if _MSVC_FULL_VER <= 15
-//#error "We've only tested MSVC_FULL_VER==15."
-//#endif
-
-#if !defined(_M_IX86) && !defined(_M_X64)
-#  error "This code has only been tested on x86 platforms."
-{ // maybe an unbalanced brace will terminate the compilation
-// You are invited to try Random123 on other architectures, by changing
-// the conditions that reach this error, but you should consider it a
-// porting exercise and expect to encounter bugs and deficiencies.
-// Please let the authors know of any successes (or failures).
-#endif
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static __inline
-#endif
-
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) _forceinline decl
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) expr
-#endif
-
-// The basic idiom is:
-// #ifndef R123_SOMETHING
-// #if some condition
-// #define R123_SOMETHING 1
-// #else
-// #define R123_SOMETHING 0
-// #endif
-// #endif
-// This idiom allows an external user to override any decision
-// in this file with a command-line -DR123_SOMETHING=1 or -DR123_SOMETHINE=0
-
-// An alternative idiom is:
-// #ifndef R123_SOMETHING
-// #define R123_SOMETHING (some boolean expression)
-// #endif
-// where the boolean expression might contain previously-defined R123_SOMETHING_ELSE
-// pp-symbols.
-
-#ifndef R123_USE_AES_NI
-#if defined(_M_X64)
-#define R123_USE_AES_NI 1
-#else
-#define R123_USE_AES_NI 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE4_2
-#if defined(_M_X64)
-#define R123_USE_SSE4_2 1
-#else
-#define R123_USE_SSE4_2 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE4_1
-#if defined(_M_X64)
-#define R123_USE_SSE4_1 1
-#else
-#define R123_USE_SSE4_1 0
-#endif
-#endif
-
-#ifndef R123_USE_SSE
-#define R123_USE_SSE 1
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU 0
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 1
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H 0
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 0
-#endif
-
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-#define R123_USE_EMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#define R123_USE_INTRIN_H 1
-#endif
-
-#ifndef R123_USE_MULHILO16_ASM
-#define R123_USE_MULHILO16_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#if defined(_M_X64)
-#define R123_USE_MULHILO64_MSVC_INTRIN 1
-#else
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-#pragma warning(disable:4244)
-#pragma warning(disable:4996)
-
-// If you add something, it must go in all the other XXfeatures.hpp
-// and in ../ut_features.cpp
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/nvccfeatures.h b/src/external/Random123-1.08/include/Random123/features/nvccfeatures.h
deleted file mode 100644 (file)
index 711babf..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __r123_nvcc_features_dot_h__
-#define __r123_nvcc_features_dot_h__
-
-#if !defined(CUDART_VERSION)
-#error "why are we in nvccfeatures.h if CUDART_VERSION is not defined"
-#endif
-
-#if CUDART_VERSION < 4010
-#error "CUDA versions earlier than 4.1 produce incorrect results for some templated functions in namespaces.  Random123 isunsupported.  See comments in nvccfeatures.h"
-// This test was added in Random123-1.08 (August, 2013) because we
-// discovered that Ftype(maxTvalue<T>()) with Ftype=double and
-// T=uint64_t in examples/uniform.hpp produces -1 for CUDA4.0 and
-// earlier.  We can't be sure this bug doesn't also affect invocations
-// of other templated functions, e.g., essentially all of Random123.
-// Thus, we no longer trust CUDA versions earlier than 4.1 even though
-// we had previously tested and timed Random123 with CUDA 3.x and 4.0.
-// If you feel lucky or desperate, you can change #error to #warning, but
-// please take extra care to be sure that you are getting correct
-// results.
-#endif
-
-// nvcc falls through to gcc or msvc.  So first define
-// a couple of things and then include either gccfeatures.h
-// or msvcfeatures.h
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE __device__
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 1
-#endif
-
-#ifndef R123_ASSERT
-#define R123_ASSERT(x) if((x)) ; else asm("trap;")
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) expr
-#endif
-
-#ifndef R123_USE_AES_NI
-#define R123_USE_AES_NI 0
-#endif
-
-#ifndef R123_USE_SSE4_2
-#define R123_USE_SSE4_2 0
-#endif
-
-#ifndef R123_USE_SSE4_1
-#define R123_USE_SSE4_1 0
-#endif
-
-#ifndef R123_USE_SSE
-#define R123_USE_SSE 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_ULONG_LONG
-// uint64_t, which is what we'd get without this, is
-// not the same as unsigned long long
-#define R123_ULONG_LONG unsigned long long
-#endif
-
-#ifndef R123_THROW
-// No exceptions in CUDA, at least upto 4.0
-#define R123_THROW(x)    R123_ASSERT(0)
-#endif
-
-#if defined(__GNUC__)
-#include "gccfeatures.h"
-#elif defined(_MSC_FULL_VER)
-#include "msvcfeatures.h"
-#endif
-
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/open64features.h b/src/external/Random123-1.08/include/Random123/features/open64features.h
deleted file mode 100644 (file)
index 8da9f5f..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __open64features_dot_hpp
-#define __open64features_dot_hpp
-
-/* The gcc features are mostly right.  We just override a few and then include gccfeatures.h */
-
-/* Open64 4.2.3 and 4.2.4 accept the __uint128_t code without complaint
-   but produce incorrect code for 64-bit philox.  The MULHILO64_ASM
-   seems to work fine */
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 1
-#endif
-
-#include "gccfeatures.h"
-
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/openclfeatures.h b/src/external/Random123-1.08/include/Random123/features/openclfeatures.h
deleted file mode 100644 (file)
index af03d30..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __openclfeatures_dot_hpp
-#define __openclfeatures_dot_hpp
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE inline
-#endif
-
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) decl __attribute__((always_inline))
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#define R123_ASSERT(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) expr
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 1
-#endif
-
-#ifndef R123_USE_AES_NI
-#define R123_USE_AES_NI 0
-#endif
-
-// XXX ATI APP SDK 2.4 clBuildProgram SEGVs if one uses uint64_t instead of
-// ulong to mul_hi.  And gets lots of complaints from stdint.h
-// on some machines.
-// But these typedefs mean we cannot include stdint.h with
-// these headers?  Do we need R123_64T, R123_32T, R123_8T?
-typedef ulong uint64_t;
-typedef uint  uint32_t;
-typedef uchar uint8_t;
-#define UINT64_C(x) ((ulong)(x##UL))
-
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/pgccfeatures.h b/src/external/Random123-1.08/include/Random123/features/pgccfeatures.h
deleted file mode 100644 (file)
index 18ace13..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Copyright (c) 2013, Los Alamos National Security, LLC
-All rights reserved.
-
-Copyright 2013. Los Alamos National Security, LLC. This software was produced
-under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National
-Laboratory (LANL), which is operated by Los Alamos National Security, LLC for
-the U.S. Department of Energy. The U.S. Government has rights to use,
-reproduce, and distribute this software.  NEITHER THE GOVERNMENT NOR LOS
-ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
-ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is modified
-to produce derivative works, such modified software should be clearly marked,
-so as not to confuse it with the version available from LANL.
-*/
-#ifndef __pgccfeatures_dot_hpp
-#define __pgccfeatures_dot_hpp
-
-#if !defined(__x86_64__) && !defined(__i386__)
-#  error "This code has only been tested on x86 platforms."
-#include <including_a_nonexistent_file_will_stop_some_compilers_from_continuing_with_a_hopeless_task>
-{ /* maybe an unbalanced brace will terminate the compilation */
- /* Feel free to try the Random123 library on other architectures by changing
- the conditions that reach this error, but you should consider it a
- porting exercise and expect to encounter bugs and deficiencies.
- Please let the authors know of any successes (or failures). */
-#endif
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static inline
-#endif
-
-/* Found this example in PGI's emmintrin.h. */
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) decl __attribute__((__always_inline__))
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) (expr)
-#endif
-
-/* PGI through 13.2 doesn't appear to support AES-NI. */
-#ifndef R123_USE_AES_NI
-#define R123_USE_AES_NI 0
-#endif
-
-/* PGI through 13.2 appears to support MMX, SSE, SSE3, SSE3, SSSE3, SSE4a, and
-   ABM, but not SSE4.1 or SSE4.2. */
-#ifndef R123_USE_SSE4_2
-#define R123_USE_SSE4_2 0
-#endif
-
-#ifndef R123_USE_SSE4_1
-#define R123_USE_SSE4_1 0
-#endif
-
-#ifndef R123_USE_SSE
-/* There's no point in trying to compile SSE code in Random123
-   unless SSE2 is available. */
-#ifdef __SSE2__
-#define R123_USE_SSE 1
-#else
-#define R123_USE_SSE 0
-#endif
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-/* There isn't really a good way to tell at compile time whether
-   openssl is available.  Without a pre-compilation configure-like
-   tool, it's less error-prone to guess that it isn't available.  Add
-   -DR123_USE_AES_OPENSSL=1 and any necessary LDFLAGS or LDLIBS to
-   play with openssl */
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU 1
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 0
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H 0
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 0
-#endif
-
-/* emmintrin.h from PGI #includes xmmintrin.h but then complains at link time
-   about undefined references to _mm_castsi128_ps(__m128i).  Why? */
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-#define R123_USE_EMMINTRIN_H 1
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#ifdef __ABM__
-#define R123_USE_INTRIN_H 1
-#else
-#define R123_USE_INTRIN_H 0
-#endif
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MULHI_INTRIN
-#define R123_USE_MULHILO64_MULHI_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 1
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-/* If you add something, it must go in all the other XXfeatures.hpp
-   and in ../ut_features.cpp */
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/sse.h b/src/external/Random123-1.08/include/Random123/features/sse.h
deleted file mode 100644 (file)
index 88efd65..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef _Random123_sse_dot_h__
-#define _Random123_sse_dot_h__
-
-#if R123_USE_SSE
-
-#if R123_USE_X86INTRIN_H
-#include <x86intrin.h>
-#endif
-#if R123_USE_IA32INTRIN_H
-#include <ia32intrin.h>
-#endif
-#if R123_USE_XMMINTRIN_H
-#include <xmmintrin.h>
-#endif
-#if R123_USE_EMMINTRIN_H
-#include <emmintrin.h>
-#endif
-#if R123_USE_SMMINTRIN_H
-#include <smmintrin.h>
-#endif
-#if R123_USE_WMMINTRIN_H
-#include <wmmintrin.h>
-#endif
-#if R123_USE_INTRIN_H
-#include <intrin.h>
-#endif
-#ifdef __cplusplus
-#include <iostream>
-#include <limits>
-#include <stdexcept>
-#endif
-
-#if R123_USE_ASM_GNU
-
-/* bit25 of CX tells us whether AES is enabled. */
-R123_STATIC_INLINE int haveAESNI(){
-    unsigned int eax, ebx, ecx, edx;
-    __asm__ __volatile__ ("cpuid": "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) :
-                      "a" (1));
-    return (ecx>>25) & 1;
-}
-#elif R123_USE_CPUID_MSVC
-R123_STATIC_INLINE int haveAESNI(){
-    int CPUInfo[4];
-    __cpuid(CPUInfo, 1);
-    return (CPUInfo[2]>>25)&1;
-}
-#else /* R123_USE_CPUID_??? */
-#warning "No R123_USE_CPUID_XXX method chosen.  haveAESNI will always return false"
-R123_STATIC_INLINE int haveAESNI(){
-    return 0;
-}
-#endif /* R123_USE_ASM_GNU || R123_USE_CPUID_MSVC */
-
-// There is a lot of annoying and inexplicable variation in the
-// SSE intrinsics available in different compilation environments.
-// The details seem to depend on the compiler, the version and
-// the target architecture.  Rather than insisting on
-// R123_USE_feature tests for each of these in each of the
-// compilerfeatures.h files we just keep the complexity localized
-// to here...
-#if (defined(__ICC) && __ICC<1210) || (defined(_MSC_VER) && !defined(_WIN64))
-/* Is there an intrinsic to assemble an __m128i from two 64-bit words? 
-   If not, use the 4x32-bit intrisic instead.  N.B.  It looks like Intel
-   added _mm_set_epi64x to icc version 12.1 in Jan 2012.
-*/
-R123_STATIC_INLINE __m128i _mm_set_epi64x(uint64_t v1, uint64_t v0){
-    union{
-        uint64_t u64;
-        uint32_t u32[2];
-    } u1, u0;
-    u1.u64 = v1;
-    u0.u64 = v0;
-    return _mm_set_epi32(u1.u32[1], u1.u32[0], u0.u32[1], u0.u32[0]);
-}
-#endif
-/* _mm_extract_lo64 abstracts the task of extracting the low 64-bit
-   word from an __m128i.  The _mm_cvtsi128_si64 intrinsic does the job
-   on 64-bit platforms.  Unfortunately, both MSVC and Open64 fail
-   assertions in ut_M128.cpp and ut_carray.cpp when we use the
-   _mm_cvtsi128_si64 intrinsic.  (See
-   https://bugs.open64.net/show_bug.cgi?id=873 for the Open64 bug).
-   On 32-bit platforms, there's no MOVQ, so there's no intrinsic.
-   Finally, even if the intrinsic exists, it may be spelled with or
-   without the 'x'.
-*/
-#if !defined(__x86_64__) || defined(_MSC_VER) || defined(__OPEN64__)
-R123_STATIC_INLINE uint64_t _mm_extract_lo64(__m128i si){
-    union{
-        uint64_t u64[2];
-        __m128i m;
-    }u;
-    _mm_store_si128(&u.m, si);
-    return u.u64[0];
-}
-#elif defined(__llvm__) || defined(__ICC)
-R123_STATIC_INLINE uint64_t _mm_extract_lo64(__m128i si){
-    return (uint64_t)_mm_cvtsi128_si64(si);
-}
-#else /* GNUC, others */
-/* FWIW, gcc's emmintrin.h has had the 'x' spelling
-   since at least gcc-3.4.4.  The no-'x' spelling showed up
-   around 4.2. */
-R123_STATIC_INLINE uint64_t _mm_extract_lo64(__m128i si){
-    return (uint64_t)_mm_cvtsi128_si64x(si);
-}
-#endif
-#if defined(__GNUC__) && __GNUC__ < 4
-/* the cast builtins showed up in gcc4. */
-R123_STATIC_INLINE __m128 _mm_castsi128_ps(__m128i si){
-    return (__m128)si;
-}
-#endif
-
-#ifdef __cplusplus
-
-struct r123m128i{
-    __m128i m;
-#if R123_USE_CXX11_UNRESTRICTED_UNIONS
-    // C++98 forbids a union member from having *any* constructors.
-    // C++11 relaxes this, and allows union members to have constructors
-    // as long as there is a "trivial" default construtor.  So in C++11
-    // we can provide a r123m128i constructor with an __m128i argument, and still
-    // have the default (and hence trivial) default constructor.
-    r123m128i() = default;
-    r123m128i(__m128i _m): m(_m){}
-#endif
-    r123m128i& operator=(const __m128i& rhs){ m=rhs; return *this;}
-    r123m128i& operator=(R123_ULONG_LONG n){ m = _mm_set_epi64x(0, n); return *this;}
-#if R123_USE_CXX11_EXPLICIT_CONVERSIONS
-    // With C++0x we can attach explicit to the bool conversion operator
-    // to disambiguate undesired promotions.  For g++, this works
-    // only in 4.5 and above.
-    explicit operator bool() const {return _bool();}
-#else
-    // Pre-C++0x, we have to do something else.  Google for the "safe bool"
-    // idiom for other ideas...
-    operator const void*() const{return _bool()?this:0;}
-#endif
-    operator __m128i() const {return m;}
-
-private:
-#if R123_USE_SSE4_1
-    bool _bool() const{ return !_mm_testz_si128(m,m); }
-#else
-    bool _bool() const{ return 0xf != _mm_movemask_ps(_mm_castsi128_ps(_mm_cmpeq_epi32(m, _mm_setzero_si128()))); }
-#endif
-};
-
-R123_STATIC_INLINE r123m128i& operator++(r123m128i& v){
-    __m128i& c = v.m;
-    __m128i zeroone = _mm_set_epi64x(R123_64BIT(0), R123_64BIT(1));
-    c = _mm_add_epi64(c, zeroone);
-    //return c;
-#if R123_USE_SSE4_1
-    __m128i zerofff = _mm_set_epi64x(0, ~(R123_64BIT(0)));
-    if( R123_BUILTIN_EXPECT(_mm_testz_si128(c,zerofff), 0) ){
-        __m128i onezero = _mm_set_epi64x(R123_64BIT(1), R123_64BIT(0));
-        c = _mm_add_epi64(c, onezero);
-    }
-#else
-    unsigned mask  = _mm_movemask_ps( _mm_castsi128_ps(_mm_cmpeq_epi32(c, _mm_setzero_si128())));
-    // The low two bits of mask are 11 iff the low 64 bits of
-    // c are zero.
-    if( R123_BUILTIN_EXPECT((mask&0x3) == 0x3, 0) ){
-        __m128i onezero = _mm_set_epi64x(1,0);
-        c = _mm_add_epi64(c, onezero);
-    }
-#endif
-    return v;
-}
-
-R123_STATIC_INLINE r123m128i& operator+=(r123m128i& lhs, R123_ULONG_LONG n){ 
-    __m128i c = lhs.m;
-    __m128i incr128 = _mm_set_epi64x(0, n);
-    c = _mm_add_epi64(c, incr128);
-    // return c;     // NO CARRY!  
-
-    int64_t lo64 = _mm_extract_lo64(c);
-    if((uint64_t)lo64 < n)
-        c = _mm_add_epi64(c, _mm_set_epi64x(1,0));
-    lhs.m = c;
-    return lhs; 
-}
-
-// We need this one because it's present, but never used in r123array1xm128i::incr
-R123_STATIC_INLINE bool operator<=(R123_ULONG_LONG, const r123m128i &){
-    throw std::runtime_error("operator<=(unsigned long long, r123m128i) is unimplemented.");}
-
-// The comparisons aren't implemented, but if we leave them out, and 
-// somebody writes, e.g., M1 < M2, the compiler will do an implicit
-// conversion through void*.  Sigh...
-R123_STATIC_INLINE bool operator<(const r123m128i&, const r123m128i&){
-    throw std::runtime_error("operator<(r123m128i, r123m128i) is unimplemented.");}
-R123_STATIC_INLINE bool operator<=(const r123m128i&, const r123m128i&){
-    throw std::runtime_error("operator<=(r123m128i, r123m128i) is unimplemented.");}
-R123_STATIC_INLINE bool operator>(const r123m128i&, const r123m128i&){
-    throw std::runtime_error("operator>(r123m128i, r123m128i) is unimplemented.");}
-R123_STATIC_INLINE bool operator>=(const r123m128i&, const r123m128i&){
-    throw std::runtime_error("operator>=(r123m128i, r123m128i) is unimplemented.");}
-
-R123_STATIC_INLINE bool operator==(const r123m128i &lhs, const r123m128i &rhs){ 
-    return 0xf==_mm_movemask_ps(_mm_castsi128_ps(_mm_cmpeq_epi32(lhs, rhs))); }
-R123_STATIC_INLINE bool operator!=(const r123m128i &lhs, const r123m128i &rhs){ 
-    return !(lhs==rhs);}
-R123_STATIC_INLINE bool operator==(R123_ULONG_LONG lhs, const r123m128i &rhs){
-    r123m128i LHS; LHS.m=_mm_set_epi64x(0, lhs); return LHS == rhs; }
-R123_STATIC_INLINE bool operator!=(R123_ULONG_LONG lhs, const r123m128i &rhs){
-    return !(lhs==rhs);}
-R123_STATIC_INLINE std::ostream& operator<<(std::ostream& os, const r123m128i& m){
-    union{
-        uint64_t u64[2];
-        __m128i m;
-    }u;
-    _mm_storeu_si128(&u.m, m.m);
-    return os << u.u64[0] << " " << u.u64[1];
-}
-
-R123_STATIC_INLINE std::istream& operator>>(std::istream& is, r123m128i& m){
-    uint64_t u64[2];
-    is >> u64[0] >> u64[1];
-    m.m = _mm_set_epi64x(u64[1], u64[0]);
-    return is;
-}
-
-template<typename T> inline T assemble_from_u32(uint32_t *p32); // forward declaration
-
-template <>
-inline r123m128i assemble_from_u32<r123m128i>(uint32_t *p32){
-    r123m128i ret;
-    ret.m = _mm_set_epi32(p32[3], p32[2], p32[1], p32[0]);
-    return ret;
-}
-
-#else
-
-typedef struct {
-    __m128i m;
-} r123m128i;
-
-#endif /* __cplusplus */
-
-#else /* !R123_USE_SSE */
-R123_STATIC_INLINE int haveAESNI(){
-    return 0;
-}
-#endif /* R123_USE_SSE */
-
-#endif /* _Random123_sse_dot_h__ */
diff --git a/src/external/Random123-1.08/include/Random123/features/sunprofeatures.h b/src/external/Random123-1.08/include/Random123/features/sunprofeatures.h
deleted file mode 100644 (file)
index c9cdc00..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef __sunprofeatures_dot_hpp
-#define __sunprofeatures_dot_hpp
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static inline
-#endif
-
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) decl
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) expr
-#endif
-
-// The basic idiom is:
-// #ifndef R123_SOMETHING
-// #if some condition
-// #define R123_SOMETHING 1
-// #else
-// #define R123_SOMETHING 0
-// #endif
-// #endif
-// This idiom allows an external user to override any decision
-// in this file with a command-line -DR123_SOMETHING=1 or -DR123_SOMETHINE=0
-
-// An alternative idiom is:
-// #ifndef R123_SOMETHING
-// #define R123_SOMETHING (some boolean expression)
-// #endif
-// where the boolean expression might contain previously-defined R123_SOMETHING_ELSE
-// pp-symbols.
-
-#ifndef R123_USE_AES_NI
-#define R123_USE_AES_NI 0
-#endif
-
-#ifndef R123_USE_SSE4_2
-#define R123_USE_SSE4_2 0
-#endif
-
-#ifndef R123_USE_SSE4_1
-#define R123_USE_SSE4_1 0
-#endif
-
-#ifndef R123_USE_SSE
-#define R123_USE_SSE 0
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU 0
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 0
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H 0
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 0
-#endif
-
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-#define R123_USE_EMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#define R123_USE_INTRIN_H 0
-#endif
-
-#ifndef R123_USE_MULHILO16_ASM
-#define R123_USE_MULHILO16_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef R123_USE_PHILOX_64BIT
-#define R123_USE_PHILOX_64BIT 0
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-// If you add something, it must go in all the other XXfeatures.hpp
-// and in ../ut_features.cpp
-#endif
diff --git a/src/external/Random123-1.08/include/Random123/features/xlcfeatures.h b/src/external/Random123-1.08/include/Random123/features/xlcfeatures.h
deleted file mode 100644 (file)
index a5c8412..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-Copyright 2010-2011, D. E. Shaw Research.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions, and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions, and the following disclaimer in the
-  documentation and/or other materials provided with the distribution.
-
-* Neither the name of D. E. Shaw Research nor the names of its
-  contributors may be used to endorse or promote products derived from
-  this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Copyright (c) 2013, Los Alamos National Security, LLC
-All rights reserved.
-
-Copyright 2013. Los Alamos National Security, LLC. This software was produced
-under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National
-Laboratory (LANL), which is operated by Los Alamos National Security, LLC for
-the U.S. Department of Energy. The U.S. Government has rights to use,
-reproduce, and distribute this software.  NEITHER THE GOVERNMENT NOR LOS
-ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
-ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is modified
-to produce derivative works, such modified software should be clearly marked,
-so as not to confuse it with the version available from LANL.
-*/
-#ifndef __xlcfeatures_dot_hpp
-#define __xlcfeatures_dot_hpp
-
-#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__)
-#  error "This code has only been tested on x86 and PowerPC platforms."
-#include <including_a_nonexistent_file_will_stop_some_compilers_from_continuing_with_a_hopeless_task>
-{ /* maybe an unbalanced brace will terminate the compilation */
- /* Feel free to try the Random123 library on other architectures by changing
- the conditions that reach this error, but you should consider it a
- porting exercise and expect to encounter bugs and deficiencies.
- Please let the authors know of any successes (or failures). */
-#endif
-
-#ifdef __cplusplus
-/* builtins are automatically available to xlc.  To use them with xlc++,
-   one must include builtins.h.   c.f
-   http://publib.boulder.ibm.com/infocenter/cellcomp/v101v121/index.jsp?topic=/com.ibm.xlcpp101.cell.doc/compiler_ref/compiler_builtins.html
-*/
-#include <builtins.h>
-#endif
-
-#ifndef R123_STATIC_INLINE
-#define R123_STATIC_INLINE static inline
-#endif
-
-#ifndef R123_FORCE_INLINE
-#define R123_FORCE_INLINE(decl) decl __attribute__((__always_inline__))
-#endif
-
-#ifndef R123_CUDA_DEVICE
-#define R123_CUDA_DEVICE
-#endif
-
-#ifndef R123_ASSERT
-#include <assert.h>
-#define R123_ASSERT(x) assert(x)
-#endif
-
-#ifndef R123_BUILTIN_EXPECT
-#define R123_BUILTIN_EXPECT(expr,likely) __builtin_expect(expr,likely)
-#endif
-
-#ifndef R123_USE_AES_NI
-#define R123_USE_AES_NI 0
-#endif
-
-#ifndef R123_USE_SSE4_2
-#define R123_USE_SSE4_2 0
-#endif
-
-#ifndef R123_USE_SSE4_1
-#define R123_USE_SSE4_1 0
-#endif
-
-#ifndef R123_USE_SSE
-#define R123_USE_SSE 0
-#endif
-
-#ifndef R123_USE_AES_OPENSSL
-/* There isn't really a good way to tell at compile time whether
-   openssl is available.  Without a pre-compilation configure-like
-   tool, it's less error-prone to guess that it isn't available.  Add
-   -DR123_USE_AES_OPENSSL=1 and any necessary LDFLAGS or LDLIBS to
-   play with openssl */
-#define R123_USE_AES_OPENSSL 0
-#endif
-
-#ifndef R123_USE_GNU_UINT128
-#define R123_USE_GNU_UINT128 0
-#endif
-
-#ifndef R123_USE_ASM_GNU
-#define R123_USE_ASM_GNU 1
-#endif
-
-#ifndef R123_USE_CPUID_MSVC
-#define R123_USE_CPUID_MSVC 0
-#endif
-
-#ifndef R123_USE_X86INTRIN_H
-#define R123_USE_X86INTRIN_H 0
-#endif
-
-#ifndef R123_USE_IA32INTRIN_H
-#define R123_USE_IA32INTRIN_H 0
-#endif
-
-#ifndef R123_USE_XMMINTRIN_H
-#define R123_USE_XMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_EMMINTRIN_H
-#define R123_USE_EMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_SMMINTRIN_H
-#define R123_USE_SMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_WMMINTRIN_H
-#define R123_USE_WMMINTRIN_H 0
-#endif
-
-#ifndef R123_USE_INTRIN_H
-#ifdef __ABM__
-#define R123_USE_INTRIN_H 1
-#else
-#define R123_USE_INTRIN_H 0
-#endif
-#endif
-
-#ifndef R123_USE_MULHILO32_ASM
-#define R123_USE_MULHILO32_ASM 0
-#endif
-
-#ifndef R123_USE_MULHILO64_MULHI_INTRIN
-#define R123_USE_MULHILO64_MULHI_INTRIN (defined(__powerpc64__))
-#endif
-
-#ifndef R123_MULHILO64_MULHI_INTRIN
-#define R123_MULHILO64_MULHI_INTRIN __mulhdu
-#endif
-
-#ifndef R123_USE_MULHILO32_MULHI_INTRIN
-#define R123_USE_MULHILO32_MULHI_INTRIN 0
-#endif
-
-#ifndef R123_MULHILO32_MULHI_INTRIN
-#define R123_MULHILO32_MULHI_INTRIN __mulhwu
-#endif
-
-#ifndef R123_USE_MULHILO64_ASM
-#define R123_USE_MULHILO64_ASM (defined(__powerpc64__) && !(R123_USE_MULHILO64_MULHI_INTRIN))
-#endif
-
-#ifndef R123_USE_MULHILO64_MSVC_INTRIN
-#define R123_USE_MULHILO64_MSVC_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_CUDA_INTRIN
-#define R123_USE_MULHILO64_CUDA_INTRIN 0
-#endif
-
-#ifndef R123_USE_MULHILO64_OPENCL_INTRIN
-#define R123_USE_MULHILO64_OPENCL_INTRIN 0
-#endif
-
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-#include <stdint.h>
-#ifndef UINT64_C
-#error UINT64_C not defined.  You must define __STDC_CONSTANT_MACROS before you #include <stdint.h>
-#endif
-
-/* If you add something, it must go in all the other XXfeatures.hpp
-   and in ../ut_features.cpp */
-#endif
index a957085010fc0e8332188b484f92a9ecab2147d6..6a7a5bc48316238186b23a986f96bd227e74f42c 100644 (file)
@@ -150,8 +150,13 @@ class SimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static SimpleInputData singleton;
             return singleton.data_;
+#else
+            static SimpleInputData singleton_analysisdata;
+            return singleton_analysisdata.data_;
+#endif
         }
 
         SimpleInputData() : data_(1, false)
@@ -172,8 +177,13 @@ class DataSetsInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static DataSetsInputData singleton;
             return singleton.data_;
+#else
+            static DataSetsInputData singleton_analysisdata;
+            return singleton_analysisdata.data_;
+#endif
         }
 
         DataSetsInputData() : data_(2, false)
@@ -202,8 +212,13 @@ class MultipointInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static MultipointInputData singleton;
             return singleton.data_;
+#else
+            static MultipointInputData singleton_analysisdata;
+            return singleton_analysisdata.data_;
+#endif
         }
 
         MultipointInputData() : data_(1, true)
@@ -234,8 +249,13 @@ class MultipointDataSetsInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static MultipointDataSetsInputData singleton;
             return singleton.data_;
+#else
+            static MultipointDataSetsInputData singleton_analysisdata;
+            return singleton_analysisdata.data_;
+#endif
         }
 
         MultipointDataSetsInputData() : data_(2, true)
index 37de2b508ba120d3831494a26e22c3f42f37f600..08db023952839fb8f43b094b8942f148df2cbb94 100644 (file)
@@ -69,8 +69,13 @@ class SimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static SimpleInputData singleton;
             return singleton.data_;
+#else
+            static SimpleInputData singleton_arraydata;
+            return singleton_arraydata.data_;
+#endif
         }
 
         SimpleInputData() : data_(1, false)
index b3b80b9c24d6b318c2cde0018d1967c687917585..f54d6badf810b10238e61f789cf48e1008d0015f 100644 (file)
@@ -65,8 +65,13 @@ class SimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static SimpleInputData singleton;
             return singleton.data_;
+#else
+            static SimpleInputData singleton_average;
+            return singleton_average.data_;
+#endif
         }
 
         SimpleInputData() : data_(1, false)
@@ -87,8 +92,13 @@ class MultipointInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static MultipointInputData singleton;
             return singleton.data_;
+#else
+            static MultipointInputData singleton_average;
+            return singleton_average.data_;
+#endif
         }
 
         MultipointInputData() : data_(1, true)
@@ -116,8 +126,13 @@ class MultiDataSetInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static MultiDataSetInputData singleton;
             return singleton.data_;
+#else
+            static MultiDataSetInputData singleton_average;
+            return singleton_average.data_;
+#endif
         }
 
         MultiDataSetInputData() : data_(2, true)
index 3fcbcd0341049c6b00ff6dd46ed647fcdb512cfe..e0ead05854fefac7035d5e10b518682a72ab6ec1 100644 (file)
 
 #include "testutils/refdata.h"
 
+// currently the bug manifests itself only in AbstractAnalysisData testing
+#if (defined __ICL && __ICL >= 1400) || (defined __ICC & __ICC >= 1400)
+#define INTEL_STATIC_ANON_NAMESPACE_BUG //see #1558 for details
+#endif
+
 namespace gmx
 {
 
index f68a8b0213902d017e7bdfe2f30f92eb98243f09..b3a2634fb52c08fb2f65e9569d62e1416638e0bd 100644 (file)
@@ -157,8 +157,13 @@ class SimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static SimpleInputData singleton;
             return singleton.data_;
+#else
+            static SimpleInputData singleton_histogram;
+            return singleton_histogram.data_;
+#endif
         }
 
         SimpleInputData() : data_(1, true)
@@ -238,8 +243,13 @@ class WeightedSimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static WeightedSimpleInputData singleton;
             return singleton.data_;
+#else
+            static WeightedSimpleInputData singleton_histogram;
+            return singleton_histogram.data_;
+#endif
         }
 
         WeightedSimpleInputData() : data_(1, true)
@@ -270,8 +280,13 @@ class WeightedDataSetInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static WeightedDataSetInputData singleton;
             return singleton.data_;
+#else
+            static WeightedDataSetInputData singleton_histogram;
+            return singleton_histogram.data_;
+#endif
         }
 
         WeightedDataSetInputData() : data_(2, true)
@@ -437,8 +452,13 @@ class AverageInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static AverageInputData singleton;
             return singleton.data_;
+#else
+            static AverageInputData singleton_histogram;
+            return singleton_histogram.data_;
+#endif
         }
 
         AverageInputData() : data_(1, false)
index 16a9e886a971ca3108a84fbc8869db1ae30e8716..1ea1551fd51d297bd8d23ef0a2ed112198349283 100644 (file)
@@ -64,8 +64,13 @@ class SimpleInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static SimpleInputData singleton;
             return singleton.data_;
+#else
+            static SimpleInputData singleton_lifetime;
+            return singleton_lifetime.data_;
+#endif
         }
 
         SimpleInputData() : data_(1, false)
@@ -86,8 +91,13 @@ class MultiDataSetInputData
     public:
         static const AnalysisDataTestInput &get()
         {
+#ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
             static MultiDataSetInputData singleton;
             return singleton.data_;
+#else
+            static MultiDataSetInputData singleton_lifetime;
+            return singleton_lifetime.data_;
+#endif
         }
 
         MultiDataSetInputData() : data_(2, false)
index 99fd310a6ea7a7c390d2f3e993e282834afe88d4..37a8496fed3c7e8ced5d843a35133622f6a5257e 100644 (file)
@@ -41,7 +41,6 @@
  */
 #include "gromacs/commandline/cmdlinehelpmodule.h"
 
-#include <algorithm>
 #include <string>
 #include <vector>
 
@@ -548,7 +547,6 @@ class HelpExportHtml : public HelpExportInterface
 HelpExportHtml::HelpExportHtml(const CommandLineHelpModuleImpl &helpModule)
     : links_(eHelpOutputFormat_Html)
 {
-    initProgramLinks(&links_, helpModule);
     File             linksFile("links.dat", "r");
     std::string      line;
     while (linksFile.readLine(&line))
@@ -556,6 +554,7 @@ HelpExportHtml::HelpExportHtml(const CommandLineHelpModuleImpl &helpModule)
         links_.addLink(line, "../online/" + line, line);
     }
     linksFile.close();
+    initProgramLinks(&links_, helpModule);
     setupHeaderAndFooter();
 }
 
@@ -618,7 +617,12 @@ void HelpExportHtml::exportModuleGroup(const char                *title,
     {
         const std::string     &tag(module->first);
         std::string            displayName(tag);
-        std::replace(displayName.begin(), displayName.end(), '-', ' ');
+        // TODO: This does not work if the binary name would contain a dash,
+        // but that is not currently the case.
+        size_t                 dashPos = displayName.find('-');
+        GMX_RELEASE_ASSERT(dashPos != std::string::npos,
+                           "There should always be at least one dash in the tag");
+        displayName[dashPos] = ' ';
         indexFile_->writeLine(formatString("<a href=\"%s.html\">%s</a> - %s<br>",
                                            tag.c_str(), displayName.c_str(),
                                            module->second));
@@ -738,8 +742,7 @@ void CommandLineHelpModuleImpl::exportHelp(HelpExportInterface *exporter) const
         {
             const char *const moduleName = module->first.c_str();
             std::string       tag(formatString("%s-%s", program, moduleName));
-            std::string       displayName(tag);
-            std::replace(displayName.begin(), displayName.end(), '-', ' ');
+            std::string       displayName(formatString("%s %s", program, moduleName));
             exporter->exportModuleHelp(*module->second, tag, displayName);
         }
     }
index 8ceab3e6a305e4121df80aed81f7de71ec904656..a32903f51650a1313a61db897bfd3dc19ad69618 100644 (file)
@@ -311,6 +311,8 @@ CommandLineModuleManager::Impl::Impl(const char                *binaryName,
       helpModule_(NULL), singleModule_(NULL),
       bQuiet_(false)
 {
+    GMX_RELEASE_ASSERT(binaryName_.find('-') == std::string::npos,
+                       "Help export does not currently work with binary names with dashes");
 }
 
 void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)
index 5503deff70440748c8d57187929c25057ddd0b68..bf596d1802461d7a2f9b6bf50ef9c8eaff2d7b9f 100644 (file)
@@ -342,7 +342,7 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                 int i, j;
 
                 snew(xxtc, of->natoms_x_compressed);
-                for (i = 0, j = 0; (i < of->natoms_x_compressed); i++)
+                for (i = 0, j = 0; (i < of->natoms_global); i++)
                 {
                     if (ggrpnr(of->groups, egcCompressedX, i) == 0)
                     {
index e0fd0d8eb813a45c68feb17d99d0404c1d32aff9..f2620a9de7cbad5c1b510c29ace00f13e9298b78 100644 (file)
@@ -2238,7 +2238,7 @@ static void init_nb_verlet(FILE                *fp,
                       DOMAINDECOMP(cr) ? &cr->dd->nc : NULL,
                       DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : NULL,
                       bFEP_NonBonded,
-                      gmx_omp_nthreads_get(emntNonbonded));
+                      gmx_omp_nthreads_get(emntPairsearch));
 
     for (i = 0; i < nbv->ngrp; i++)
     {
index 3eea183950baeaaeae3b8630f537c2bd7350b1fe..0ee8b4d4d09303d14c4b06c927caf3ddc9227749 100644 (file)
@@ -1693,8 +1693,8 @@ static void calc_cell_indices(const nbnxn_search_t nbs,
     }
 
     /* Sort the super-cell columns along z into the sub-cells. */
-#pragma omp parallel for num_threads(nbs->nthread_max) schedule(static)
-    for (thread = 0; thread < nbs->nthread_max; thread++)
+#pragma omp parallel for num_threads(nthread) schedule(static)
+    for (thread = 0; thread < nthread; thread++)
     {
         if (grid->bSimple)
         {
index 6fb36de7b35f82f50da874f12d8dee0d5e39bbae..e819cc2ab11cbfd3244dabbdfd61b0d21d1f8300 100644 (file)
@@ -34,3 +34,6 @@
 
 file(GLOB RANDOM_SOURCES *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${RANDOM_SOURCES} PARENT_SCOPE)
+if (BUILD_TESTING)
+    add_subdirectory(tests)
+endif()
diff --git a/src/gromacs/random/tests/CMakeLists.txt b/src/gromacs/random/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9ccc41f
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+gmx_add_unit_test(RandomUnitTests random-test
+                  random.cpp)
diff --git a/src/gromacs/random/tests/random.cpp b/src/gromacs/random/tests/random.cpp
new file mode 100644 (file)
index 0000000..835a638
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests utilities for random number generation.
+ *
+ * \author Roland Schulz <roland@utk.edu>
+ * \ingroup module_random
+ */
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "external/Random123-1.08/include/Random123/threefry.h"
+
+#include "testutils/refdata.h"
+
+namespace
+{
+
+class Threefry : public ::testing::TestWithParam<std::pair<threefry2x64_ctr_t,
+                                                           threefry2x64_key_t> >
+{
+};
+
+TEST_P(Threefry, 2x64)
+{
+    gmx::test::TestReferenceData    data;
+
+    gmx::test::TestReferenceChecker checker(data.rootChecker());
+
+    const std::pair<threefry2x64_ctr_t, threefry2x64_key_t> input = GetParam();
+
+    threefry2x64_ctr_t rand = threefry2x64(input.first, input.second);
+
+    checker.checkSequenceArray(2, rand.v, "Threefry2x64");
+}
+
+//The input values are the same as the ones used by Known Answer Tests (kat) in
+//Random123. Reference values agree with those in kat_vectors
+/** input value: zero */
+const threefry2x64_ctr_t tf_zero = {{0, 0}};
+/** input value: max unit64 */
+const threefry2x64_ctr_t tf_max  = {{std::numeric_limits<gmx_uint64_t>::max(),
+                                     std::numeric_limits<gmx_uint64_t>::max()}};
+/** input value: Pi */
+const threefry2x64_ctr_t tf_pi1  = {{0x243f6a8885a308d3, 0x13198a2e03707344}};
+/** input value: More Pi */
+const threefry2x64_ctr_t tf_pi2  = {{0xa4093822299f31d0, 0x082efa98ec4e6c89}};
+
+INSTANTIATE_TEST_CASE_P(0_ff_pi, Threefry,
+                            ::testing::Values(std::make_pair(tf_zero, tf_zero),
+                                              std::make_pair(tf_max, tf_max),
+                                              std::make_pair(tf_pi1, tf_pi2)));
+
+} // namespace
diff --git a/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_0.xml b/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_0.xml
new file mode 100644 (file)
index 0000000..7993aef
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Threefry2x64">
+    <Int Name="Length">2</Int>
+    <UInt64>14030652003081164901</UInt64>
+    <UInt64>8034964082011408461</UInt64>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_1.xml b/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_1.xml
new file mode 100644 (file)
index 0000000..8ab9e38
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Threefry2x64">
+    <Int Name="Length">2</Int>
+    <UInt64>16153488019559360378</UInt64>
+    <UInt64>15016746978262092648</UInt64>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_2.xml b/src/gromacs/random/tests/refdata/0_ff_pi_Threefry_2x64_2.xml
new file mode 100644 (file)
index 0000000..f70584c
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="Threefry2x64">
+    <Int Name="Length">2</Int>
+    <UInt64>2755214720294128369</UInt64>
+    <UInt64>6250577789015102758</UInt64>
+  </Sequence>
+</ReferenceData>
index 82bf0a39de7f6e0beefcab95af2349e280a0eab2..6104225d3f174876a601a25c5e3c0e4c2719ddc5 100644 (file)
@@ -174,6 +174,18 @@ std::string concatenateStrings(const char *const *sarray, size_t count)
 namespace
 {
 
+/*! \brief
+ * Helper function to identify word boundaries for replaceAllWords().
+ *
+ * \returns  `true` if the character is considered part of a word.
+ *
+ * \ingroup module_utility
+ */
+bool isWordChar(char c)
+{
+    return std::isalnum(c) || c == '-' || c == '_';
+}
+
 /*! \brief
  * Common implementation for string replacement functions.
  *
@@ -201,8 +213,8 @@ replaceInternal(const std::string &input, const char *from, const char *to,
         size_t matchEnd = matchPos + matchLength;
         if (bWholeWords)
         {
-            if (!((matchPos == 0 || !std::isalnum(input[matchPos-1]))
-                  && (matchEnd == input.length() || !std::isalnum(input[matchEnd]))))
+            if (!((matchPos == 0 || !isWordChar(input[matchPos-1]))
+                  && (matchEnd == input.length() || !isWordChar(input[matchEnd]))))
             {
                 matchPos = input.find(from, matchPos + 1);
                 continue;