clQMC
An OpenCL library for quasi-Monte Carlo methods
Typedefs | Enumerations | Functions
clQMC.h File Reference

Library definitions. More...

#include <CL/cl.h>

Go to the source code of this file.

Typedefs

typedef enum clqmcStatus_ clqmcStatus
 Error codes. More...
 

Enumerations

enum  clqmcStatus_
 Error codes. More...
 

Functions

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

Detailed Description

Library definitions.

Typedef Documentation

typedef enum clqmcStatus_ clqmcStatus

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

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

Enumeration Type Documentation

enum clqmcStatus_

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

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

Function Documentation

const char* clqmcGetErrorString ( )

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

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

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

Retrieve the library installation path.

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