libNVVM API (PDF) - CUDA Toolkit v5.5 (older) - Last updated May 11, 2013 - Send Feedback

1.3. Compilation

Typedefs

typedef _nvvmProgram *  nvvmProgram
NVVM Program.

Functions

nvvmResult nvvmAddModuleToProgram ( nvvmProgram prog, const char* buffer, size_t size, const char* name )
Add a module level NVVM IR to a program.
nvvmResult nvvmCompileProgram ( nvvmProgram prog, int  numOptions, const char** options )
Compile the NVVM program.
nvvmResult nvvmCreateProgram ( nvvmProgram* prog )
Create a program, and set the value of its handle to *prog.
nvvmResult nvvmDestroyProgram ( nvvmProgram* prog )
Destroy a program.
nvvmResult nvvmGetCompiledResult ( nvvmProgram prog, char* buffer )
Get the compiled result.
nvvmResult nvvmGetCompiledResultSize ( nvvmProgram prog, size_t* bufferSizeRet )
Get the size of the compiled result.
nvvmResult nvvmGetProgramLog ( nvvmProgram prog, char* buffer )
Get the Compiler/Verifier Message.
nvvmResult nvvmGetProgramLogSize ( nvvmProgram prog, size_t* bufferSizeRet )
Get the Size of Compiler/Verifier Message.
nvvmResult nvvmVerifyProgram ( nvvmProgram prog, int  numOptions, const char** options )
Verify the NVVM program.

Typedefs

typedef _nvvmProgram * nvvmProgram

NVVM Program. An opaque handle for a program

Functions

nvvmResult nvvmAddModuleToProgram ( nvvmProgram prog, const char* buffer, size_t size, const char* name )

Add a module level NVVM IR to a program. The buffer should contain an NVVM IR module either in the bitcode representation or in the text representation.

Parameters
prog
NVVM program.
buffer
NVVM IR module in the bitcode or text representation.
size
Size of the NVVM IR module.
name
Name of the NVVM IR module. If NULL, "<unnamed>" is used as the name.
nvvmResult nvvmCompileProgram ( nvvmProgram prog, int  numOptions, const char** options )

Compile the NVVM program. The valid compiler options are:

  • -g (enable generation of debugging information)

  • -opt=
    • 0 (disable optimizations)

    • 3 (default, enable optimizations)

  • -arch=
    • compute_20 (default)

    • compute_30

    • compute_35

  • -ftz=
    • 0 (default, preserve denormal values, when performing single-precision floating-point operations)

    • 1 (flush denormal values to zero, when performing single-precision floating-point operations)

  • -prec-sqrt=
    • 0 (use a faster approximation for single-precision floating-point square root)

    • 1 (default, use IEEE round-to-nearest mode for single-precision floating-point square root)

  • -prec-div=
    • 0 (use a faster approximation for single-precision floating-point division and reciprocals)

    • 1 (default, use IEEE round-to-nearest mode for single-precision floating-point division and reciprocals)

  • -fma=
    • 0 (disable FMA contraction)

    • 1 (default, enable FMA contraction)

Parameters
prog
NVVM program.
numOptions
Number of compiler options passed.
options
Compiler options in the form of C string array.
nvvmResult nvvmCreateProgram ( nvvmProgram* prog )

Create a program, and set the value of its handle to *prog.

See also:

nvvmDestroyProgram()

Parameters
prog
NVVM program.
nvvmResult nvvmDestroyProgram ( nvvmProgram* prog )

Destroy a program.

See also:

nvvmCreateProgram()

Parameters
prog
NVVM program.
nvvmResult nvvmGetCompiledResult ( nvvmProgram prog, char* buffer )

Get the compiled result. The result is stored in the memory pointed by 'buffer'.

Parameters
prog
NVVM program.
buffer
Compiled result.
nvvmResult nvvmGetCompiledResultSize ( nvvmProgram prog, size_t* bufferSizeRet )

Get the size of the compiled result.

Parameters
prog
NVVM program.
bufferSizeRet
Size of the compiled result (including the trailing NULL).
nvvmResult nvvmGetProgramLog ( nvvmProgram prog, char* buffer )

Get the Compiler/Verifier Message. The NULL terminated message string is stored in the memory pointed by 'buffer' when the return value is NVVM_SUCCESS.

Parameters
prog
NVVM program program.
buffer
Compilation/Verification log.
nvvmResult nvvmGetProgramLogSize ( nvvmProgram prog, size_t* bufferSizeRet )

Get the Size of Compiler/Verifier Message. The size of the message string (including the trailing NULL) is stored into 'buffer_size_ret' when the return value is NVVM_SUCCESS.

Parameters
prog
NVVM program.
bufferSizeRet
Size of the compilation/verification log (including the trailing NULL).
nvvmResult nvvmVerifyProgram ( nvvmProgram prog, int  numOptions, const char** options )

Verify the NVVM program. The valid compiler options are:

NONE. The numOptions and options parameters are ignored, and are for future use.

Parameters
prog
NVVM program.
numOptions
Number of compiler options passed.
options
Compiler options in the form of C string array.

libNVVM API (PDF) - CUDA Toolkit v5.5 (older) - Last updated May 11, 2013 - Send Feedback