{-# LINE 1 "src/Foreign/CUDA/Driver/Utils.chs" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module Foreign.CUDA.Driver.Utils (
driverVersion,
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp
{-# LINE 19 "src/Foreign/CUDA/Driver/Utils.chs" #-}
import Foreign.CUDA.Driver.Error
import Foreign.CUDA.Internal.C2HS
import Foreign
import Foreign.C
{-# INLINEABLE driverVersion #-}
driverVersion :: IO Int
driverVersion = resultIfOk =<< cuDriverGetVersion
{-# INLINE cuDriverGetVersion #-}
cuDriverGetVersion :: IO ((Status), (Int))
cuDriverGetVersion =
alloca $ \a1' ->
cuDriverGetVersion'_ a1' >>= \res ->
let {res' = cToEnum res} in
peekIntConv a1'>>= \a1'' ->
return (res', a1'')
{-# LINE 39 "src/Foreign/CUDA/Driver/Utils.chs" #-}
foreign import ccall unsafe "Foreign/CUDA/Driver/Utils.chs.h cuDriverGetVersion"
cuDriverGetVersion'_ :: ((C2HSImp.Ptr C2HSImp.CInt) -> (IO C2HSImp.CInt))