{-# language CPP #-}
module Vulkan.Extensions.VK_NVX_binary_import ( createCuModuleNVX
, withCuModuleNVX
, createCuFunctionNVX
, withCuFunctionNVX
, destroyCuModuleNVX
, destroyCuFunctionNVX
, cmdCuLaunchKernelNVX
, CuModuleCreateInfoNVX(..)
, CuModuleTexturingModeCreateInfoNVX(..)
, CuFunctionCreateInfoNVX(..)
, CuLaunchInfoNVX(..)
, NVX_BINARY_IMPORT_SPEC_VERSION
, pattern NVX_BINARY_IMPORT_SPEC_VERSION
, NVX_BINARY_IMPORT_EXTENSION_NAME
, pattern NVX_BINARY_IMPORT_EXTENSION_NAME
, CuModuleNVX(..)
, CuFunctionNVX(..)
, DebugReportObjectTypeEXT(..)
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.ByteString (packCString)
import Data.ByteString (useAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Word (Word64)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Extensions.Handles (CuFunctionNVX)
import Vulkan.Extensions.Handles (CuFunctionNVX(..))
import Vulkan.Extensions.Handles (CuModuleNVX)
import Vulkan.Extensions.Handles (CuModuleNVX(..))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCuLaunchKernelNVX))
import Vulkan.Dynamic (DeviceCmds(pVkCreateCuFunctionNVX))
import Vulkan.Dynamic (DeviceCmds(pVkCreateCuModuleNVX))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyCuFunctionNVX))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyCuModuleNVX))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (CuFunctionNVX(..))
import Vulkan.Extensions.Handles (CuModuleNVX(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateCuModuleNVX
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct CuModuleCreateInfoNVX) -> Ptr AllocationCallbacks -> Ptr CuModuleNVX -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct CuModuleCreateInfoNVX) -> Ptr AllocationCallbacks -> Ptr CuModuleNVX -> IO Result
createCuModuleNVX :: forall a io
. (Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io)
=>
Device
->
(CuModuleCreateInfoNVX a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (CuModuleNVX)
createCuModuleNVX :: forall (a :: [*]) (io :: * -> *).
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
createCuModuleNVX Device
device CuModuleCreateInfoNVX a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO CuModuleNVX -> io CuModuleNVX
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CuModuleNVX -> io CuModuleNVX)
-> (ContT CuModuleNVX IO CuModuleNVX -> IO CuModuleNVX)
-> ContT CuModuleNVX IO CuModuleNVX
-> io CuModuleNVX
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT CuModuleNVX IO CuModuleNVX -> IO CuModuleNVX
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT CuModuleNVX IO CuModuleNVX -> io CuModuleNVX)
-> ContT CuModuleNVX IO CuModuleNVX -> io CuModuleNVX
forall a b. (a -> b) -> a -> b
$ do
let vkCreateCuModuleNVXPtr :: FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
vkCreateCuModuleNVXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
pVkCreateCuModuleNVX (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT CuModuleNVX IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT CuModuleNVX m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT CuModuleNVX IO ())
-> IO () -> ContT CuModuleNVX IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
vkCreateCuModuleNVXPtr FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateCuModuleNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateCuModuleNVX' :: Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result
vkCreateCuModuleNVX' = FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result
mkVkCreateCuModuleNVX FunPtr
(Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result)
vkCreateCuModuleNVXPtr
pCreateInfo <- ((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
-> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
-> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a)))
-> ((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
-> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a))
forall a b. (a -> b) -> a -> b
$ CuModuleCreateInfoNVX a
-> (Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
-> IO CuModuleNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CuModuleCreateInfoNVX a
-> (Ptr (CuModuleCreateInfoNVX a) -> IO b) -> IO b
withCStruct (CuModuleCreateInfoNVX a
createInfo)
pAllocator <- case (allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall a. a -> ContT CuModuleNVX IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
pPModule <- ContT $ bracket (callocBytes @CuModuleNVX 8) free
r <- lift $ traceAroundEvent "vkCreateCuModuleNVX" (vkCreateCuModuleNVX'
(deviceHandle (device))
(forgetExtensions pCreateInfo)
pAllocator
(pPModule))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pModule <- lift $ peek @CuModuleNVX pPModule
pure $ (pModule)
withCuModuleNVX :: forall a io r . (Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) => Device -> CuModuleCreateInfoNVX a -> Maybe AllocationCallbacks -> (io CuModuleNVX -> (CuModuleNVX -> io ()) -> r) -> r
withCuModuleNVX :: forall (a :: [*]) (io :: * -> *) r.
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io CuModuleNVX -> (CuModuleNVX -> io ()) -> r)
-> r
withCuModuleNVX Device
device CuModuleCreateInfoNVX a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io CuModuleNVX -> (CuModuleNVX -> io ()) -> r
b =
io CuModuleNVX -> (CuModuleNVX -> io ()) -> r
b (Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
forall (a :: [*]) (io :: * -> *).
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
createCuModuleNVX Device
device CuModuleCreateInfoNVX a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(CuModuleNVX
o0) -> Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuModuleNVX Device
device CuModuleNVX
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateCuFunctionNVX
:: FunPtr (Ptr Device_T -> Ptr CuFunctionCreateInfoNVX -> Ptr AllocationCallbacks -> Ptr CuFunctionNVX -> IO Result) -> Ptr Device_T -> Ptr CuFunctionCreateInfoNVX -> Ptr AllocationCallbacks -> Ptr CuFunctionNVX -> IO Result
createCuFunctionNVX :: forall io
. (MonadIO io)
=>
Device
->
CuFunctionCreateInfoNVX
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (CuFunctionNVX)
createCuFunctionNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
createCuFunctionNVX Device
device CuFunctionCreateInfoNVX
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO CuFunctionNVX -> io CuFunctionNVX
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CuFunctionNVX -> io CuFunctionNVX)
-> (ContT CuFunctionNVX IO CuFunctionNVX -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO CuFunctionNVX
-> io CuFunctionNVX
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT CuFunctionNVX IO CuFunctionNVX -> IO CuFunctionNVX
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT CuFunctionNVX IO CuFunctionNVX -> io CuFunctionNVX)
-> ContT CuFunctionNVX IO CuFunctionNVX -> io CuFunctionNVX
forall a b. (a -> b) -> a -> b
$ do
let vkCreateCuFunctionNVXPtr :: FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
vkCreateCuFunctionNVXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
pVkCreateCuFunctionNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT CuFunctionNVX IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT CuFunctionNVX m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT CuFunctionNVX IO ())
-> IO () -> ContT CuFunctionNVX IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
vkCreateCuFunctionNVXPtr FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateCuFunctionNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateCuFunctionNVX' :: Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result
vkCreateCuFunctionNVX' = FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
-> Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result
mkVkCreateCuFunctionNVX FunPtr
(Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result)
vkCreateCuFunctionNVXPtr
pCreateInfo <- ((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
-> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
-> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX))
-> ((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
-> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX)
forall a b. (a -> b) -> a -> b
$ CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
-> IO CuFunctionNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
withCStruct (CuFunctionCreateInfoNVX
createInfo)
pAllocator <- case (allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall a. a -> ContT CuFunctionNVX IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO CuFunctionNVX) -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO CuFunctionNVX)
-> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO CuFunctionNVX)
-> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO CuFunctionNVX)
-> IO CuFunctionNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
pPFunction <- ContT $ bracket (callocBytes @CuFunctionNVX 8) free
r <- lift $ traceAroundEvent "vkCreateCuFunctionNVX" (vkCreateCuFunctionNVX'
(deviceHandle (device))
pCreateInfo
pAllocator
(pPFunction))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pFunction <- lift $ peek @CuFunctionNVX pPFunction
pure $ (pFunction)
withCuFunctionNVX :: forall io r . MonadIO io => Device -> CuFunctionCreateInfoNVX -> Maybe AllocationCallbacks -> (io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r) -> r
withCuFunctionNVX :: forall (io :: * -> *) r.
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r)
-> r
withCuFunctionNVX Device
device CuFunctionCreateInfoNVX
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r
b =
io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r
b (Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
createCuFunctionNVX Device
device CuFunctionCreateInfoNVX
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(CuFunctionNVX
o0) -> Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuFunctionNVX Device
device CuFunctionNVX
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyCuModuleNVX
:: FunPtr (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()
destroyCuModuleNVX :: forall io
. (MonadIO io)
=>
Device
->
CuModuleNVX
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuModuleNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuModuleNVX Device
device CuModuleNVX
module' "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkDestroyCuModuleNVXPtr :: FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
pVkDestroyCuModuleNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyCuModuleNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyCuModuleNVX' :: Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()
vkDestroyCuModuleNVX' = FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()
mkVkDestroyCuModuleNVX FunPtr
(Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
lift $ traceAroundEvent "vkDestroyCuModuleNVX" (vkDestroyCuModuleNVX'
(deviceHandle (device))
(module')
pAllocator)
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyCuFunctionNVX
:: FunPtr (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()
destroyCuFunctionNVX :: forall io
. (MonadIO io)
=>
Device
->
CuFunctionNVX
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuFunctionNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuFunctionNVX Device
device CuFunctionNVX
function "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkDestroyCuFunctionNVXPtr :: FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
pVkDestroyCuFunctionNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyCuFunctionNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyCuFunctionNVX' :: Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()
vkDestroyCuFunctionNVX' = FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T
-> CuFunctionNVX
-> Ptr AllocationCallbacks
-> IO ()
mkVkDestroyCuFunctionNVX FunPtr
(Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
lift $ traceAroundEvent "vkDestroyCuFunctionNVX" (vkDestroyCuFunctionNVX'
(deviceHandle (device))
(function)
pAllocator)
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCuLaunchKernelNVX
:: FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()) -> Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()
cmdCuLaunchKernelNVX :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CuLaunchInfoNVX
-> io ()
cmdCuLaunchKernelNVX :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CuLaunchInfoNVX -> io ()
cmdCuLaunchKernelNVX CommandBuffer
commandBuffer CuLaunchInfoNVX
launchInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdCuLaunchKernelNVXPtr :: FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr = DeviceCmds
-> FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
pVkCmdCuLaunchKernelNVX (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdCuLaunchKernelNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdCuLaunchKernelNVX' :: Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()
vkCmdCuLaunchKernelNVX' = FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()
mkVkCmdCuLaunchKernelNVX FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr
pLaunchInfo <- ((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
-> ContT () IO (Ptr CuLaunchInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
-> ContT () IO (Ptr CuLaunchInfoNVX))
-> ((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
-> ContT () IO (Ptr CuLaunchInfoNVX)
forall a b. (a -> b) -> a -> b
$ CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b. CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
withCStruct (CuLaunchInfoNVX
launchInfo)
lift $ traceAroundEvent "vkCmdCuLaunchKernelNVX" (vkCmdCuLaunchKernelNVX'
(commandBufferHandle (commandBuffer))
pLaunchInfo)
pure $ ()
data CuModuleCreateInfoNVX (es :: [Type]) = CuModuleCreateInfoNVX
{
forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
next :: Chain es
,
forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
dataSize :: Word64
,
forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
data' :: Ptr ()
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuModuleCreateInfoNVX (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (CuModuleCreateInfoNVX es)
instance Extensible CuModuleCreateInfoNVX where
extensibleTypeName :: String
extensibleTypeName = String
"CuModuleCreateInfoNVX"
setNext :: forall (ds :: [*]) (es :: [*]).
CuModuleCreateInfoNVX ds -> Chain es -> CuModuleCreateInfoNVX es
setNext CuModuleCreateInfoNVX{Word64
Ptr ()
Chain ds
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain ds
dataSize :: Word64
data' :: Ptr ()
..} Chain es
next' = CuModuleCreateInfoNVX{next :: Chain es
next = Chain es
next', Word64
Ptr ()
dataSize :: Word64
data' :: Ptr ()
dataSize :: Word64
data' :: Ptr ()
..}
getNext :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
getNext CuModuleCreateInfoNVX{Word64
Ptr ()
Chain es
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain es
dataSize :: Word64
data' :: Ptr ()
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends CuModuleCreateInfoNVX e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends CuModuleCreateInfoNVX e => b) -> Maybe b
extends proxy e
_ Extends CuModuleCreateInfoNVX e => b
f
| Just e :~: CuModuleTexturingModeCreateInfoNVX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @CuModuleTexturingModeCreateInfoNVX = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends CuModuleCreateInfoNVX e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss CuModuleCreateInfoNVX es
, PokeChain es ) => ToCStruct (CuModuleCreateInfoNVX es) where
withCStruct :: forall b.
CuModuleCreateInfoNVX es
-> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
withCStruct CuModuleCreateInfoNVX es
x Ptr (CuModuleCreateInfoNVX es) -> IO b
f = Int -> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b)
-> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (CuModuleCreateInfoNVX es)
p -> Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
forall b.
Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (CuModuleCreateInfoNVX es)
p CuModuleCreateInfoNVX es
x (Ptr (CuModuleCreateInfoNVX es) -> IO b
f Ptr (CuModuleCreateInfoNVX es)
p)
pokeCStruct :: forall b.
Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
pokeCStruct Ptr (CuModuleCreateInfoNVX es)
p CuModuleCreateInfoNVX{Word64
Ptr ()
Chain es
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain es
dataSize :: Word64
data' :: Ptr ()
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX)
pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
lift $ poke ((p `plusPtr` 16 :: Ptr CSize)) (CSize (dataSize))
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ()))) (data')
lift $ f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (CuModuleCreateInfoNVX es) -> IO b -> IO b
pokeZeroCStruct Ptr (CuModuleCreateInfoNVX es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX)
pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ()))) (zero)
lift $ f
instance ( Extendss CuModuleCreateInfoNVX es
, PeekChain es ) => FromCStruct (CuModuleCreateInfoNVX es) where
peekCStruct :: Ptr (CuModuleCreateInfoNVX es) -> IO (CuModuleCreateInfoNVX es)
peekCStruct Ptr (CuModuleCreateInfoNVX es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
dataSize <- peek @CSize ((p `plusPtr` 16 :: Ptr CSize))
pData <- peek @(Ptr ()) ((p `plusPtr` 24 :: Ptr (Ptr ())))
pure $ CuModuleCreateInfoNVX
next (coerce @CSize @Word64 dataSize) pData
instance es ~ '[] => Zero (CuModuleCreateInfoNVX es) where
zero :: CuModuleCreateInfoNVX es
zero = Chain es -> Word64 -> Ptr () -> CuModuleCreateInfoNVX es
forall (es :: [*]).
Chain es -> Word64 -> Ptr () -> CuModuleCreateInfoNVX es
CuModuleCreateInfoNVX
()
Word64
forall a. Zero a => a
zero
Ptr ()
forall a. Zero a => a
zero
data CuModuleTexturingModeCreateInfoNVX = CuModuleTexturingModeCreateInfoNVX
{
CuModuleTexturingModeCreateInfoNVX -> Bool
use64bitTexturing :: Bool }
deriving (Typeable, CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
(CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool)
-> (CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool)
-> Eq CuModuleTexturingModeCreateInfoNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
== :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
$c/= :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
/= :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuModuleTexturingModeCreateInfoNVX)
#endif
deriving instance Show CuModuleTexturingModeCreateInfoNVX
instance ToCStruct CuModuleTexturingModeCreateInfoNVX where
withCStruct :: forall b.
CuModuleTexturingModeCreateInfoNVX
-> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
withCStruct CuModuleTexturingModeCreateInfoNVX
x Ptr CuModuleTexturingModeCreateInfoNVX -> IO b
f = Int -> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b)
-> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuModuleTexturingModeCreateInfoNVX
p -> Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
forall b.
Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p CuModuleTexturingModeCreateInfoNVX
x (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b
f Ptr CuModuleTexturingModeCreateInfoNVX
p)
pokeCStruct :: forall b.
Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p CuModuleTexturingModeCreateInfoNVX{Bool
use64bitTexturing :: CuModuleTexturingModeCreateInfoNVX -> Bool
use64bitTexturing :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
use64bitTexturing))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct CuModuleTexturingModeCreateInfoNVX where
peekCStruct :: Ptr CuModuleTexturingModeCreateInfoNVX
-> IO CuModuleTexturingModeCreateInfoNVX
peekCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p = do
use64bitTexturing <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
pure $ CuModuleTexturingModeCreateInfoNVX
(bool32ToBool use64bitTexturing)
instance Storable CuModuleTexturingModeCreateInfoNVX where
sizeOf :: CuModuleTexturingModeCreateInfoNVX -> Int
sizeOf ~CuModuleTexturingModeCreateInfoNVX
_ = Int
24
alignment :: CuModuleTexturingModeCreateInfoNVX -> Int
alignment ~CuModuleTexturingModeCreateInfoNVX
_ = Int
8
peek :: Ptr CuModuleTexturingModeCreateInfoNVX
-> IO CuModuleTexturingModeCreateInfoNVX
peek = Ptr CuModuleTexturingModeCreateInfoNVX
-> IO CuModuleTexturingModeCreateInfoNVX
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO ()
poke Ptr CuModuleTexturingModeCreateInfoNVX
ptr CuModuleTexturingModeCreateInfoNVX
poked = Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO () -> IO ()
forall b.
Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuModuleTexturingModeCreateInfoNVX
ptr CuModuleTexturingModeCreateInfoNVX
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero CuModuleTexturingModeCreateInfoNVX where
zero :: CuModuleTexturingModeCreateInfoNVX
zero = Bool -> CuModuleTexturingModeCreateInfoNVX
CuModuleTexturingModeCreateInfoNVX
Bool
forall a. Zero a => a
zero
data CuFunctionCreateInfoNVX = CuFunctionCreateInfoNVX
{
CuFunctionCreateInfoNVX -> CuModuleNVX
module' :: CuModuleNVX
,
CuFunctionCreateInfoNVX -> ByteString
name :: ByteString
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuFunctionCreateInfoNVX)
#endif
deriving instance Show CuFunctionCreateInfoNVX
instance ToCStruct CuFunctionCreateInfoNVX where
withCStruct :: forall b.
CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
withCStruct CuFunctionCreateInfoNVX
x Ptr CuFunctionCreateInfoNVX -> IO b
f = Int -> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b)
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuFunctionCreateInfoNVX
p -> Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
forall b.
Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuFunctionCreateInfoNVX
p CuFunctionCreateInfoNVX
x (Ptr CuFunctionCreateInfoNVX -> IO b
f Ptr CuFunctionCreateInfoNVX
p)
pokeCStruct :: forall b.
Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuFunctionCreateInfoNVX
p CuFunctionCreateInfoNVX{ByteString
CuModuleNVX
module' :: CuFunctionCreateInfoNVX -> CuModuleNVX
name :: CuFunctionCreateInfoNVX -> ByteString
module' :: CuModuleNVX
name :: ByteString
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuModuleNVX -> CuModuleNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX)) (CuModuleNVX
module')
pName'' <- ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar))
-> ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall a b. (a -> b) -> a -> b
$ ByteString -> (Ptr CChar -> IO b) -> IO b
forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (ByteString
name)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr CChar))) pName''
lift $ f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CuFunctionCreateInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuFunctionCreateInfoNVX
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuModuleNVX -> CuModuleNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX)) (CuModuleNVX
forall a. Zero a => a
zero)
pName'' <- ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar))
-> ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall a b. (a -> b) -> a -> b
$ ByteString -> (Ptr CChar -> IO b) -> IO b
forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (ByteString
forall a. Monoid a => a
mempty)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr CChar))) pName''
lift $ f
instance FromCStruct CuFunctionCreateInfoNVX where
peekCStruct :: Ptr CuFunctionCreateInfoNVX -> IO CuFunctionCreateInfoNVX
peekCStruct Ptr CuFunctionCreateInfoNVX
p = do
module' <- forall a. Storable a => Ptr a -> IO a
peek @CuModuleNVX ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX))
pName <- packCString =<< peek ((p `plusPtr` 24 :: Ptr (Ptr CChar)))
pure $ CuFunctionCreateInfoNVX
module' pName
instance Zero CuFunctionCreateInfoNVX where
zero :: CuFunctionCreateInfoNVX
zero = CuModuleNVX -> ByteString -> CuFunctionCreateInfoNVX
CuFunctionCreateInfoNVX
CuModuleNVX
forall a. Zero a => a
zero
ByteString
forall a. Monoid a => a
mempty
data CuLaunchInfoNVX = CuLaunchInfoNVX
{
CuLaunchInfoNVX -> CuFunctionNVX
function :: CuFunctionNVX
,
CuLaunchInfoNVX -> Word32
gridDimX :: Word32
,
CuLaunchInfoNVX -> Word32
gridDimY :: Word32
,
CuLaunchInfoNVX -> Word32
gridDimZ :: Word32
,
CuLaunchInfoNVX -> Word32
blockDimX :: Word32
,
CuLaunchInfoNVX -> Word32
blockDimY :: Word32
,
CuLaunchInfoNVX -> Word32
blockDimZ :: Word32
,
CuLaunchInfoNVX -> Word32
sharedMemBytes :: Word32
,
CuLaunchInfoNVX -> Vector (Ptr ())
params :: Vector (Ptr ())
,
:: Vector (Ptr ())
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuLaunchInfoNVX)
#endif
deriving instance Show CuLaunchInfoNVX
instance ToCStruct CuLaunchInfoNVX where
withCStruct :: forall b. CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
withCStruct CuLaunchInfoNVX
x Ptr CuLaunchInfoNVX -> IO b
f = Int -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 ((Ptr CuLaunchInfoNVX -> IO b) -> IO b)
-> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuLaunchInfoNVX
p -> Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
forall b. Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuLaunchInfoNVX
p CuLaunchInfoNVX
x (Ptr CuLaunchInfoNVX -> IO b
f Ptr CuLaunchInfoNVX
p)
pokeCStruct :: forall b. Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuLaunchInfoNVX
p CuLaunchInfoNVX{Word32
Vector (Ptr ())
CuFunctionNVX
function :: CuLaunchInfoNVX -> CuFunctionNVX
gridDimX :: CuLaunchInfoNVX -> Word32
gridDimY :: CuLaunchInfoNVX -> Word32
gridDimZ :: CuLaunchInfoNVX -> Word32
blockDimX :: CuLaunchInfoNVX -> Word32
blockDimY :: CuLaunchInfoNVX -> Word32
blockDimZ :: CuLaunchInfoNVX -> Word32
sharedMemBytes :: CuLaunchInfoNVX -> Word32
params :: CuLaunchInfoNVX -> Vector (Ptr ())
extras :: CuLaunchInfoNVX -> Vector (Ptr ())
function :: CuFunctionNVX
gridDimX :: Word32
gridDimY :: Word32
gridDimZ :: Word32
blockDimX :: Word32
blockDimY :: Word32
blockDimZ :: Word32
sharedMemBytes :: Word32
params :: Vector (Ptr ())
extras :: Vector (Ptr ())
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuFunctionNVX -> CuFunctionNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX)) (CuFunctionNVX
function)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
gridDimX)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
gridDimY)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
gridDimZ)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
blockDimX)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
blockDimY)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) (Word32
blockDimZ)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
sharedMemBytes)
IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CSize)) (Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Vector (Ptr ()) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (Ptr ()) -> Int) -> Vector (Ptr ()) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (Ptr ())
params))))
pPParams' <- ((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ()))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ())))
-> ((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ()))
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(Ptr ()) ((Vector (Ptr ()) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (Ptr ())
params)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
lift $ Data.Vector.imapM_ (\Int
i Ptr ()
e -> Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr (Ptr ())
pPParams' Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ())) (Ptr ()
e)) (params)
lift $ poke ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ())))) (pPParams')
lift $ poke ((p `plusPtr` 72 :: Ptr CSize)) (fromIntegral ((Data.Vector.length $ (extras))))
pPExtras' <- ContT $ allocaBytes @(Ptr ()) ((Data.Vector.length (extras)) * 8)
lift $ Data.Vector.imapM_ (\Int
i Ptr ()
e -> Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr (Ptr ())
pPExtras' Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ())) (Ptr ()
e)) (extras)
lift $ poke ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ())))) (pPExtras')
lift $ f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CuLaunchInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuLaunchInfoNVX
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr CuFunctionNVX -> CuFunctionNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX)) (CuFunctionNVX
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CuLaunchInfoNVX where
peekCStruct :: Ptr CuLaunchInfoNVX -> IO CuLaunchInfoNVX
peekCStruct Ptr CuLaunchInfoNVX
p = do
function <- forall a. Storable a => Ptr a -> IO a
peek @CuFunctionNVX ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX))
gridDimX <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
gridDimY <- peek @Word32 ((p `plusPtr` 28 :: Ptr Word32))
gridDimZ <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
blockDimX <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
blockDimY <- peek @Word32 ((p `plusPtr` 40 :: Ptr Word32))
blockDimZ <- peek @Word32 ((p `plusPtr` 44 :: Ptr Word32))
sharedMemBytes <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
paramCount <- peek @CSize ((p `plusPtr` 56 :: Ptr CSize))
pParams <- peek @(Ptr (Ptr ())) ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ()))))
pParams' <- generateM (fromIntegral (coerce @CSize @Word64 paramCount)) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (Ptr ())
pParams Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ()))))
extraCount <- peek @CSize ((p `plusPtr` 72 :: Ptr CSize))
pExtras <- peek @(Ptr (Ptr ())) ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ()))))
pExtras' <- generateM (fromIntegral (coerce @CSize @Word64 extraCount)) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (Ptr ())
pExtras Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ()))))
pure $ CuLaunchInfoNVX
function
gridDimX
gridDimY
gridDimZ
blockDimX
blockDimY
blockDimZ
sharedMemBytes
pParams'
pExtras'
instance Zero CuLaunchInfoNVX where
zero :: CuLaunchInfoNVX
zero = CuFunctionNVX
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Vector (Ptr ())
-> Vector (Ptr ())
-> CuLaunchInfoNVX
CuLaunchInfoNVX
CuFunctionNVX
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Vector (Ptr ())
forall a. Monoid a => a
mempty
Vector (Ptr ())
forall a. Monoid a => a
mempty
type NVX_BINARY_IMPORT_SPEC_VERSION = 2
pattern NVX_BINARY_IMPORT_SPEC_VERSION :: forall a . Integral a => a
pattern $mNVX_BINARY_IMPORT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_BINARY_IMPORT_SPEC_VERSION :: forall a. Integral a => a
NVX_BINARY_IMPORT_SPEC_VERSION = 2
type NVX_BINARY_IMPORT_EXTENSION_NAME = "VK_NVX_binary_import"
pattern NVX_BINARY_IMPORT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mNVX_BINARY_IMPORT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_BINARY_IMPORT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
NVX_BINARY_IMPORT_EXTENSION_NAME = "VK_NVX_binary_import"