-- GENERATED by C->Haskell Compiler, version 0.28.2 Switcheroo, 1 April 2016 (Haskell)
-- Edit the ORIGNAL .chs file instead!


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

module Foreign.CUDA.Solver.Sparse.Stream (

  setStream,

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



import Foreign.CUDA.Driver.Stream
import Foreign.CUDA.Solver.Error
import Foreign.CUDA.Solver.Sparse.Context

import Foreign.C
import Foreign.Ptr



{-# LINE 27 "./Foreign/CUDA/Solver/Sparse/Stream.chs" #-}



-- | Sets the execution stream which all subsequent cuSolverSp library functions
-- will execute with. If not set, functions execute in the default stream (which
-- never overlaps any other operations).
--
-- <http://docs.nvidia.com/cuda/cusolver/index.html#cusparsesetstream>
--
{-# 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 >>= \res' ->
  return (res')

{-# LINE 41 "./Foreign/CUDA/Solver/Sparse/Stream.chs" #-}



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