GPUOcelot
Functions

Module Management

CUDA Driver API
Collaboration diagram for Module Management:

Functions

CUresult CUDAAPI cuModuleLoad (CUmodule *module, const char *fname)
 Loads a compute module.
CUresult CUDAAPI cuModuleLoadData (CUmodule *module, const void *image)
 Load a module's data.
CUresult CUDAAPI cuModuleLoadDataEx (CUmodule *module, const void *image, unsigned int numOptions, CUjit_option *options, void **optionValues)
 Load a module's data with options.
CUresult CUDAAPI cuModuleLoadFatBinary (CUmodule *module, const void *fatCubin)
 Load a module's data.
CUresult CUDAAPI cuModuleUnload (CUmodule hmod)
 Unloads a module.
CUresult CUDAAPI cuModuleGetFunction (CUfunction *hfunc, CUmodule hmod, const char *name)
 Returns a function handle.
CUresult CUDAAPI cuModuleGetTexRef (CUtexref *pTexRef, CUmodule hmod, const char *name)
 Returns a handle to a texture reference.
CUresult CUDAAPI cuModuleGetSurfRef (CUsurfref *pSurfRef, CUmodule hmod, const char *name)
 Returns a handle to a surface reference.
CUresult CUDAAPI cuModuleGetGlobal (CUdeviceptr *dptr, size_t *bytes, CUmodule hmod, const char *name)
 Returns a global pointer from a module.

Detailed Description

This section describes the module management functions of the low-level CUDA driver application programming interface.


Function Documentation

CUresult CUDAAPI cuModuleGetFunction ( CUfunction hfunc,
CUmodule  hmod,
const char *  name 
)

Returns a function handle.

Returns in *hfunc the handle of the function of name name located in module hmod. If no function of that name exists, cuModuleGetFunction() returns CUDA_ERROR_NOT_FOUND.

Parameters:
hfunc- Returned function handle
hmod- Module to retrieve function from
name- Name of function to retrieve
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND
See also:
cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleGetGlobal ( CUdeviceptr dptr,
size_t bytes,
CUmodule  hmod,
const char *  name 
)

Returns a global pointer from a module.

Returns in *dptr and *bytes the base pointer and size of the global of name name located in module hmod. If no variable of that name exists, cuModuleGetGlobal() returns CUDA_ERROR_NOT_FOUND. Both parameters dptr and bytes are optional. If one of them is NULL, it is ignored.

Parameters:
dptr- Returned global device pointer
bytes- Returned global size in bytes
hmod- Module to retrieve global from
name- Name of global to retrieve
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND
See also:
cuModuleGetFunction, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleGetSurfRef ( CUsurfref pSurfRef,
CUmodule  hmod,
const char *  name 
)

Returns a handle to a surface reference.

Returns in *pSurfRef the handle of the surface reference of name name in the module hmod. If no surface reference of that name exists, cuModuleGetSurfRef() returns CUDA_ERROR_NOT_FOUND.

Parameters:
pSurfRef- Returned surface reference
hmod- Module to retrieve surface reference from
name- Name of surface reference to retrieve
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleGetTexRef ( CUtexref pTexRef,
CUmodule  hmod,
const char *  name 
)

Returns a handle to a texture reference.

Returns in *pTexRef the handle of the texture reference of name name in the module hmod. If no texture reference of that name exists, cuModuleGetTexRef() returns CUDA_ERROR_NOT_FOUND. This texture reference handle should not be destroyed, since it will be destroyed when the module is unloaded.

Parameters:
pTexRef- Returned texture reference
hmod- Module to retrieve texture reference from
name- Name of texture reference to retrieve
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetSurfRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleLoad ( CUmodule module,
const char *  fname 
)

Loads a compute module.

Takes a filename fname and loads the corresponding module module into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the memory for functions and data (constant and global) needed by the module cannot be allocated, cuModuleLoad() fails. The file should be a cubin file as output by nvcc or a PTX file, either as output by nvcc or handwrtten.

Parameters:
module- Returned module
fname- Filename of module to load
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND, CUDA_ERROR_OUT_OF_MEMORY, CUDA_ERROR_FILE_NOT_FOUND, CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, CUDA_ERROR_SHARED_OBJECT_INIT_FAILED
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoadData, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleLoadData ( CUmodule module,
const void *  image 
)

Load a module's data.

Takes a pointer image and loads the corresponding module module into the current context. The pointer may be obtained by mapping a cubin or PTX file, passing a cubin or PTX file as a NULL-terminated text string, or incorporating a cubin object into the executable resources and using operating system calls such as Windows FindResource() to obtain the pointer.

Parameters:
module- Returned module
image- Module data to load
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY, CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, CUDA_ERROR_SHARED_OBJECT_INIT_FAILED
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadDataEx, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleLoadDataEx ( CUmodule module,
const void *  image,
unsigned int  numOptions,
CUjit_option options,
void **  optionValues 
)

Load a module's data with options.

Takes a pointer image and loads the corresponding module module into the current context. The pointer may be obtained by mapping a cubin or PTX file, passing a cubin or PTX file as a NULL-terminated text string, or incorporating a cubin object into the executable resources and using operating system calls such as Windows FindResource() to obtain the pointer. Options are passed as an array via options and any corresponding parameters are passed in optionValues. The number of total options is supplied via numOptions. Any outputs will be returned via optionValues. Supported options are (types for the option values are specified in parentheses after the option name):

Parameters:
module- Returned module
image- Module data to load
numOptions- Number of options
options- Options for JIT
optionValues- Option values for JIT
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_OUT_OF_MEMORY, CUDA_ERROR_NO_BINARY_FOR_GPU, CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, CUDA_ERROR_SHARED_OBJECT_INIT_FAILED
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadFatBinary, cuModuleUnload
CUresult CUDAAPI cuModuleLoadFatBinary ( CUmodule module,
const void *  fatCubin 
)

Load a module's data.

Takes a pointer fatCubin and loads the corresponding module module into the current context. The pointer represents a fat binary object, which is a collection of different cubin files, all representing the same device code, but compiled and optimized for different architectures. There is currently no documented API for constructing and using fat binary objects by programmers, and therefore this function is an internal function in this version of CUDA. More information can be found in the nvcc document.

Parameters:
module- Returned module
fatCubin- Fat binary to load
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_FOUND, CUDA_ERROR_OUT_OF_MEMORY, CUDA_ERROR_NO_BINARY_FOR_GPU, CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, CUDA_ERROR_SHARED_OBJECT_INIT_FAILED
See also:
cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadData, cuModuleLoadDataEx, cuModuleUnload
CUresult CUDAAPI cuModuleUnload ( CUmodule  hmod)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines