Skip to content

Commit

Permalink
Revert explicit register fit for Device[Const|Mut]Ref
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed May 9, 2023
1 parent 626cd48 commit 7a8292f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/safety/register_fit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ pub trait FitsIntoDeviceRegister: private::FitsIntoDeviceRegister {}
impl<T: private::FitsIntoDeviceRegister> FitsIntoDeviceRegister for T {}

mod private {
#[marker]
pub trait FitsIntoDeviceRegister {}
impl<T> FitsIntoDeviceRegister for T where
AssertTypeFitsInto64Bits<{ TypeSize::check::<T>() }>: FitsInto64Bits
{
}

// Since T: Sized, the pointers are thin, and must thus fit into device
// registers
impl<'r, T: rustacuda_core::DeviceCopy + 'r> FitsIntoDeviceRegister
for crate::common::DeviceConstRef<'r, T>
{
}
impl<'r, T: rustacuda_core::DeviceCopy + 'r> FitsIntoDeviceRegister
for crate::common::DeviceMutRef<'r, T>
{
}

#[derive(PartialEq, Eq)]
pub enum TypeSize {
TypeFitsInto64Bits,
Expand Down

0 comments on commit 7a8292f

Please sign in to comment.