bheisler / RustaCUDA

Rusty wrapper for the CUDA Driver API
Apache License 2.0
758 stars 60 forks source link

Fix compile error on ppc64 architecture #31

Closed LutzCle closed 5 years ago

LutzCle commented 5 years ago

RustaCUDA currently doesn't compile on PPC64 architecture. The reason is that, according to the Rust documentation, std::os::raw::c_char can be defined in one of two ways: either as i8, or as u8.

Coincidentally, x86_64 defines it as i8, whereas PPC64 defines it as u8. This difference breaks the type cast in device::Device::name.

Casting to c_char instead of i8 solves the problem. With this fix, RustaCUDA compiles on PPC64.

bheisler commented 5 years ago

Huh, I didn't know about that. Useful to know, when you're writing a C-interop library. Thanks for the pull request (and thanks for your patience).

LutzCle commented 5 years ago

Yeah, I didn't know either, until it didn't compile. The rest of RustaCUDA seems solid so far, though. Thanks for the merge :-)