clProbDist
An OpenCL library for probability distributions
Typedefs | Enumerations | Functions
clProbDist.h File Reference

Library definitions common to all probability distributions. More...

#include <CL/cl.h>

Go to the source code of this file.

Typedefs

typedef enum clprobdistStatus_ clprobdistStatus
 Error codes. More...
 

Enumerations

enum  clprobdistStatus_
 Error codes. More...
 

Functions

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

Detailed Description

Library definitions common to all probability distributions.

See also
clProbDist_template.h

Typedef Documentation

typedef enum clprobdistStatus_ clprobdistStatus

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 CL_SUCCESS. Otherwise, an error message can be retrieved by invoking clprobdistGetErrorString().

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

Enumeration Type Documentation

enum clprobdistStatus_

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 CL_SUCCESS. Otherwise, an error message can be retrieved by invoking clprobdistGetErrorString().

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

Function Documentation

const char* clprobdistGetErrorString ( )

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* clprobdistGetLibraryDeviceIncludes ( cl_int *  err)

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

Generate and return "-I${CLPROBDIST_ROOT}/include", where ${CLPROBDIST_ROOT} is the value of the CLPROBDIST_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 clProbDist device-side headers. If the CLPROBDIST_ROOT environment variable is not defined, it defaults to /usr if the file /usr/include/clProbDist/clProbDist.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 clProbDist headers.
const char* clprobdistGetLibraryRoot ( )

Retrieve the library installation path.

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