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.
Functions
- nvvmResult nvvmAddModuleToProgram ( nvvmProgram prog, const char* buffer, size_t size, const char* name )
-
Add a module level NVVM IR to a program.
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.
Description
The buffer should contain an NVVM IR module. The module may have NVVM IR version 1.4 in LLVM 3.8 bitcode format. Alternatively, the module may have NVVM IR version 1.2 either in the LLVM 3.4 bitcode representation or in the LLVM 3.4 text representation. Support for reading the text representation of NVVM IR is deprecated and may be removed in a later version.
- nvvmResult nvvmCompileProgram ( nvvmProgram prog, int numOptions, const char** options )
-
Compile the NVVM program.
Parameters
- prog
- NVVM program.
- numOptions
- Number of compiler options passed.
- options
- Compiler options in the form of C string array.
Returns
Description
The NVVM IR modules in the program will be linked at the IR level. The linked IR program is compiled to PTX.
The target datalayout in the linked IR program is used to determine the address size (32bit vs 64bit).
The valid compiler options are:
-
-g (enable generation of debugging information)
-
-generate-line-info (generate line number information)
-
-opt=
-
0 (disable optimizations)
-
3 (default, enable optimizations)
-
-
-arch=
-
compute_30 (default)
-
compute_32
-
compute_35
-
compute_37
-
compute_50
-
compute_52
-
compute_53
-
compute_60
-
compute_61
-
compute_62
-
compute_70
-
compute_72
-
-
-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)
-
- nvvmResult nvvmCreateProgram ( nvvmProgram* prog )
-
Create a program, and set the value of its handle to *prog.
Parameters
- prog
- NVVM program.
- nvvmResult nvvmDestroyProgram ( nvvmProgram* prog )
-
Destroy a program.
Parameters
- prog
- NVVM program.
- nvvmResult nvvmGetCompiledResult ( nvvmProgram prog, char* buffer )
-
Get the compiled result.
Parameters
- prog
- NVVM program.
- buffer
- Compiled result.
Description
The result is stored in the memory pointed by 'buffer'.
- 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).
Description
- nvvmResult nvvmGetProgramLog ( nvvmProgram prog, char* buffer )
-
Get the Compiler/Verifier Message.
Parameters
- prog
- NVVM program program.
- buffer
- Compilation/Verification log.
Description
The NULL terminated message string is stored in the memory pointed by 'buffer' when the return value is NVVM_SUCCESS.
- nvvmResult nvvmGetProgramLogSize ( nvvmProgram prog, size_t* bufferSizeRet )
-
Get the Size of Compiler/Verifier Message.
Parameters
- prog
- NVVM program.
- bufferSizeRet
- Size of the compilation/verification log (including the trailing NULL).
Description
The size of the message string (including the trailing NULL) is stored into 'buffer_size_ret' when the return value is NVVM_SUCCESS.
- nvvmResult nvvmVerifyProgram ( nvvmProgram prog, int numOptions, const char** options )
-
Verify the NVVM program.
Parameters
- prog
- NVVM program.
- numOptions
- Number of compiler options passed.
- options
- Compiler options in the form of C string array.
Returns