Loadable Function: ocl_lib ("assure")
Loadable Function: ocl_lib ("unload")
Loadable Function: loaded = ocl_lib ("loaded")
Loadable Function: [[oldpath], [oldfname]] = ocl_lib ("lib_path_filename", [newpath], [newfname])

Manage dynamic loading/unloading of OpenCL Library.

ocl_lib ("assure") loads the OpenCL library and dynamically links to it. If any step is unsuccessful, ocl_lib aborts with an error. If the OpenCL library was already loaded, ocl_lib has no effect. The currently set path and filename (see below) are used for loading the library.

ocl_lib ("unload") unloads the OpenCL library. Further (internal or explicit) calls to the library are no longer possible. If the OpenCL library was not loaded, ocl_lib has no effect. The subfunction also destroys the OpenCL context.

ocl_lib ("loaded") simply returns whether the library is currently loaded. A zero result means the library is currently not loaded.

Called with the "lib_path_filename" parameter, ocl_lib can be used to query, set, or reset the path and filename pointing to the OpenCL library. System-dependent default settings for both are set when loading the OCL package. The optional one or two output parameters return the current settings for the path oldpath and filename oldfname, respectively. The optional one or two additional input parameters newpath and newfname overwrite the current settings for the path and filename, respectively. If newpath is not an empty string, the concatenation of newpath and newfname must result in a correct full path to the file (i.e., newpath must then end with the system-dependent path separator, e.g., a slash or backslash). If any of newpath or newfname is equal to "default", then the corresponding setting is reset to the system-dependent default value instead.

The function ocl_lib only needs to be called explicitly in rare situations, since many other ("higher") OCL functions call it internally. The function is provided mainly for testing and for troubleshooting regarding an OpenCL installation.

See also: oclArray.

Package: ocl