clRNG
An OpenCL library for random number generators (RNG)
 All Data Structures Files Functions Typedefs Enumerations Pages
Typedefs | Enumerations | Functions
clRNG.h File Reference

Library definitions common to all RNG's. More...

#include <CL/cl.h>

Go to the source code of this file.

Typedefs

typedef enum clrngStatus_ clrngStatus
 Error codes. More...
 

Enumerations

enum  clrngStatus_
 Error codes. More...
 

Functions

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

Detailed Description

Library definitions common to all RNG's.

See also
clRNG_template.h

Typedef Documentation

typedef enum clrngStatus_ clrngStatus

Error codes.

Most library functions return an error status indicating the success or error state of the operation carried by the function. In case of success, the error status is set to CLRNG_SUCCESS. Otherwise, an error message can be retrieved by invoking clrngGetErrorString().

Note
In naming this type clrngStatus, we follow the convention from clFFT and clBLAS, where the homologous types are name clfftStatus and clblasStatus, respectively.

Enumeration Type Documentation

Error codes.

Most library functions return an error status indicating the success or error state of the operation carried by the function. In case of success, the error status is set to CLRNG_SUCCESS. Otherwise, an error message can be retrieved by invoking clrngGetErrorString().

Note
In naming this type clrngStatus, we follow the convention from clFFT and clBLAS, where the homologous types are name clfftStatus and clblasStatus, respectively.

Function Documentation

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.
const char* clrngGetLibraryDeviceIncludes ( cl_int *  err)

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

Generate and return "-I${CLRNG_ROOT}/cl/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, the current directory of execution of the program is substituted for the library root path.

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.
Examples:
MultiStream/multistream.c.
const char* clrngGetLibraryRoot ( )

Retrieve the library installation path.

Returns
Value of the CLRNG_ROOT environment variable, if defined, else the current directory (.) of execution of the program.