24#include <hip/hip_common.h>
26#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
27 #include <hip/nvidia_detail/nvidia_hiprtc.h>
28#elif (defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && !(defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__))
43#pragma GCC visibility push (default)
52typedef enum hiprtcResult {
54 HIPRTC_ERROR_OUT_OF_MEMORY = 1,
55 HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
56 HIPRTC_ERROR_INVALID_INPUT = 3,
57 HIPRTC_ERROR_INVALID_PROGRAM = 4,
58 HIPRTC_ERROR_INVALID_OPTION = 5,
59 HIPRTC_ERROR_COMPILATION = 6,
60 HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
61 HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
62 HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
63 HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
64 HIPRTC_ERROR_INTERNAL_ERROR = 11
89typedef struct _hiprtcProgram* hiprtcProgram;
103 const char* name_expression);
120 const char** options);
145 const char** headers,
146 const char** includeNames);
178 const char* name_expression,
179 const char** lowered_name);
227#pragma GCC visibility pop
238#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
hiprtcResult hiprtcGetProgramLogSize(hiprtcProgram prog, size_t *logSizeRet)
Gets the size of log generated by the runtime compilation program instance.
hiprtcResult hiprtcAddNameExpression(hiprtcProgram prog, const char *name_expression)
Adds the given name exprssion to the runtime compilation program.
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,...
const char * hiprtcGetErrorString(hiprtcResult result)
Returns text string message to explain the error which occurred.
hiprtcResult hiprtcCreateProgram(hiprtcProgram *prog, const char *src, const char *name, int numHeaders, const char **headers, const char **includeNames)
Creates an instance of hiprtcProgram with the given input parameters, and sets the output hiprtcProgr...
hiprtcResult hiprtcGetCodeSize(hiprtcProgram prog, size_t *codeSizeRet)
Gets the size of compilation binary by the runtime compilation program instance.
hiprtcResult hiprtcGetProgramLog(hiprtcProgram prog, char *log)
Gets the log generated by the runtime compilation program instance.
hiprtcResult hiprtcCompileProgram(hiprtcProgram prog, int numOptions, const char **options)
Compiles the given runtime compilation program.
hiprtcResult hiprtcDestroyProgram(hiprtcProgram *prog)
Destroys an instance of given hiprtcProgram.
hiprtcResult hiprtcGetCode(hiprtcProgram prog, char *code)
Gets the pointer of compilation binary by the runtime compilation program instance.
hiprtcResult hiprtcVersion(int *major, int *minor)
Sets the parameters as major and minor version.