Defines | Functions | Variables

clew.c File Reference

OpenCL run-time loader source. More...

#include "clew.h"
#include <stdlib.h>

Defines

#define CLEW_CHECK_FUNCTION(f)

Functions

static void clewExit (void)
 Unloads OpenCL dynamic library, should not be called directly.
int clewInit (const char *path)
 Load OpenCL dynamic library and set function entry points.
const char * clewErrorString (cl_int error)
 Convert an OpenCL error code to its string equivalent.

Variables

static CLCC_DYNLIB_HANDLE module = NULL
 module handle

Detailed Description

OpenCL run-time loader source.


Define Documentation

#define CLEW_CHECK_FUNCTION (   f )
Value:
if ((f) == NULL)                        \
    {                                       \
        CLCC_DYNLIB_CLOSE(module);          \
        module = NULL;                      \
        return CLEW_ERROR_IMPORT_FAILED;    \
    }                                       \

Function Documentation

const char* clewErrorString ( cl_int  error )

Convert an OpenCL error code to its string equivalent.

Parameters:
errorCL error code
Returns:
a string representation of the error code
int clewInit ( const char *  path )

Load OpenCL dynamic library and set function entry points.

Parameters:
pathpath to dynamic library to load
Returns:
CLEW_ERROR_OPEN_FAILED if the library could not be opened CLEW_ERROR_ATEXIT_FAILED if atexit(clewExit) failed CLEW_SUCCESS when the library was succesfully loaded