/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hiprtc.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hiprtc.h Source File#

HIP Runtime API Reference: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/docs-5.0.2/include/hip/hiprtc.h Source File
hiprtc.h
Go to the documentation of this file.
1/*
2Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22#pragma once
23
24#include <hip/hip_common.h>
25
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__))
29
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
40#include <stdlib.h>
41
42#if !defined(_WIN32)
43#pragma GCC visibility push (default)
44#endif
45
66
79
87hiprtcResult hiprtcVersion(int* major, int* minor);
88
89typedef struct _hiprtcProgram* hiprtcProgram;
90
103 const char* name_expression);
104
119 int numOptions,
120 const char** options);
121
142 const char* src,
143 const char* name,
144 int numHeaders,
145 const char** headers,
146 const char** includeNames);
147
159
178 const char* name_expression,
179 const char** lowered_name);
180
191
202 size_t* logSizeRet);
203
214
225
226#if !defined(_WIN32)
227#pragma GCC visibility pop
228#endif
229
230#ifdef __cplusplus
231}
232#endif /* __cplusplus */
233// doxygen end HIPrtc feature
237#else
238#error("Must define exactly one of __HIP_PLATFORM_AMD__ or __HIP_PLATFORM_NVIDIA__");
239#endif
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
Definition hiprtc.h:52
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.
struct _hiprtcProgram * hiprtcProgram
Definition hiprtc.h:89
hiprtcResult hiprtcVersion(int *major, int *minor)
Sets the parameters as major and minor version.
@ HIPRTC_ERROR_PROGRAM_CREATION_FAILURE
Definition hiprtc.h:55
@ HIPRTC_ERROR_INVALID_PROGRAM
Definition hiprtc.h:57
@ HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION
Definition hiprtc.h:61
@ HIPRTC_ERROR_INVALID_OPTION
Definition hiprtc.h:58
@ HIPRTC_ERROR_INVALID_INPUT
Definition hiprtc.h:56
@ HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID
Definition hiprtc.h:63
@ HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION
Definition hiprtc.h:62
@ HIPRTC_SUCCESS
Definition hiprtc.h:53
@ HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE
Definition hiprtc.h:60
@ HIPRTC_ERROR_INTERNAL_ERROR
Definition hiprtc.h:64
@ HIPRTC_ERROR_COMPILATION
Definition hiprtc.h:59
@ HIPRTC_ERROR_OUT_OF_MEMORY
Definition hiprtc.h:54