Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 1 addition & 13 deletions rustacuda_core/src/memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,8 @@ unsafe impl<L: DeviceCopy, R: DeviceCopy> DeviceCopy for Result<L, R> {}
unsafe impl<T: ?Sized + DeviceCopy> DeviceCopy for PhantomData<T> {}
unsafe impl<T: DeviceCopy> DeviceCopy for Wrapping<T> {}

macro_rules! impl_device_copy_array {
($($n:expr)*) => {
$(
unsafe impl<T: DeviceCopy> DeviceCopy for [T;$ n] {}
)*
}
}
unsafe impl<T: DeviceCopy, const N: usize> DeviceCopy for [T; N] {}

impl_device_copy_array! {
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32
}
unsafe impl DeviceCopy for () {}
unsafe impl<A: DeviceCopy, B: DeviceCopy> DeviceCopy for (A, B) {}
unsafe impl<A: DeviceCopy, B: DeviceCopy, C: DeviceCopy> DeviceCopy for (A, B, C) {}
Expand Down
2 changes: 1 addition & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl Device {
/// ```
pub fn uuid(self) -> CudaResult<[u8; 16]> {
unsafe {
let mut cu_uuid = CUuuid { bytes: [0i8; 16] };
let mut cu_uuid = CUuuid { bytes: [0; 16] };
cuDeviceGetUuid(&mut cu_uuid, self.device).to_result()?;
let uuid: [u8; 16] = ::std::mem::transmute(cu_uuid.bytes);
Ok(uuid)
Expand Down