GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
philox432.c.h File Reference
#include "Random123/philox.h"

Go to the source code of this file.

Macros

#define PRIVATE_PHILOX432_CH
 
#define Philox432_NORM_cl_double   1.0 / 0x100000000L
 
#define Philox432_NORM_cl_float   2.32830644e-010f;
 
#define IMPLEMENT_GENERATE_FOR_TYPE(fptype)
 

Functions

clrngPhilox432Counter clrngPhilox432Add (clrngPhilox432Counter a, clrngPhilox432Counter b)
 
clrngPhilox432Counter clrngPhilox432Substract (clrngPhilox432Counter a, clrngPhilox432Counter b)
 
clrngStatus clrngPhilox432CopyOverStreams (size_t count, clrngPhilox432Stream *destStreams, const clrngPhilox432Stream *srcStreams)
 
void clrngPhilox432GenerateDeck (clrngPhilox432StreamState *currentState)
 
clrngStatus clrngPhilox432RewindStreams (size_t count, clrngPhilox432Stream *streams)
 
clrngStatus clrngPhilox432RewindSubstreams (size_t count, clrngPhilox432Stream *streams)
 
void Philox432ResetNextSubStream (clrngPhilox432Stream *stream)
 
clrngStatus clrngPhilox432ForwardToNextSubstreams (size_t count, clrngPhilox432Stream *streams)
 
clrngStatus clrngPhilox432MakeOverSubstreams (clrngPhilox432Stream *stream, size_t count, clrngPhilox432Stream *substreams)
 

Macro Definition Documentation

◆ IMPLEMENT_GENERATE_FOR_TYPE

#define IMPLEMENT_GENERATE_FOR_TYPE (   fptype)
Value:
\
fptype clrngPhilox432RandomU01_##fptype(clrngPhilox432Stream* stream) { \
return (clrngPhilox432NextState(&stream->current) + 0.5) * Philox432_NORM_##fptype; \
} \
\
cl_int clrngPhilox432RandomInteger_##fptype(clrngPhilox432Stream* stream, cl_int i, cl_int j) { \
return i + (cl_int)((j - i + 1) * clrngPhilox432RandomU01_##fptype(stream)); \
} \
\
clrngStatus clrngPhilox432RandomU01Array_##fptype(clrngPhilox432Stream* stream, size_t count, fptype* buffer) { \
if (!stream) \
return clrngSetErrorString(CLRNG_INVALID_VALUE, "%s(): stream cannot be NULL", __func__); \
if (!buffer) \
return clrngSetErrorString(CLRNG_INVALID_VALUE, "%s(): buffer cannot be NULL", __func__); \
for (size_t i = 0; i < count; i++) \
buffer[i] = clrngPhilox432RandomU01_##fptype(stream); \
return CLRNG_SUCCESS; \
} \
\
clrngStatus clrngPhilox432RandomIntegerArray_##fptype(clrngPhilox432Stream* stream, cl_int i, cl_int j, size_t count, cl_int* buffer) { \
if (!stream) \
return clrngSetErrorString(CLRNG_INVALID_VALUE, "%s(): stream cannot be NULL", __func__); \
if (!buffer) \
return clrngSetErrorString(CLRNG_INVALID_VALUE, "%s(): buffer cannot be NULL", __func__); \
for (size_t k = 0; k < count; k++) \
buffer[k] = clrngPhilox432RandomInteger_##fptype(stream, i, j); \
return CLRNG_SUCCESS; \
}
Definition: clRNG.h:343
clrngStatus clrngSetErrorString(cl_int err, const char *msg,...)
Set the current error string.
Definition: private.c:57
clrngPhilox432StreamState current
Definition: philox432.h:76
Definition: clRNG.h:345
Definition: philox432.h:70

◆ Philox432_NORM_cl_double

#define Philox432_NORM_cl_double   1.0 / 0x100000000L

◆ Philox432_NORM_cl_float

#define Philox432_NORM_cl_float   2.32830644e-010f;

◆ PRIVATE_PHILOX432_CH

#define PRIVATE_PHILOX432_CH

Function Documentation

◆ clrngPhilox432Add()

◆ clrngPhilox432CopyOverStreams()

clrngStatus clrngPhilox432CopyOverStreams ( size_t  count,
clrngPhilox432Stream destStreams,
const clrngPhilox432Stream srcStreams 
)

See also
clrngCopyOverStreams()

◆ clrngPhilox432ForwardToNextSubstreams()

clrngStatus clrngPhilox432ForwardToNextSubstreams ( size_t  count,
clrngPhilox432Stream streams 
)

See also
clrngForwardToNextSubstreams()

◆ clrngPhilox432GenerateDeck()

void clrngPhilox432GenerateDeck ( clrngPhilox432StreamState currentState)

◆ clrngPhilox432MakeOverSubstreams()

clrngStatus clrngPhilox432MakeOverSubstreams ( clrngPhilox432Stream stream,
size_t  count,
clrngPhilox432Stream substreams 
)

See also
clrngMakeOverSubstreams()

◆ clrngPhilox432RewindStreams()

clrngStatus clrngPhilox432RewindStreams ( size_t  count,
clrngPhilox432Stream streams 
)

See also
clrngRewindStreams()

◆ clrngPhilox432RewindSubstreams()

clrngStatus clrngPhilox432RewindSubstreams ( size_t  count,
clrngPhilox432Stream streams 
)

See also
clrngRewindSubstreams()

◆ clrngPhilox432Substract()

clrngPhilox432Counter clrngPhilox432Substract ( clrngPhilox432Counter  a,
clrngPhilox432Counter  b 
)

◆ Philox432ResetNextSubStream()

void Philox432ResetNextSubStream ( clrngPhilox432Stream stream)