11.01.2014 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

130 Module Documentation<br />

4.26 Module Management<br />

Functions<br />

• CUresult cuModuleGetFunction (CUfunction ∗hfunc, CUmodule hmod, const char ∗name)<br />

Returns a function handle.<br />

• CUresult cuModuleGetGlobal (CUdeviceptr ∗dptr, unsigned int ∗bytes, CUmodule hmod, const char ∗name)<br />

Returns a global pointer from a module.<br />

• CUresult cuModuleGetTexRef (CUtexref ∗pTexRef, CUmodule hmod, const char ∗name)<br />

Returns a handle to a texture-reference.<br />

• CUresult cuModuleLoad (CUmodule ∗module, const char ∗fname)<br />

Loads a compute module.<br />

• CUresult cuModuleLoadData (CUmodule ∗module, const void ∗image)<br />

Load a module’s data.<br />

• CUresult cuModuleLoadDataEx (CUmodule ∗module, const void ∗image, unsigned int numOptions, CUjit_-<br />

option ∗options, void ∗∗optionValues)<br />

Load a module’s data with options.<br />

• CUresult cuModuleLoadFatBinary (CUmodule ∗module, const void ∗fatCubin)<br />

Load a module’s data.<br />

• CUresult cuModuleUnload (CUmodule hmod)<br />

Unloads a module.<br />

4.26.1 Detailed Description<br />

This section describes the module management functions of the low-level <strong>CUDA</strong> driver application programming<br />

interface.<br />

4.26.2 Function Documentation<br />

4.26.2.1 cuModuleGetFunction (CUfunction ∗ hfunc, CUmodule hmod, const char ∗ name)<br />

Returns in ∗hfunc the handle of the function of name name located in module hmod. If no function of that name<br />

exists, cuModuleGetFunction() returns <strong>CUDA</strong>_ERROR_NOT_FOUND.<br />

Parameters:<br />

hfunc - Returned function handle<br />

hmod - Module to retrieve function from<br />

name - Name of function to retrieve<br />

Returns:<br />

<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-<br />

ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_NOT_FOUND<br />

Generated for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!