-- GENERATED by C->Haskell Compiler, version 0.28.6 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./Foreign/CUDA/FFT/Stream.chs" #-}
{-# LANGUAGE CPP                      #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-- |
-- Module      : Foreign.CUDA.FFT.Stream
-- Copyright   : [2013..2018] Robert Clifton-Everest, Trevor L. McDonell
-- License     : BSD3
--
-- Maintainer  : Trevor L. McDonell <tmcdonell@cse.unsw.edu.au>
-- Stability   : experimental
-- Portability : non-portable (GHC extensions)
--

module Foreign.CUDA.FFT.Stream (

  Stream,
  setStream,

) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp



-- friends
import Foreign.CUDA.Driver.Stream                         ( Stream(..) )
import Foreign.CUDA.FFT.Plan
import Foreign.CUDA.FFT.Error
import Foreign.CUDA.FFT.Internal.C2HS

-- system
import Foreign
import Foreign.C



{-# LINE 31 "./Foreign/CUDA/FFT/Stream.chs" #-}



-- | Set the execution stream which all subsequent cuFFT library functions will
-- execute with. This enables the activity in this execution stream (e.g. kernel
-- launches and data transfer) to overlap with activity in other execution
-- streams. The association remains until the plan is destroyed or the stream is
-- changed.
--
-- If not set, functions execute in the default stream, which never overlaps
-- with any other operation.
--
-- <http://docs.nvidia.com/cuda/cufft/index.html#function-cufftsetstream>
--
{-# INLINEABLE setStream #-}
setStream :: (Handle) -> (Stream) -> IO ()
setStream a1 a2 =
  let {a1' = useHandle a1} in 
  let {a2' = useStream a2} in 
  setStream'_ a1' a2' >>= \res ->
  checkStatus res >> 
  return ()

{-# LINE 50 "./Foreign/CUDA/FFT/Stream.chs" #-}



foreign import ccall unsafe "Foreign/CUDA/FFT/Stream.chs.h cufftSetStream"
  setStream'_ :: (C2HSImp.CInt -> ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt)))