Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RustaCUDA doesn't build on ARMv8 #65

Open
jswang opened this issue Feb 8, 2022 · 0 comments
Open

RustaCUDA doesn't build on ARMv8 #65

jswang opened this issue Feb 8, 2022 · 0 comments

Comments

@jswang
Copy link

jswang commented Feb 8, 2022

Background

Building RustaCUDA version 0.1.3 yields the following error when building on ARMv8:

error[E0308]: mismatched types
   --> /home/root/.cargo/registry/src/github.com-1ecc6299db9ec823/rustacuda-0.1.3/src/device.rs:376:48
    |
376 |             let mut cu_uuid = CUuuid { bytes: [0i8; 16] };
    |                                                ^^^ expected `u8`, found `i8`
    |
help: change the type of the numeric literal from `i8` to `u8`
    |
376 |             let mut cu_uuid = CUuuid { bytes: [0u8; 16] };
    |                                                 ~~

In the cuda_runtime.rs bindings and in the cuda.rs bindings from cuda-sys, these structs are raw c_char's:
cuda_runtime.rs:

#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUuuid_st {
    pub bytes: [::std::os::raw::c_char; 16usize],
}

cuda.rs

#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUuuid_st {
    pub bytes: [::std::os::raw::c_char; 16usize],
}

Note that this doesn't happen when building on x86.

Proposed fix:

Change to u8 as suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant