From bc919b9bb2286e2221f98f1caa8f0c4071280f52 Mon Sep 17 00:00:00 2001 From: aeon Date: Mon, 14 Feb 2022 01:46:03 +0800 Subject: [PATCH] Fix compile error on aarch64/arm architectures --- src/device.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.rs b/src/device.rs index b30796c..da73106 100644 --- a/src/device.rs +++ b/src/device.rs @@ -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)] @@ -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)