Skip to content

Commit

Permalink
Reset Random123 version 1.14 files that were pushed accidentally
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchwiebert committed Jan 13, 2022
1 parent 0c6bb86 commit a5c9c76
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 333 deletions.
7 changes: 0 additions & 7 deletions lib/Random123/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,6 @@ struct r123array##_N##x##W{ \
CXXOVERLOADS(_N, W, T)


#if defined(__CUDACC__)
/* Disable complaints from CUDA8 and C++ */
#pragma diag_suppress = code_is_unreachable
#endif
_r123array_tpl(1, 32, uint32_t) /* r123array1x32 */
_r123array_tpl(2, 32, uint32_t) /* r123array2x32 */
_r123array_tpl(4, 32, uint32_t) /* r123array4x32 */
Expand All @@ -331,9 +327,6 @@ _r123array_tpl(1, 64, uint64_t) /* r123array1x64 */
_r123array_tpl(2, 64, uint64_t) /* r123array2x64 */
_r123array_tpl(4, 64, uint64_t) /* r123array4x64 */
#endif
#if defined(__CUDACC__)
#pragma diag_default = code_is_unreachable
#endif

_r123array_tpl(16, 8, uint8_t) /* r123array16x8 for ARSsw, AESsw */

Expand Down
2 changes: 1 addition & 1 deletion lib/Random123/boxmuller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <Random123/features/compilerfeatures.h>
#include <Random123/uniform.hpp>
#include <math.h>
#include <cmath>

namespace r123{

Expand Down
4 changes: 0 additions & 4 deletions lib/Random123/conventional/Engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ struct Engine {
v.back() = e.v.back();
fix_invariant();
}
#if __cplusplus >= 201103L
Engine& operator=(const Engine&) = default;
Engine& operator=(Engine&&) = default;
#endif

template <typename SeedSeq>
explicit Engine(SeedSeq &s
Expand Down
2 changes: 1 addition & 1 deletion lib/Random123/features/compilerfeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ added to each of the *features.h files, AND to examples/ut_features.cpp.
#include "nvccfeatures.h"
#elif defined(__ICC)
#include "iccfeatures.h"
#elif defined(__xlC__) || defined(__ibmxl__)
#elif defined(__xlC__)
#include "xlcfeatures.h"
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#include "sunprofeatures.h"
Expand Down
34 changes: 6 additions & 28 deletions lib/Random123/features/gccfeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define R123_GNUC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)

#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__aarch64__) && !defined(__s390x__)
#if !defined(__x86_64__) && !defined(__i386__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__aarch64__)
# error "This code has only been tested on x86, powerpc and a few arm platforms."
#include <including_a_nonexistent_file_will_stop_some_compilers_from_continuing_with_a_hopeless_task>
{ /* maybe an unbalanced brace will terminate the compilation */
Expand All @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please let the authors know of any successes (or failures). */
#endif

#if defined(__powerpc__) && !defined(__clang__)
#ifdef __powerpc__
#include <ppu_intrinsics.h>
#endif

Expand Down Expand Up @@ -214,6 +214,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#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
Expand All @@ -234,32 +238,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#endif

#ifndef R123_USE_MULHILO64_ASM
/* Shouldn't we use asm for mulhilo64 when the #ifdefs above haven't
chosen something else? Everything about the mulhilo64
implementation is so fragile and difficult to test that I'm
reluctant to make this change without a compelling reason, but this
seems preferable to just turning off USE_MULHILO64_ASM.
#define R123_USE_MULHILO64_ASM (R123_USE_ASM_GNU && (!R123_USE_GNU_UINT128) && (!R123_USE_MULHILO64_CUDA_INTRIN) && (!R123_USE_MULHILO64_MULHI_INTRIN) && (!R123_USE_MULHILO64_OPENCL_INTRIN) && (!R123_USE_MULHILO64_MSVC_INTRIN))
*/
#define R123_USE_MULHILO64_ASM 0
#endif

#if defined(__powerpc__) && defined(__clang__)
#ifdef __powerpc64__
static inline unsigned long long __mulhdu(unsigned long long a, unsigned long long b) {
__uint128_t c = (__uint128_t) a * (__uint128_t) b;
return c >> 64;
}
#endif

static inline unsigned int __mulhwu(unsigned int a, unsigned int b) {
unsigned long long c = (unsigned long long) a * (unsigned long long) b;
return c >> 32;
}
#endif

#ifndef R123_MULHILO64_MULHI_INTRIN
#define R123_MULHILO64_MULHI_INTRIN __mulhdu
#endif
Expand Down
4 changes: 2 additions & 2 deletions lib/Random123/features/msvcfeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif

#ifndef R123_USE_SSE4_2
#if defined(_M_X64) || _MSC_VER > 1899
#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) || _MSC_VER > 1899
#if defined(_M_X64)
#define R123_USE_SSE4_1 1
#else
#define R123_USE_SSE4_1 0
Expand Down
33 changes: 17 additions & 16 deletions lib/Random123/features/nvccfeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define R123_ASSERT(x) if((x)) ; else asm("trap;")
#endif

#else // ! __CUDA_ARCH__
// If we're using nvcc not compiling for the CUDA architecture,
// then we must be compiling for the host. In that case,
// tell the philox code to use the mulhilo64 asm because
// nvcc doesn't grok uint128_t.
#ifndef R123_USE_MULHILO64_ASM
//#define R123_USE_MULHILO64_ASM 1
#if defined(__GNUC__)
#define R123_USE_MULHILO64_ASM 1
#elif defined(_MSC_FULL_VER)
#define R123_USE_MULHILO64_ASM 0
#endif
#endif

#endif // __CUDA_ARCH__

#ifndef R123_BUILTIN_EXPECT
#define R123_BUILTIN_EXPECT(expr,likely) expr
#endif
Expand Down Expand Up @@ -105,22 +121,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define R123_ULONG_LONG unsigned long long
#endif

#else // ! __CUDA_ARCH__

// If we're using nvcc, but not compiling for the CUDA architecture,
// then we must be compiling for the host. But host-compilation might
// use gcc, msvc, or xlc. This #else/#endif used to be higher up,
// mistakenly turning off all kinds of things the host that are really
// problematic only in device code. It's not clear that we need to do
// anything special for host-code that we wouldn't otherwise do in
// xlcfeatures, gccfeatures or msvcfeatures. But if we do, this is
// the place to do it.

#endif // __CUDA_ARCH__

#if defined(__xlC__) || defined(__ibmxl__)
#include "xlcfeatures.h"
#elif defined(__GNUC__)
#if defined(__GNUC__)
#include "gccfeatures.h"
#elif defined(_MSC_FULL_VER)
#include "msvcfeatures.h"
Expand Down
1 change: 0 additions & 1 deletion lib/Random123/features/pgccfeatures.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* This derivative file contributed via email by Gabriel Rockefeller on 8/5/2013 */
/*
Copyright 2010-2011, D. E. Shaw Research.
All rights reserved.
Expand Down
6 changes: 3 additions & 3 deletions lib/Random123/features/sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ R123_STATIC_INLINE int haveAESNI(){
// 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) && _MSC_VER < 1900)
#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.
Expand Down Expand Up @@ -194,7 +194,7 @@ R123_STATIC_INLINE r123m128i& operator++(r123m128i& v){
// 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);
__m128i onezero = _mm_set_epi64x((uint64_t)1,(uint64_t)0);
c = _mm_add_epi64(c, onezero);
}
#endif
Expand All @@ -209,7 +209,7 @@ R123_STATIC_INLINE r123m128i& operator+=(r123m128i& lhs, R123_ULONG_LONG n){

int64_t lo64 = _mm_extract_lo64(c);
if((uint64_t)lo64 < n)
c = _mm_add_epi64(c, _mm_set_epi64x(R123_64BIT(1),R123_64BIT(0)));
c = _mm_add_epi64(c, _mm_set_epi64x((uint64_t)1, (uint64_t)0));
lhs.m = c;
return lhs;
}
Expand Down
1 change: 0 additions & 1 deletion lib/Random123/features/xlcfeatures.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* This derivative file contributed via email by Gabriel Rockefeller on 8/5/2013 */
/*
Copyright 2010-2011, D. E. Shaw Research.
All rights reserved.
Expand Down
Loading

0 comments on commit a5c9c76

Please sign in to comment.