 --
 allocaBytes :: Int64 -> (DevicePtr a -> IO b) -> IO b
 allocaBytes bytes =
-    bracket (moduleForceEither `fmap` malloc bytes) free
+  bracket (malloc bytes) free
 
 
 -- |

       -> Ptr a                 -- ^ source
       -> Int64                 -- ^ number of bytes
       -> CopyDirection
       -> IO (Maybe String)
memcpy dst src bytes dir =
    nothingIfOk `fmap` cudaMemcpy dst src bytes dir

{# fun unsafe cudaMemcpy
    { castPtr   `Ptr a'         ,
      castPtr   `Ptr a'         ,
      cIntConv  `Int64'         ,
      cFromEnum `CopyDirection' } -> `Status' cToEnum #}


{-

memset :: DevicePtr a                   -- ^ The device memory
       -> Int64                         -- ^ Number of bytes
       -> Int                           -- ^ Value to set for each byte
       -> IO ()
memset ptr bytes symbol =
  nothingIfOk =<< cudaMemset ptr symbol bytes

{# fun unsafe cudaMemset
  { withDevPtrCast* `DevicePtr a'
  ,                 `Int'
  , cIntConv        `Int64'       } -> `Status' cToEnum #}
  where
    withDevPtrCast = withDevicePtr . castDevicePtr


-- |
