11.01.2014 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.26 Module Management 133<br />

See also:<br />

cuModuleGetFunction, cuModuleGetGlobal, cuModuleGetTexRef, cuModuleLoad, cuModuleLoadDataEx, cu-<br />

ModuleLoadFatBinary, cuModuleUnload<br />

4.26.2.6 cuModuleLoadDataEx (CUmodule ∗ module, const void ∗ image, unsigned int numOptions,<br />

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

Takes a pointer image and loads the corresponding module module into the current context. The pointer may be obtained<br />

by mapping a cubin or PTX file, passing a cubin or PTX file as a NULL-terminated text string, or incorporating<br />

a cubin object into the executable resources and using operating system calls such as Windows FindResource()<br />

to obtain the pointer. Options are passed as an array via options and any corresponding parameters are passed<br />

in optionValues. The number of total options is supplied via numOptions. Any outputs will be returned via<br />

optionValues. Supported options are:<br />

• CU_JIT_MAX_REGISTERS: input specifies the maximum number of registers per thread;<br />

• CU_JIT_THREADS_PER_BLOCK: input specifies number of threads per block to target compilation for; output<br />

returns the number of threads the compiler actually targeted;<br />

• CU_JIT_WALL_TIME: output returns the float value of wall clock time, in milliseconds, spent compiling the<br />

PTX code;<br />

• CU_JIT_INFO_LOG_BUFFER: input is a pointer to a buffer in which to print any informational log messages<br />

from PTX assembly;<br />

• CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES: input is the size in bytes of the buffer; output is the number of<br />

bytes filled with messages;<br />

• CU_JIT_ERROR_LOG_BUFFER: input is a pointer to a buffer in which to print any error log messages from<br />

PTX assembly;<br />

• CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES: input is the size in bytes of the buffer; output is the number<br />

of bytes filled with messages;<br />

• CU_JIT_OPTIMIZATION_LEVEL: input is the level of optimization to apply to generated code (0 - 4), with 4<br />

being the default and highest level;<br />

• CU_JIT_TARGET_FROM_CUCONTEXT: causes compilation target to be determined based on current attached<br />

context (default);<br />

• CU_JIT_TARGET: input is the compilation target based on supplied CUjit_target_enum; possible values are:<br />

Parameters:<br />

– CU_TARGET_COMPUTE_10<br />

– CU_TARGET_COMPUTE_11<br />

– CU_TARGET_COMPUTE_12<br />

– CU_TARGET_COMPUTE_13<br />

– CU_TARGET_COMPUTE_20<br />

module - Returned module<br />

image - Module data to load<br />

numOptions - Number of options<br />

options - Options for JIT<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!