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


{-# LINE 1 "./Foreign/CUDA/BLAS/Stream.chs" #-}
{-# LANGUAGE CPP                      #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-- |
-- Module      : Foreign.CUDA.BLAS.Stream
-- Copyright   : [2014..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.BLAS.Stream (

  setStream,

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



import Foreign.CUDA.Driver.Stream
import Foreign.CUDA.BLAS.Error
import Foreign.CUDA.BLAS.Internal.C2HS
import Foreign.CUDA.BLAS.Internal.Types

import Foreign.C
import Foreign.Ptr



{-# LINE 28 "./Foreign/CUDA/BLAS/Stream.chs" #-}



-- | Sets the execution stream which all subsequent cuBLAS 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/cublas/index.html#cublassetstream>
--
{-# 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 42 "./Foreign/CUDA/BLAS/Stream.chs" #-}



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