Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/cufile/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ pub unsafe fn read(
file_offset: i64,
buf_ptr_offset: i64,
) -> Result<isize, CufileError> {
let bytes_read = sys::cuFileRead(fh, buf_ptr_base, size, file_offset, buf_ptr_offset);
let bytes_read = sys::cuFileRead(
fh,
buf_ptr_base,
size,
file_offset as _,
buf_ptr_offset as _,
);
Comment thread
chelsea0x3b marked this conversation as resolved.
Outdated

if bytes_read == -1 {
Err(CufileError::IO(std::io::Error::last_os_error()))
Expand All @@ -126,7 +132,13 @@ pub unsafe fn write(
file_offset: i64,
buf_ptr_offset: i64,
) -> Result<isize, CufileError> {
let bytes_written = sys::cuFileWrite(fh, buf_ptr_base, size, file_offset, buf_ptr_offset);
let bytes_written = sys::cuFileWrite(
fh,
buf_ptr_base,
size,
file_offset as _,
buf_ptr_offset as _,
);
Comment thread
chelsea0x3b marked this conversation as resolved.
Outdated

if bytes_written == -1 {
Err(CufileError::IO(std::io::Error::last_os_error()))
Expand Down
8 changes: 7 additions & 1 deletion src/cufile/safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ impl Cufile {

// NOTE: placeholder, shouldn't ever reach this
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
let descr = Default::default();
let descr = sys::CUfileDescr_t {
type_: sys::CUfileFileHandleType::CU_FILE_HANDLE_TYPE_USERSPACE_FS,
handle: sys::CUfileDescr_t__bindgen_ty_1 {
handle: std::ptr::null_mut(),
},
fs_ops: std::ptr::null(),
};

let handle = result::handle_register(&descr)?;

Expand Down
Loading