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

Fix compile error on aarch64/arm architectures (resolves #65) #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::error::{CudaResult, ToResult};
use cuda_driver_sys::*;
use std::ffi::CStr;
use std::ops::Range;
use std::os::raw::c_char;

/// All supported device attributes for [Device::get_attribute](struct.Device.html#method.get_attribute)
#[repr(u32)]
Expand Down Expand Up @@ -373,7 +374,9 @@ impl Device {
/// ```
pub fn uuid(self) -> CudaResult<[u8; 16]> {
unsafe {
let mut cu_uuid = CUuuid { bytes: [0i8; 16] };
let mut cu_uuid = CUuuid {
bytes: [0usize as c_char; 16],
};
cuDeviceGetUuid(&mut cu_uuid, self.device).to_result()?;
let uuid: [u8; 16] = ::std::mem::transmute(cu_uuid.bytes);
Ok(uuid)
Expand Down