random123

Counter-based Random Number Generators
git clone git://git.meso-star.com/random123.git
Log | Files | Refs | README | LICENSE

util_expandtpl.h (2532B)


      1 /*
      2 Copyright 2010-2011, D. E. Shaw Research.
      3 All rights reserved.
      4 
      5 Redistribution and use in source and binary forms, with or without
      6 modification, are permitted provided that the following conditions are
      7 met:
      8 
      9 * Redistributions of source code must retain the above copyright
     10   notice, this list of conditions, and the following disclaimer.
     11 
     12 * Redistributions in binary form must reproduce the above copyright
     13   notice, this list of conditions, and the following disclaimer in the
     14   documentation and/or other materials provided with the distribution.
     15 
     16 * Neither the name of D. E. Shaw Research nor the names of its
     17   contributors may be used to endorse or promote products derived from
     18   this software without specific prior written permission.
     19 
     20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31 */
     32 #ifndef TEST_TPL
     33 #error "TEST_TPL not defined before including util_expandtpl.h"
     34 #else
     35 /*
     36  * This is included by various files after defining TEST_TPL to
     37  * expand TEST_TPL for each of the RNGs we want to test.
     38  * TEST_TPL args are the name of the RNG, N, W, and R,
     39  * N being the number of words, W being the wordsize in bits,
     40  * and R being the number of rounds.
     41  */
     42 
     43 #if TRY_PHILOX2X32
     44 TEST_TPL(philox, 2, 32, 7)
     45 TEST_TPL(philox, 2, 32, 10)
     46 #endif
     47 TEST_TPL(philox, 4, 32, 7)
     48 TEST_TPL(philox, 4, 32, 10)
     49 #if R123_USE_PHILOX_64BIT
     50 TEST_TPL(philox, 2, 64, 6)
     51 TEST_TPL(philox, 2, 64, 10)
     52 TEST_TPL(philox, 4, 64, 7)
     53 TEST_TPL(philox, 4, 64, 10)
     54 #endif
     55 #if R123_USE_64BIT
     56 TEST_TPL(threefry, 2, 64, 13)
     57 TEST_TPL(threefry, 2, 64, 20)
     58 TEST_TPL(threefry, 4, 64, 12)
     59 TEST_TPL(threefry, 4, 64, 20)
     60 TEST_TPL(threefry, 4, 64, 72)
     61 #endif
     62 TEST_TPL(threefry, 4, 32, 12)
     63 TEST_TPL(threefry, 4, 32, 20)
     64 
     65 #if R123_USE_AES_NI
     66 TEST_TPL(ars, 4, 32, 5)
     67 TEST_TPL(ars, 4, 32, 7)
     68 TEST_TPL(aesni, 4, 32, 10)
     69 #endif
     70 
     71 #undef TEST_TPL
     72 #endif /* TEST_TPL */