Skip to content

Fix for PowerPC; impl<T: DeviceCopy, const N: usize> DeviceCopy for [T; N] #54

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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