1use super::types::*;
2
3use core::ffi::*;
4
5link! {
6 hiprtc : [7, 8, 9, 10] : rocm_ver;
7
8 #[doc = "In HIP, this function returns the name of the error, if the hiprtc result is defined, it will return “Invalid HIPRTC error code”"]
9 pub fn hiprtcGetErrorString(result: hiprtcResult) -> *const c_char;
10
11 pub fn hiprtcVersion(
12 major: *mut c_int,
13 minor: *mut c_int,
14 ) -> hiprtcResult;
15
16 pub fn hiprtcAddNameExpression(
17 prog: hiprtcProgram,
18 name_expression: *const c_char,
19 ) -> hiprtcResult;
20
21 pub fn hiprtcCompileProgram(
22 prog: hiprtcProgram,
23 numOptions: c_int,
24 options: *const c_char,
25 ) -> hiprtcResult;
26
27 pub fn hiprtcCreateProgram(
28 prog: *mut hiprtcProgram,
29 src: *const c_char,
30 name: *const c_char,
31 numHeaders: c_int,
32 headers: *const *const c_char,
33 includeNames: *const *const c_char,
34 ) -> hiprtcResult;
35
36 pub fn hiprtcDestroyProgram(prog: *mut hiprtcProgram) -> hiprtcResult;
37
38 pub fn hiprtcGetLoweredName(
39 prog: hiprtcProgram,
40 name_expression: *const c_char,
41 lowered_name: *mut *const c_char,
42 ) -> hiprtcResult;
43
44 pub fn hiprtcGetProgramLog(
45 prog: hiprtcProgram,
46 log: *mut c_char,
47 ) -> hiprtcResult;
48
49 pub fn hiprtcGetCode(
50 prog: hiprtcProgram,
51 code: *mut c_char,
52 ) -> hiprtcResult;
53
54 pub fn hiprtcGetCodeSize(
55 prog: hiprtcProgram,
56 codeSizeRet: *mut usize,
57 ) -> hiprtcResult;
58
59 pub fn hiprtcGetBitcode(
60 prog: hiprtcProgram,
61 bitcode: *mut c_char,
62 ) -> hiprtcResult;
63
64 pub fn hiprtcGetBitcodeSize(
65 prog: hiprtcProgram,
66 bitcode_size: *mut usize,
67 ) -> hiprtcResult;
68
69 pub fn hiprtcLinkCreate(
70 num_options: c_uint,
71 options_ptr: *mut hipJitOption,
72 option_vals_pptr: *mut *mut c_void,
73 hip_link_state_ptr: *mut hiprtcLinkState,
74 ) -> hiprtcResult;
75
76 pub fn hiprtcLinkAddFile(
77 hip_link_state: hiprtcLinkState,
78 input_type: hipJitInputType,
79 file_path: *const c_char,
80 num_options: c_uint,
81 options_ptr: *mut hipJitOption,
82 option_values: *mut *mut c_void,
83 ) -> hiprtcResult;
84
85 pub fn hiprtcLinkAddData(
86 hip_link_state: hiprtcLinkState,
87 input_type: hipJitInputType,
88 image: *mut c_void,
89 image_size: usize,
90 name: *const c_char,
91 num_options: c_uint,
92 options_ptr: *mut hipJitOption,
93 option_values: *mut *mut c_void,
94 ) -> hiprtcResult;
95
96 pub fn hiprtcLinkComplete(
97 hip_link_state: hiprtcLinkState,
98 bin_out: *mut *mut c_void,
99 size_out: *mut usize,
100 ) -> hiprtcResult;
101
102 pub fn hiprtcLinkDestroy(hip_link_state: hiprtcLinkState) -> hiprtcResult;
103
104 pub fn hiprtcGetProgramLogSize(
105 proog: hiprtcProgram,
106 logSizeRet: *mut usize,
107 ) -> hiprtcResult;
108}