GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
clRNG.c File Reference
#include <clRNG/clRNG.h>
#include "private.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>

Macros

#define CASE_ERR_(code, msg)   case code: base = msg; break
 
#define CASE_ERR(code)   CASE_ERR_(CLRNG_ ## code, MSG_ ## code)
 

Functions

const char * clrngGetErrorString ()
 Retrieve the last error message. More...
 
const char * clrngGetLibraryRoot ()
 Retrieve the library installation path. More...
 
const char * clrngGetLibraryDeviceIncludes (cl_int *err)
 Generate an include option string for use with the OpenCL C compiler. More...
 

Variables

char errorString [1024]
 

Macro Definition Documentation

◆ CASE_ERR

#define CASE_ERR (   code)    CASE_ERR_(CLRNG_ ## code, MSG_ ## code)

◆ CASE_ERR_

#define CASE_ERR_ (   code,
  msg 
)    case code: base = msg; break

Function Documentation

◆ clrngGetErrorString()

const char* clrngGetErrorString ( )

Retrieve the last error message.

The buffer containing the error message is internally allocated and must not be freed by the client.

Returns
Error message or NULL.

◆ clrngGetLibraryDeviceIncludes()

const char* clrngGetLibraryDeviceIncludes ( cl_int *  err)

Generate an include option string for use with the OpenCL C compiler.

Generate and return "-I${CLRNG_ROOT}/include", where ${CLRNG_ROOT} is the value of the CLRNG_ROOT environment variable. This string is meant to be passed as an option to the OpenCL C compiler for programs that make use of the clRNG device-side headers. If the CLRNG_ROOT environment variable is not defined, it defaults /usr if the file /usr/include/clRNG/clRNG.h exists, else to the current directory of execution of the program.

A static buffer is return and need not be released; it could change upon successive calls to the function.

An error is returned in err if the preallocated buffer is too small to contain the include string.

Parameters
[out]errError status variable, or NULL.
Returns
An OpenCL C compiler option to indicate where to find the device-side clRNG headers.

◆ clrngGetLibraryRoot()

const char* clrngGetLibraryRoot ( )

Retrieve the library installation path.

Returns
Value of the CLRNG_ROOT environment variable, if defined; else, /usr if the file /usr/include/clRNG/clRNG.h exists; or, the current directory (.) of execution of the program otherwise.

Variable Documentation

◆ errorString

char errorString[1024]