Skip to content

Commit 3f0759a

Browse files
committed
Use ffi::c_char to fix arm64
1 parent 33664c0 commit 3f0759a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

crates/ptx_compiler/src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Raw and High level bindings to the CUDA NVPTX compiler used to compile PTX to
22
//! cubin files.
33
4+
use std::ffi::c_char;
45
use std::mem::MaybeUninit;
56

67
use cust_raw::nvptx_compiler_sys;
@@ -101,8 +102,11 @@ impl CompilerFailure {
101102
.to_result()?;
102103
let size = size.assume_init();
103104
let mut vec = Vec::with_capacity(size);
104-
nvptx_compiler_sys::nvPTXCompilerGetErrorLog(self.handle, vec.as_mut_ptr() as *mut i8)
105-
.to_result()?;
105+
nvptx_compiler_sys::nvPTXCompilerGetErrorLog(
106+
self.handle,
107+
vec.as_mut_ptr() as *mut c_char,
108+
)
109+
.to_result()?;
106110
vec.set_len(size);
107111
Ok(String::from_utf8_lossy(&vec).to_string())
108112
}
@@ -134,8 +138,11 @@ impl CompiledProgram {
134138
.to_result()?;
135139
let size = size.assume_init();
136140
let mut vec = Vec::with_capacity(size);
137-
nvptx_compiler_sys::nvPTXCompilerGetInfoLog(self.handle, vec.as_mut_ptr() as *mut i8)
138-
.to_result()?;
141+
nvptx_compiler_sys::nvPTXCompilerGetInfoLog(
142+
self.handle,
143+
vec.as_mut_ptr() as *mut c_char,
144+
)
145+
.to_result()?;
139146
vec.set_len(size);
140147
Ok(String::from_utf8_lossy(&vec).to_string())
141148
}

0 commit comments

Comments
 (0)