include/hip/hiprtc.h File Reference

include/hip/hiprtc.h File Reference#

HIP Runtime API Reference: include/hip/hiprtc.h File Reference
hiprtc.h File Reference
#include <hip/hip_common.h>
#include <hip/linker_types.h>
#include <cstdlib>
Include dependency graph for hiprtc.h:

Go to the source code of this file.

Macros

#define hiprtcJIT_option   hipJitOption
 
#define HIPRTC_JIT_MAX_REGISTERS    hipJitOptionMaxRegisters
 thread, passed to compiler More...
 
#define HIPRTC_JIT_THREADS_PER_BLOCK    hipJitOptionThreadsPerBlock
 CUDA Only Number of thread per block. More...
 
#define HIPRTC_JIT_WALL_TIME   hipJitOptionWallTime
 CUDA Only Value for total wall clock time. More...
 
#define HIPRTC_JIT_INFO_LOG_BUFFER    hipJitOptionInfoLogBuffer
 logged information More...
 
#define HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES    hipJitOptionInfoLogBufferSizeBytes
 in bytes for logged info More...
 
#define HIPRTC_JIT_ERROR_LOG_BUFFER    hipJitOptionErrorLogBuffer
 with logged error(s) More...
 
#define HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES    hipJitOptionErrorLogBufferSizeBytes
 bytes for logged error(s) More...
 
#define HIPRTC_JIT_OPTIMIZATION_LEVEL    hipJitOptionOptimizationLevel
 
#define HIPRTC_JIT_TARGET_FROM_HIPCONTEXT    hipJitOptionTargetFromContext
 which is the default More...
 
#define HIPRTC_JIT_TARGET   hipJitOptionTarget
 CUDA Only JIT target. More...
 
#define HIPRTC_JIT_FALLBACK_STRATEGY   hipJitOptionFallbackStrategy
 CUDA Only Fallback strategy. More...
 
#define HIPRTC_JIT_GENERATE_DEBUG_INFO    hipJitOptionGenerateDebugInfo
 CUDA Only Generate debug information. More...
 
#define HIPRTC_JIT_LOG_VERBOSE   hipJitOptionLogVerbose
 CUDA Only Generate log verbose. More...
 
#define HIPRTC_JIT_GENERATE_LINE_INFO    hipJitOptionGenerateLineInfo
 CUDA Only Generate line number information. More...
 
#define HIPRTC_JIT_CACHE_MODE   hipJitOptionCacheMode
 CUDA Only Set cache mode. More...
 
#define HIPRTC_JIT_NEW_SM3X_OPT   hipJitOptionSm3xOpt
 
#define HIPRTC_JIT_FAST_COMPILE   hipJitOptionFastCompile
 CUDA Only Set fast compile. More...
 
#define HIPRTC_JIT_GLOBAL_SYMBOL_NAMES    hipJitOptionGlobalSymbolNames
 relocated to the host More...
 
#define HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS    hipJitOptionGlobalSymbolAddresses
 relocated to the device More...
 
#define HIPRTC_JIT_GLOBAL_SYMBOL_COUNT    hipJitOptionGlobalSymbolCount
 CUDA Only Number of symbol count. More...
 
#define HIPRTC_JIT_LTO    hipJitOptionLto
 optimization for device code More...
 
#define HIPRTC_JIT_FTZ    hipJitOptionFtz
 single-precision denormals. More...
 
#define HIPRTC_JIT_PREC_DIV    hipJitOptionPrecDiv
 
#define HIPRTC_JIT_PREC_SQRT    hipJitOptionPrecSqrt
 
#define HIPRTC_JIT_FMA    hipJitOptionFma
 
#define HIPRTC_JIT_POSITION_INDEPENDENT_CODE    hipJitOptionPositionIndependentCode
 Position Independent code. More...
 
#define HIPRTC_JIT_MIN_CTA_PER_SM    hipJitOptionMinCTAPerSM
 
#define HIPRTC_JIT_MAX_THREADS_PER_BLOCK    hipJitOptionMaxThreadsPerBlock
 threads in a thread block More...
 
#define HIPRTC_JIT_OVERRIDE_DIRECT_VALUES    hipJitOptionOverrideDirectiveValues
 Values. More...
 
#define HIPRTC_JIT_NUM_OPTIONS   hipJitOptionNumOptions
 Number of options. More...
 
#define HIPRTC_JIT_IR_TO_ISA_OPT_EXT    hipJitOptionIRtoISAOptExt
 passed on to compiler More...
 
#define HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT    hipJitOptionIRtoISAOptCountExt
 to be passed on to More...
 
#define hiprtcJITInputType   hipJitInputType
 
#define HIPRTC_JIT_INPUT_CUBIN   hipJitInputCubin
 Cuda only Input Cubin. More...
 
#define HIPRTC_JIT_INPUT_PTX   hipJitInputPtx
 Cuda only Input PTX. More...
 
#define HIPRTC_JIT_INPUT_FATBINARY   hipJitInputFatBinary
 Cuda Only Input FAT Binary. More...
 
#define HIPRTC_JIT_INPUT_OBJECT    hipJitInputObject
 Cuda Only Host Object with embedded device code. More...
 
#define HIPRTC_JIT_INPUT_LIBRARY    hipJitInputLibrary
 Cuda Only Archive of Host Objects with embedded device code. More...
 
#define HIPRTC_JIT_INPUT_NVVM    hipJitInputNvvm
 
#define HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES    hipJitNumLegacyInputTypes
 Count of Legacy Input Types. More...
 
#define HIPRTC_JIT_INPUT_LLVM_BITCODE    hipJitInputLLVMBitcode
 HIP Only LLVM Bitcode or IR assembly. More...
 
#define HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE    hipJitInputLLVMBundledBitcode
 HIP Only LLVM Clang Bundled Code. More...
 
#define HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE    hipJitInputLLVMArchivesOfBundledBitcode
 
#define HIPRTC_JIT_INPUT_SPIRV   hipJitInputSpirv
 HIP Only SPIRV Code Object. More...
 
#define HIPRTC_JIT_NUM_INPUT_TYPES   hipJitNumInputTypes
 Count of Input Types. More...
 

Typedefs

typedef struct ihiprtcLinkState * hiprtcLinkState
 
typedef struct _hiprtcProgram * hiprtcProgram
 

Enumerations

enum  hiprtcResult {
  HIPRTC_SUCCESS = 0 ,
  HIPRTC_ERROR_OUT_OF_MEMORY = 1 ,
  HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 ,
  HIPRTC_ERROR_INVALID_INPUT = 3 ,
  HIPRTC_ERROR_INVALID_PROGRAM = 4 ,
  HIPRTC_ERROR_INVALID_OPTION = 5 ,
  HIPRTC_ERROR_COMPILATION = 6 ,
  HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 ,
  HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 ,
  HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 ,
  HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 ,
  HIPRTC_ERROR_INTERNAL_ERROR = 11 ,
  HIPRTC_ERROR_LINKING = 100
}
 

Functions

const char * hiprtcGetErrorString (hiprtcResult result)
 Returns text string message to explain the error which occurred. More...
 
hiprtcResult hiprtcVersion (int *major, int *minor)
 Sets the parameters as major and minor version. More...
 
hiprtcResult hiprtcAddNameExpression (hiprtcProgram prog, const char *name_expression)
 Adds the given name exprssion to the runtime compilation program. More...
 
hiprtcResult hiprtcCompileProgram (hiprtcProgram prog, int numOptions, const char *const *options)
 Compiles the given runtime compilation program. More...
 
hiprtcResult hiprtcCreateProgram (hiprtcProgram *prog, const char *src, const char *name, int numHeaders, const char *const *headers, const char *const *includeNames)
 Creates an instance of hiprtcProgram with the given input parameters, and sets the output hiprtcProgram prog with it. More...
 
hiprtcResult hiprtcDestroyProgram (hiprtcProgram *prog)
 Destroys an instance of given hiprtcProgram. More...
 
hiprtcResult hiprtcGetLoweredName (hiprtcProgram prog, const char *name_expression, const char **lowered_name)
 Gets the lowered (mangled) name from an instance of hiprtcProgram with the given input parameters, and sets the output lowered_name with it. More...
 
hiprtcResult hiprtcGetProgramLog (hiprtcProgram prog, char *log)
 Gets the log generated by the runtime compilation program instance. More...
 
hiprtcResult hiprtcGetProgramLogSize (hiprtcProgram prog, size_t *logSizeRet)
 Gets the size of log generated by the runtime compilation program instance. More...
 
hiprtcResult hiprtcGetCode (hiprtcProgram prog, char *code)
 Gets the pointer of compilation binary by the runtime compilation program instance. More...
 
hiprtcResult hiprtcGetCodeSize (hiprtcProgram prog, size_t *codeSizeRet)
 Gets the size of compilation binary by the runtime compilation program instance. More...
 
hiprtcResult hiprtcGetBitcode (hiprtcProgram prog, char *bitcode)
 Gets the pointer of compiled bitcode by the runtime compilation program instance. More...
 
hiprtcResult hiprtcGetBitcodeSize (hiprtcProgram prog, size_t *bitcode_size)
 Gets the size of compiled bitcode by the runtime compilation program instance. More...
 
hiprtcResult hiprtcLinkCreate (unsigned int num_options, hiprtcJIT_option *option_ptr, void **option_vals_pptr, hiprtcLinkState *hip_link_state_ptr)
 Creates the link instance via hiprtc APIs. More...
 
hiprtcResult hiprtcLinkAddFile (hiprtcLinkState hip_link_state, hiprtcJITInputType input_type, const char *file_path, unsigned int num_options, hiprtcJIT_option *options_ptr, void **option_values)
 Adds a file with bit code to be linked with options. More...
 
hiprtcResult hiprtcLinkAddData (hiprtcLinkState hip_link_state, hiprtcJITInputType input_type, void *image, size_t image_size, const char *name, unsigned int num_options, hiprtcJIT_option *options_ptr, void **option_values)
 Completes the linking of the given program. More...
 
hiprtcResult hiprtcLinkComplete (hiprtcLinkState hip_link_state, void **bin_out, size_t *size_out)
 Completes the linking of the given program. More...
 
hiprtcResult hiprtcLinkDestroy (hiprtcLinkState hip_link_state)
 Deletes the link instance via hiprtc APIs. More...
 

Typedef Documentation

◆ hiprtcLinkState

typedef struct ihiprtcLinkState* hiprtcLinkState

hiprtc link state

◆ hiprtcProgram

typedef struct _hiprtcProgram* hiprtcProgram

hiprtc program

Function Documentation

◆ hiprtcGetBitcode()

hiprtcResult hiprtcGetBitcode ( hiprtcProgram  prog,
char *  bitcode 
)

Gets the pointer of compiled bitcode by the runtime compilation program instance.

Parameters
[in]progruntime compilation program instance.
[out]bitcodechar pointer to bitcode.
Returns
HIPRTC_SUCCESS
See also
hiprtcResult

◆ hiprtcGetProgramLogSize()

hiprtcResult hiprtcGetProgramLogSize ( hiprtcProgram  prog,
size_t *  logSizeRet 
)

Gets the size of log generated by the runtime compilation program instance.

Parameters
[in]progruntime compilation program instance.
[out]logSizeRetsize of generated log.
Returns
HIPRTC_SUCCESS
See also
hiprtcResult