GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
device/lfsr113.c.h File Reference

Go to the source code of this file.

Macros

#define PRIVATE_LFSR113_CH
 
#define Lfsr113_NORM_cl_double   1.0 / 0x100000001L
 
#define Lfsr113_NORM_cl_float   2.3283063e-10f
 
#define IMPLEMENT_GENERATE_FOR_TYPE(fptype)
 

Functions

clrngStatus clrngLfsr113CopyOverStreams (size_t count, clrngLfsr113Stream *destStreams, const clrngLfsr113Stream *srcStreams)
 
clrngStatus clrngLfsr113RewindStreams (size_t count, clrngLfsr113Stream *streams)
 
clrngStatus clrngLfsr113RewindSubstreams (size_t count, clrngLfsr113Stream *streams)
 
void lfsr113ResetNextSubStream (clrngLfsr113Stream *stream)
 
clrngStatus clrngLfsr113ForwardToNextSubstreams (size_t count, clrngLfsr113Stream *streams)
 
clrngStatus clrngLfsr113MakeOverSubstreams (clrngLfsr113Stream *stream, size_t count, clrngLfsr113Stream *substreams)
 

Macro Definition Documentation

◆ IMPLEMENT_GENERATE_FOR_TYPE

#define IMPLEMENT_GENERATE_FOR_TYPE (   fptype)
Value:
\
fptype clrngLfsr113RandomU01_##fptype(clrngLfsr113Stream* stream) { \
return clrngLfsr113NextState(&stream->current) * Lfsr113_NORM_##fptype; \
} \
\
cl_int clrngLfsr113RandomInteger_##fptype(clrngLfsr113Stream* stream, cl_int i, cl_int j) { \
return i + (cl_int)((j - i + 1) * clrngLfsr113RandomU01_##fptype(stream)); \
} \
\
clrngStatus clrngLfsr113RandomU01Array_##fptype(clrngLfsr113Stream* stream, size_t count, fptype* buffer) { \
if (!stream) \
if (!buffer) \
for (size_t i = 0; i < count; i++) \
buffer[i] = clrngLfsr113RandomU01_##fptype(stream); \
return CLRNG_SUCCESS; \
} \
\
clrngStatus clrngLfsr113RandomIntegerArray_##fptype(clrngLfsr113Stream* stream, cl_int i, cl_int j, size_t count, cl_int* buffer) { \
if (!stream) \
if (!buffer) \
for (size_t k = 0; k < count; k++) \
buffer[k] = clrngLfsr113RandomInteger_##fptype(stream, i, j); \
return CLRNG_SUCCESS; \
}
Definition: lfsr113.h:59
Definition: clRNG.h:343
clrngStatus clrngSetErrorString(cl_int err, const char *msg,...)
Set the current error string.
Definition: private.c:57
Definition: clRNG.h:345
clrngLfsr113StreamState current
Definition: lfsr113.h:65

◆ Lfsr113_NORM_cl_double

#define Lfsr113_NORM_cl_double   1.0 / 0x100000001L

◆ Lfsr113_NORM_cl_float

#define Lfsr113_NORM_cl_float   2.3283063e-10f

◆ PRIVATE_LFSR113_CH

#define PRIVATE_LFSR113_CH

Function Documentation

◆ clrngLfsr113CopyOverStreams()

clrngStatus clrngLfsr113CopyOverStreams ( size_t  count,
clrngLfsr113Stream destStreams,
const clrngLfsr113Stream srcStreams 
)

See also
clrngCopyOverStreams()

◆ clrngLfsr113ForwardToNextSubstreams()

clrngStatus clrngLfsr113ForwardToNextSubstreams ( size_t  count,
clrngLfsr113Stream streams 
)

See also
clrngForwardToNextSubstreams()

◆ clrngLfsr113MakeOverSubstreams()

clrngStatus clrngLfsr113MakeOverSubstreams ( clrngLfsr113Stream stream,
size_t  count,
clrngLfsr113Stream substreams 
)

See also
clrngMakeOverSubstreams()

◆ clrngLfsr113RewindStreams()

clrngStatus clrngLfsr113RewindStreams ( size_t  count,
clrngLfsr113Stream streams 
)

See also
clrngRewindStreams()

◆ clrngLfsr113RewindSubstreams()

clrngStatus clrngLfsr113RewindSubstreams ( size_t  count,
clrngLfsr113Stream streams 
)

See also
clrngRewindSubstreams()

◆ lfsr113ResetNextSubStream()

void lfsr113ResetNextSubStream ( clrngLfsr113Stream stream)