Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed Mar 26, 2024
1 parent 931dde4 commit 67a0382
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/data_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ impl<A> OwnedRepr<A> {
// let mut self_ = ManuallyDrop::new(self);
// self_.device = device;

let len = self.len;
let capacity = self.capacity;

match (self.device, device) {
(Device::Host, Device::Host) => {
// println!("Copying to Host");
Expand All @@ -71,7 +68,9 @@ impl<A> OwnedRepr<A> {

#[cfg(feature = "opencl")]
(Device::Host, Device::OpenCL) => {
let bytes = std::mem::size_of::<A>() * self.capacity;
let len = self.len;
let capacity = self.capacity;
let bytes = std::mem::size_of::<A>() * capacity;

unsafe {
if let Ok(buffer) =
Expand Down Expand Up @@ -102,6 +101,8 @@ impl<A> OwnedRepr<A> {

#[cfg(feature = "opencl")]
(Device::OpenCL, Device::Host) => {
let len = self.len;
let capacity = self.capacity;
let bytes = std::mem::size_of::<A>() * capacity;

unsafe {
Expand Down Expand Up @@ -327,8 +328,7 @@ impl<A> OwnedRepr<A> {
}

impl<A> Clone for OwnedRepr<A>
where
A: Clone,
where A: Clone
{
fn clone(&self) -> Self {
match self.device {
Expand Down

0 comments on commit 67a0382

Please sign in to comment.