{-# language CPP #-}
module Vulkan.Extensions.VK_ARM_tensors ( createTensorARM
, withTensorARM
, destroyTensorARM
, createTensorViewARM
, withTensorViewARM
, destroyTensorViewARM
, getTensorMemoryRequirementsARM
, bindTensorMemoryARM
, getDeviceTensorMemoryRequirementsARM
, cmdCopyTensorARM
, getTensorOpaqueCaptureDescriptorDataARM
, getTensorViewOpaqueCaptureDescriptorDataARM
, getPhysicalDeviceExternalTensorPropertiesARM
, TensorDescriptionARM(..)
, TensorCreateInfoARM(..)
, TensorViewCreateInfoARM(..)
, TensorMemoryRequirementsInfoARM(..)
, BindTensorMemoryInfoARM(..)
, WriteDescriptorSetTensorARM(..)
, TensorFormatPropertiesARM(..)
, PhysicalDeviceTensorPropertiesARM(..)
, TensorMemoryBarrierARM(..)
, TensorDependencyInfoARM(..)
, PhysicalDeviceTensorFeaturesARM(..)
, DeviceTensorMemoryRequirementsARM(..)
, CopyTensorInfoARM(..)
, TensorCopyARM(..)
, MemoryDedicatedAllocateInfoTensorARM(..)
, PhysicalDeviceDescriptorBufferTensorPropertiesARM(..)
, PhysicalDeviceDescriptorBufferTensorFeaturesARM(..)
, TensorCaptureDescriptorDataInfoARM(..)
, TensorViewCaptureDescriptorDataInfoARM(..)
, DescriptorGetTensorInfoARM(..)
, FrameBoundaryTensorsARM(..)
, PhysicalDeviceExternalTensorInfoARM(..)
, ExternalTensorPropertiesARM(..)
, ExternalMemoryTensorCreateInfoARM(..)
, TensorCreateFlagsARM
, TensorCreateFlagBitsARM( TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM
, TENSOR_CREATE_PROTECTED_BIT_ARM
, TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM
, TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM
, ..
)
, TensorUsageFlagsARM
, TensorUsageFlagBitsARM( TENSOR_USAGE_SHADER_BIT_ARM
, TENSOR_USAGE_TRANSFER_SRC_BIT_ARM
, TENSOR_USAGE_TRANSFER_DST_BIT_ARM
, TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM
, TENSOR_USAGE_DATA_GRAPH_BIT_ARM
, ..
)
, TensorTilingARM( TENSOR_TILING_OPTIMAL_ARM
, TENSOR_TILING_LINEAR_ARM
, ..
)
, TensorViewCreateFlagsARM
, TensorViewCreateFlagBitsARM( TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM
, ..
)
, ARM_TENSORS_SPEC_VERSION
, pattern ARM_TENSORS_SPEC_VERSION
, ARM_TENSORS_EXTENSION_NAME
, pattern ARM_TENSORS_EXTENSION_NAME
, TensorARM(..)
, TensorViewARM(..)
) where
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
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 GHC.Show (showString)
import GHC.Show (showsPrec)
import Numeric (showHex)
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 qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
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 (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 Data.Int (Int32)
import Data.Int (Int64)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
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.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core13.Enums.AccessFlags2 (AccessFlags2)
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.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkBindTensorMemoryARM))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyTensorARM))
import Vulkan.Dynamic (DeviceCmds(pVkCreateTensorARM))
import Vulkan.Dynamic (DeviceCmds(pVkCreateTensorViewARM))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyTensorARM))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyTensorViewARM))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceTensorMemoryRequirementsARM))
import Vulkan.Dynamic (DeviceCmds(pVkGetTensorMemoryRequirementsARM))
import Vulkan.Dynamic (DeviceCmds(pVkGetTensorOpaqueCaptureDescriptorDataARM))
import Vulkan.Dynamic (DeviceCmds(pVkGetTensorViewOpaqueCaptureDescriptorDataARM))
import Vulkan.Core10.Handles (DeviceMemory)
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlagBits)
import Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits (ExternalMemoryHandleTypeFlags)
import Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities (ExternalMemoryProperties)
import Vulkan.Core10.FundamentalTypes (Flags64)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core13.Enums.FormatFeatureFlags2 (FormatFeatureFlags2)
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceExternalTensorPropertiesARM))
import Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2 (MemoryRequirements2)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_descriptor_heap (OpaqueCaptureDataCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_descriptor_buffer (OpaqueCaptureDescriptorDataCreateInfoEXT)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core13.Enums.PipelineStageFlags2 (PipelineStageFlags2)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.ShaderStageFlagBits (ShaderStageFlags)
import Vulkan.Core10.Enums.SharingMode (SharingMode)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (TensorARM)
import Vulkan.Extensions.Handles (TensorARM(..))
import Vulkan.Extensions.Handles (TensorViewARM)
import Vulkan.Extensions.Handles (TensorViewARM(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BIND_TENSOR_MEMORY_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_TENSOR_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DESCRIPTOR_GET_TENSOR_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_TENSOR_MEMORY_REQUIREMENTS_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_MEMORY_TENSOR_CREATE_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_EXTERNAL_TENSOR_PROPERTIES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_TENSOR_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_FEATURES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_PROPERTIES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_TENSOR_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_FEATURES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_PROPERTIES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_CAPTURE_DESCRIPTOR_DATA_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_COPY_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_CREATE_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_DEPENDENCY_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_DESCRIPTION_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_FORMAT_PROPERTIES_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_MEMORY_BARRIER_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_MEMORY_REQUIREMENTS_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_TENSOR_VIEW_CREATE_INFO_ARM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_TENSOR_ARM))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (TensorARM(..))
import Vulkan.Extensions.Handles (TensorViewARM(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateTensorARM
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct TensorCreateInfoARM) -> Ptr AllocationCallbacks -> Ptr TensorARM -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct TensorCreateInfoARM) -> Ptr AllocationCallbacks -> Ptr TensorARM -> IO Result
createTensorARM :: forall a io
. (Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io)
=>
Device
->
(TensorCreateInfoARM a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (TensorARM)
createTensorARM :: forall (a :: [*]) (io :: * -> *).
(Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorARM
createTensorARM Device
device TensorCreateInfoARM a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO TensorARM -> io TensorARM
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TensorARM -> io TensorARM)
-> (ContT TensorARM IO TensorARM -> IO TensorARM)
-> ContT TensorARM IO TensorARM
-> io TensorARM
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT TensorARM IO TensorARM -> IO TensorARM
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT TensorARM IO TensorARM -> io TensorARM)
-> ContT TensorARM IO TensorARM -> io TensorARM
forall a b. (a -> b) -> a -> b
$ do
let vkCreateTensorARMPtr :: FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
vkCreateTensorARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
pVkCreateTensorARM (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT TensorARM IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT TensorARM m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT TensorARM IO ()) -> IO () -> ContT TensorARM 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 TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
vkCreateTensorARMPtr FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> 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 vkCreateTensorARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateTensorARM' :: Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result
vkCreateTensorARM' = FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result
mkVkCreateTensorARM FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorARM
-> IO Result)
vkCreateTensorARMPtr
pCreateInfo <- ((Ptr (TensorCreateInfoARM a) -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr (TensorCreateInfoARM a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (TensorCreateInfoARM a) -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr (TensorCreateInfoARM a)))
-> ((Ptr (TensorCreateInfoARM a) -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr (TensorCreateInfoARM a))
forall a b. (a -> b) -> a -> b
$ TensorCreateInfoARM a
-> (Ptr (TensorCreateInfoARM a) -> IO TensorARM) -> IO TensorARM
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorCreateInfoARM a
-> (Ptr (TensorCreateInfoARM a) -> IO b) -> IO b
withCStruct (TensorCreateInfoARM a
createInfo)
pAllocator <- case (allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT TensorARM IO (Ptr AllocationCallbacks)
forall a. a -> ContT TensorARM IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO TensorARM) -> IO TensorARM)
-> ContT TensorARM IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO TensorARM) -> IO TensorARM
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
pPTensor <- ContT $ bracket (callocBytes @TensorARM 8) free
r <- lift $ traceAroundEvent "vkCreateTensorARM" (vkCreateTensorARM'
(deviceHandle (device))
(forgetExtensions pCreateInfo)
pAllocator
(pPTensor))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pTensor <- lift $ peek @TensorARM pPTensor
pure $ (pTensor)
withTensorARM :: forall a io r . (Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io) => Device -> TensorCreateInfoARM a -> Maybe AllocationCallbacks -> (io TensorARM -> (TensorARM -> io ()) -> r) -> r
withTensorARM :: forall (a :: [*]) (io :: * -> *) r.
(Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io TensorARM -> (TensorARM -> io ()) -> r)
-> r
withTensorARM Device
device TensorCreateInfoARM a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io TensorARM -> (TensorARM -> io ()) -> r
b =
io TensorARM -> (TensorARM -> io ()) -> r
b (Device
-> TensorCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorARM
forall (a :: [*]) (io :: * -> *).
(Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorARM
createTensorARM Device
device TensorCreateInfoARM a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(TensorARM
o0) -> Device
-> TensorARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> TensorARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorARM Device
device TensorARM
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyTensorARM
:: FunPtr (Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ()
destroyTensorARM :: forall io
. (MonadIO io)
=>
Device
->
TensorARM
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorARM :: forall (io :: * -> *).
MonadIO io =>
Device
-> TensorARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorARM Device
device TensorARM
tensor "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 vkDestroyTensorARMPtr :: FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
pVkDestroyTensorARM (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 -> TensorARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorARMPtr FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T -> TensorARM -> 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 vkDestroyTensorARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyTensorARM' :: Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ()
vkDestroyTensorARM' = FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ()
mkVkDestroyTensorARM FunPtr
(Ptr Device_T -> TensorARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorARMPtr
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 "vkDestroyTensorARM" (vkDestroyTensorARM'
(deviceHandle (device))
(tensor)
pAllocator)
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateTensorViewARM
:: FunPtr (Ptr Device_T -> Ptr (SomeStruct TensorViewCreateInfoARM) -> Ptr AllocationCallbacks -> Ptr TensorViewARM -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct TensorViewCreateInfoARM) -> Ptr AllocationCallbacks -> Ptr TensorViewARM -> IO Result
createTensorViewARM :: forall a io
. ( Extendss TensorViewCreateInfoARM a
, PokeChain a
, MonadIO io )
=>
Device
->
(TensorViewCreateInfoARM a)
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (TensorViewARM)
createTensorViewARM :: forall (a :: [*]) (io :: * -> *).
(Extendss TensorViewCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorViewCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorViewARM
createTensorViewARM Device
device TensorViewCreateInfoARM a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO TensorViewARM -> io TensorViewARM
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TensorViewARM -> io TensorViewARM)
-> (ContT TensorViewARM IO TensorViewARM -> IO TensorViewARM)
-> ContT TensorViewARM IO TensorViewARM
-> io TensorViewARM
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT TensorViewARM IO TensorViewARM -> IO TensorViewARM
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT TensorViewARM IO TensorViewARM -> io TensorViewARM)
-> ContT TensorViewARM IO TensorViewARM -> io TensorViewARM
forall a b. (a -> b) -> a -> b
$ do
let vkCreateTensorViewARMPtr :: FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
vkCreateTensorViewARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
pVkCreateTensorViewARM (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT TensorViewARM IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT TensorViewARM m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT TensorViewARM IO ())
-> IO () -> ContT TensorViewARM 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 TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
vkCreateTensorViewARMPtr FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> 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 vkCreateTensorViewARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCreateTensorViewARM' :: Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result
vkCreateTensorViewARM' = FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result
mkVkCreateTensorViewARM FunPtr
(Ptr Device_T
-> Ptr (SomeStruct TensorViewCreateInfoARM)
-> Ptr AllocationCallbacks
-> Ptr TensorViewARM
-> IO Result)
vkCreateTensorViewARMPtr
pCreateInfo <- ((Ptr (TensorViewCreateInfoARM a) -> IO TensorViewARM)
-> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr (TensorViewCreateInfoARM a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (TensorViewCreateInfoARM a) -> IO TensorViewARM)
-> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr (TensorViewCreateInfoARM a)))
-> ((Ptr (TensorViewCreateInfoARM a) -> IO TensorViewARM)
-> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr (TensorViewCreateInfoARM a))
forall a b. (a -> b) -> a -> b
$ TensorViewCreateInfoARM a
-> (Ptr (TensorViewCreateInfoARM a) -> IO TensorViewARM)
-> IO TensorViewARM
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorViewCreateInfoARM a
-> (Ptr (TensorViewCreateInfoARM a) -> IO b) -> IO b
withCStruct (TensorViewCreateInfoARM a
createInfo)
pAllocator <- case (allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT TensorViewARM IO (Ptr AllocationCallbacks)
forall a. a -> ContT TensorViewARM IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO TensorViewARM) -> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO TensorViewARM)
-> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO TensorViewARM)
-> IO TensorViewARM)
-> ContT TensorViewARM IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO TensorViewARM)
-> IO TensorViewARM
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
pPView <- ContT $ bracket (callocBytes @TensorViewARM 8) free
r <- lift $ traceAroundEvent "vkCreateTensorViewARM" (vkCreateTensorViewARM'
(deviceHandle (device))
(forgetExtensions pCreateInfo)
pAllocator
(pPView))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pView <- lift $ peek @TensorViewARM pPView
pure $ (pView)
withTensorViewARM :: forall a io r . (Extendss TensorViewCreateInfoARM a, PokeChain a, MonadIO io) => Device -> TensorViewCreateInfoARM a -> Maybe AllocationCallbacks -> (io TensorViewARM -> (TensorViewARM -> io ()) -> r) -> r
withTensorViewARM :: forall (a :: [*]) (io :: * -> *) r.
(Extendss TensorViewCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorViewCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io TensorViewARM -> (TensorViewARM -> io ()) -> r)
-> r
withTensorViewARM Device
device TensorViewCreateInfoARM a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io TensorViewARM -> (TensorViewARM -> io ()) -> r
b =
io TensorViewARM -> (TensorViewARM -> io ()) -> r
b (Device
-> TensorViewCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorViewARM
forall (a :: [*]) (io :: * -> *).
(Extendss TensorViewCreateInfoARM a, PokeChain a, MonadIO io) =>
Device
-> TensorViewCreateInfoARM a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io TensorViewARM
createTensorViewARM Device
device TensorViewCreateInfoARM a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
(\(TensorViewARM
o0) -> Device
-> TensorViewARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> TensorViewARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorViewARM Device
device TensorViewARM
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkDestroyTensorViewARM
:: FunPtr (Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ()
destroyTensorViewARM :: forall io
. (MonadIO io)
=>
Device
->
TensorViewARM
->
("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorViewARM :: forall (io :: * -> *).
MonadIO io =>
Device
-> TensorViewARM
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyTensorViewARM Device
device TensorViewARM
tensorView "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 vkDestroyTensorViewARMPtr :: FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorViewARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
pVkDestroyTensorViewARM (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 -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorViewARMPtr FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T -> TensorViewARM -> 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 vkDestroyTensorViewARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkDestroyTensorViewARM' :: Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ()
vkDestroyTensorViewARM' = FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T
-> TensorViewARM
-> Ptr AllocationCallbacks
-> IO ()
mkVkDestroyTensorViewARM FunPtr
(Ptr Device_T -> TensorViewARM -> Ptr AllocationCallbacks -> IO ())
vkDestroyTensorViewARMPtr
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 "vkDestroyTensorViewARM" (vkDestroyTensorViewARM'
(deviceHandle (device))
(tensorView)
pAllocator)
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetTensorMemoryRequirementsARM
:: FunPtr (Ptr Device_T -> Ptr TensorMemoryRequirementsInfoARM -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr TensorMemoryRequirementsInfoARM -> Ptr (SomeStruct MemoryRequirements2) -> IO ()
getTensorMemoryRequirementsARM :: forall a io
. ( Extendss MemoryRequirements2 a
, PokeChain a
, PeekChain a
, MonadIO io )
=>
Device
->
TensorMemoryRequirementsInfoARM
-> io (MemoryRequirements2 a)
getTensorMemoryRequirementsARM :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryRequirements2 a, PokeChain a, PeekChain a,
MonadIO io) =>
Device
-> TensorMemoryRequirementsInfoARM -> io (MemoryRequirements2 a)
getTensorMemoryRequirementsARM Device
device TensorMemoryRequirementsInfoARM
info = IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a))
-> (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ do
let vkGetTensorMemoryRequirementsARMPtr :: FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetTensorMemoryRequirementsARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
pVkGetTensorMemoryRequirementsARM (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT (MemoryRequirements2 a) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (MemoryRequirements2 a) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetTensorMemoryRequirementsARMPtr FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> 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 vkGetTensorMemoryRequirementsARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetTensorMemoryRequirementsARM' :: Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ()
vkGetTensorMemoryRequirementsARM' = FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ()
mkVkGetTensorMemoryRequirementsARM FunPtr
(Ptr Device_T
-> Ptr TensorMemoryRequirementsInfoARM
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetTensorMemoryRequirementsARMPtr
pInfo <- ((Ptr TensorMemoryRequirementsInfoARM
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a) IO (Ptr TensorMemoryRequirementsInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorMemoryRequirementsInfoARM
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a) IO (Ptr TensorMemoryRequirementsInfoARM))
-> ((Ptr TensorMemoryRequirementsInfoARM
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a) IO (Ptr TensorMemoryRequirementsInfoARM)
forall a b. (a -> b) -> a -> b
$ TensorMemoryRequirementsInfoARM
-> (Ptr TensorMemoryRequirementsInfoARM
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorMemoryRequirementsInfoARM
-> (Ptr TensorMemoryRequirementsInfoARM -> IO b) -> IO b
withCStruct (TensorMemoryRequirementsInfoARM
info)
pPMemoryRequirements <- ContT (withZeroCStruct @(MemoryRequirements2 _))
lift $ traceAroundEvent "vkGetTensorMemoryRequirementsARM" (vkGetTensorMemoryRequirementsARM'
(deviceHandle (device))
pInfo
(forgetExtensions (pPMemoryRequirements)))
pMemoryRequirements <- lift $ peekCStruct @(MemoryRequirements2 _) pPMemoryRequirements
pure $ (pMemoryRequirements)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkBindTensorMemoryARM
:: FunPtr (Ptr Device_T -> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result) -> Ptr Device_T -> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result
bindTensorMemoryARM :: forall io
. (MonadIO io)
=>
Device
->
("bindInfos" ::: Vector BindTensorMemoryInfoARM)
-> io ()
bindTensorMemoryARM :: forall (io :: * -> *).
MonadIO io =>
Device -> ("bindInfos" ::: Vector BindTensorMemoryInfoARM) -> io ()
bindTensorMemoryARM Device
device "bindInfos" ::: Vector BindTensorMemoryInfoARM
bindInfos = 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 vkBindTensorMemoryARMPtr :: FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
vkBindTensorMemoryARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
pVkBindTensorMemoryARM (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
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
vkBindTensorMemoryARMPtr FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
-> FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> 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 vkBindTensorMemoryARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkBindTensorMemoryARM' :: Ptr Device_T -> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result
vkBindTensorMemoryARM' = FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
-> Ptr Device_T
-> Word32
-> Ptr BindTensorMemoryInfoARM
-> IO Result
mkVkBindTensorMemoryARM FunPtr
(Ptr Device_T
-> Word32 -> Ptr BindTensorMemoryInfoARM -> IO Result)
vkBindTensorMemoryARMPtr
pPBindInfos <- ((Ptr BindTensorMemoryInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr BindTensorMemoryInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr BindTensorMemoryInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr BindTensorMemoryInfoARM))
-> ((Ptr BindTensorMemoryInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr BindTensorMemoryInfoARM)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @BindTensorMemoryInfoARM ((("bindInfos" ::: Vector BindTensorMemoryInfoARM) -> Int
forall a. Vector a -> Int
Data.Vector.length ("bindInfos" ::: Vector BindTensorMemoryInfoARM
bindInfos)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
40)
lift $ Data.Vector.imapM_ (\Int
i BindTensorMemoryInfoARM
e -> Ptr BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr BindTensorMemoryInfoARM
pPBindInfos Ptr BindTensorMemoryInfoARM -> Int -> Ptr BindTensorMemoryInfoARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr BindTensorMemoryInfoARM) (BindTensorMemoryInfoARM
e)) (bindInfos)
r <- lift $ traceAroundEvent "vkBindTensorMemoryARM" (vkBindTensorMemoryARM'
(deviceHandle (device))
((fromIntegral (Data.Vector.length $ (bindInfos)) :: Word32))
(pPBindInfos))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetDeviceTensorMemoryRequirementsARM
:: FunPtr (Ptr Device_T -> Ptr DeviceTensorMemoryRequirementsARM -> Ptr (SomeStruct MemoryRequirements2) -> IO ()) -> Ptr Device_T -> Ptr DeviceTensorMemoryRequirementsARM -> Ptr (SomeStruct MemoryRequirements2) -> IO ()
getDeviceTensorMemoryRequirementsARM :: forall a io
. ( Extendss MemoryRequirements2 a
, PokeChain a
, PeekChain a
, MonadIO io )
=>
Device
->
("info" ::: DeviceTensorMemoryRequirementsARM)
-> io (MemoryRequirements2 a)
getDeviceTensorMemoryRequirementsARM :: forall (a :: [*]) (io :: * -> *).
(Extendss MemoryRequirements2 a, PokeChain a, PeekChain a,
MonadIO io) =>
Device
-> ("info" ::: DeviceTensorMemoryRequirementsARM)
-> io (MemoryRequirements2 a)
getDeviceTensorMemoryRequirementsARM Device
device "info" ::: DeviceTensorMemoryRequirementsARM
info = IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (MemoryRequirements2 a) -> io (MemoryRequirements2 a))
-> (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> IO (MemoryRequirements2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a))
-> ContT (MemoryRequirements2 a) IO (MemoryRequirements2 a)
-> io (MemoryRequirements2 a)
forall a b. (a -> b) -> a -> b
$ do
let vkGetDeviceTensorMemoryRequirementsARMPtr :: FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetDeviceTensorMemoryRequirementsARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
pVkGetDeviceTensorMemoryRequirementsARM (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT (MemoryRequirements2 a) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (MemoryRequirements2 a) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (MemoryRequirements2 a) IO ())
-> IO () -> ContT (MemoryRequirements2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetDeviceTensorMemoryRequirementsARMPtr FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> 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 vkGetDeviceTensorMemoryRequirementsARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetDeviceTensorMemoryRequirementsARM' :: Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ()
vkGetDeviceTensorMemoryRequirementsARM' = FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
-> Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ()
mkVkGetDeviceTensorMemoryRequirementsARM FunPtr
(Ptr Device_T
-> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Ptr (SomeStruct MemoryRequirements2)
-> IO ())
vkGetDeviceTensorMemoryRequirementsARMPtr
pInfo <- ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
(Ptr ("info" ::: DeviceTensorMemoryRequirementsARM))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
(Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)))
-> ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a))
-> ContT
(MemoryRequirements2 a)
IO
(Ptr ("info" ::: DeviceTensorMemoryRequirementsARM))
forall a b. (a -> b) -> a -> b
$ ("info" ::: DeviceTensorMemoryRequirementsARM)
-> (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> IO (MemoryRequirements2 a))
-> IO (MemoryRequirements2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
("info" ::: DeviceTensorMemoryRequirementsARM)
-> (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b)
-> IO b
withCStruct ("info" ::: DeviceTensorMemoryRequirementsARM
info)
pPMemoryRequirements <- ContT (withZeroCStruct @(MemoryRequirements2 _))
lift $ traceAroundEvent "vkGetDeviceTensorMemoryRequirementsARM" (vkGetDeviceTensorMemoryRequirementsARM'
(deviceHandle (device))
pInfo
(forgetExtensions (pPMemoryRequirements)))
pMemoryRequirements <- lift $ peekCStruct @(MemoryRequirements2 _) pPMemoryRequirements
pure $ (pMemoryRequirements)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdCopyTensorARM
:: FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ()
cmdCopyTensorARM :: forall io
. (MonadIO io)
=>
CommandBuffer
->
CopyTensorInfoARM
-> io ()
cmdCopyTensorARM :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyTensorInfoARM -> io ()
cmdCopyTensorARM CommandBuffer
commandBuffer CopyTensorInfoARM
copyTensorInfo = 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 vkCmdCopyTensorARMPtr :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
vkCmdCopyTensorARMPtr = DeviceCmds
-> FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
pVkCmdCopyTensorARM (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 CopyTensorInfoARM -> IO ())
vkCmdCopyTensorARMPtr FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
-> FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> 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 vkCmdCopyTensorARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdCopyTensorARM' :: Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ()
vkCmdCopyTensorARM' = FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
-> Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ()
mkVkCmdCopyTensorARM FunPtr (Ptr CommandBuffer_T -> Ptr CopyTensorInfoARM -> IO ())
vkCmdCopyTensorARMPtr
pCopyTensorInfo <- ((Ptr CopyTensorInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyTensorInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CopyTensorInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyTensorInfoARM))
-> ((Ptr CopyTensorInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyTensorInfoARM)
forall a b. (a -> b) -> a -> b
$ CopyTensorInfoARM -> (Ptr CopyTensorInfoARM -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CopyTensorInfoARM -> (Ptr CopyTensorInfoARM -> IO b) -> IO b
withCStruct (CopyTensorInfoARM
copyTensorInfo)
lift $ traceAroundEvent "vkCmdCopyTensorARM" (vkCmdCopyTensorARM'
(commandBufferHandle (commandBuffer))
pCopyTensorInfo)
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetTensorOpaqueCaptureDescriptorDataARM
:: FunPtr (Ptr Device_T -> Ptr TensorCaptureDescriptorDataInfoARM -> Ptr () -> IO Result) -> Ptr Device_T -> Ptr TensorCaptureDescriptorDataInfoARM -> Ptr () -> IO Result
getTensorOpaqueCaptureDescriptorDataARM :: forall io
. (MonadIO io)
=>
Device
->
TensorCaptureDescriptorDataInfoARM
->
("data" ::: Ptr ())
-> io ()
getTensorOpaqueCaptureDescriptorDataARM :: forall (io :: * -> *).
MonadIO io =>
Device
-> TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> io ()
getTensorOpaqueCaptureDescriptorDataARM Device
device
TensorCaptureDescriptorDataInfoARM
info
"data" ::: Ptr ()
data' = 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 vkGetTensorOpaqueCaptureDescriptorDataARMPtr :: FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorOpaqueCaptureDescriptorDataARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
pVkGetTensorOpaqueCaptureDescriptorDataARM (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
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorOpaqueCaptureDescriptorDataARMPtr FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> 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 vkGetTensorOpaqueCaptureDescriptorDataARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetTensorOpaqueCaptureDescriptorDataARM' :: Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result
vkGetTensorOpaqueCaptureDescriptorDataARM' = FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result
mkVkGetTensorOpaqueCaptureDescriptorDataARM FunPtr
(Ptr Device_T
-> Ptr TensorCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorOpaqueCaptureDescriptorDataARMPtr
pInfo <- ((Ptr TensorCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorCaptureDescriptorDataInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorCaptureDescriptorDataInfoARM))
-> ((Ptr TensorCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorCaptureDescriptorDataInfoARM)
forall a b. (a -> b) -> a -> b
$ TensorCaptureDescriptorDataInfoARM
-> (Ptr TensorCaptureDescriptorDataInfoARM -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorCaptureDescriptorDataInfoARM
-> (Ptr TensorCaptureDescriptorDataInfoARM -> IO b) -> IO b
withCStruct (TensorCaptureDescriptorDataInfoARM
info)
r <- lift $ traceAroundEvent "vkGetTensorOpaqueCaptureDescriptorDataARM" (vkGetTensorOpaqueCaptureDescriptorDataARM'
(deviceHandle (device))
pInfo
(data'))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetTensorViewOpaqueCaptureDescriptorDataARM
:: FunPtr (Ptr Device_T -> Ptr TensorViewCaptureDescriptorDataInfoARM -> Ptr () -> IO Result) -> Ptr Device_T -> Ptr TensorViewCaptureDescriptorDataInfoARM -> Ptr () -> IO Result
getTensorViewOpaqueCaptureDescriptorDataARM :: forall io
. (MonadIO io)
=>
Device
->
TensorViewCaptureDescriptorDataInfoARM
->
("data" ::: Ptr ())
-> io ()
getTensorViewOpaqueCaptureDescriptorDataARM :: forall (io :: * -> *).
MonadIO io =>
Device
-> TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> io ()
getTensorViewOpaqueCaptureDescriptorDataARM Device
device
TensorViewCaptureDescriptorDataInfoARM
info
"data" ::: Ptr ()
data' = 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 vkGetTensorViewOpaqueCaptureDescriptorDataARMPtr :: FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorViewOpaqueCaptureDescriptorDataARMPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
pVkGetTensorViewOpaqueCaptureDescriptorDataARM (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
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorViewOpaqueCaptureDescriptorDataARMPtr FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> 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 vkGetTensorViewOpaqueCaptureDescriptorDataARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetTensorViewOpaqueCaptureDescriptorDataARM' :: Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result
vkGetTensorViewOpaqueCaptureDescriptorDataARM' = FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
-> Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result
mkVkGetTensorViewOpaqueCaptureDescriptorDataARM FunPtr
(Ptr Device_T
-> Ptr TensorViewCaptureDescriptorDataInfoARM
-> ("data" ::: Ptr ())
-> IO Result)
vkGetTensorViewOpaqueCaptureDescriptorDataARMPtr
pInfo <- ((Ptr TensorViewCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorViewCaptureDescriptorDataInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorViewCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorViewCaptureDescriptorDataInfoARM))
-> ((Ptr TensorViewCaptureDescriptorDataInfoARM -> IO ()) -> IO ())
-> ContT () IO (Ptr TensorViewCaptureDescriptorDataInfoARM)
forall a b. (a -> b) -> a -> b
$ TensorViewCaptureDescriptorDataInfoARM
-> (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorViewCaptureDescriptorDataInfoARM
-> (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b) -> IO b
withCStruct (TensorViewCaptureDescriptorDataInfoARM
info)
r <- lift $ traceAroundEvent "vkGetTensorViewOpaqueCaptureDescriptorDataARM" (vkGetTensorViewOpaqueCaptureDescriptorDataARM'
(deviceHandle (device))
pInfo
(data'))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetPhysicalDeviceExternalTensorPropertiesARM
:: FunPtr (Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalTensorInfoARM -> Ptr ExternalTensorPropertiesARM -> IO ()) -> Ptr PhysicalDevice_T -> Ptr PhysicalDeviceExternalTensorInfoARM -> Ptr ExternalTensorPropertiesARM -> IO ()
getPhysicalDeviceExternalTensorPropertiesARM :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
PhysicalDeviceExternalTensorInfoARM
-> io (ExternalTensorPropertiesARM)
getPhysicalDeviceExternalTensorPropertiesARM :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> PhysicalDeviceExternalTensorInfoARM
-> io ExternalTensorPropertiesARM
getPhysicalDeviceExternalTensorPropertiesARM PhysicalDevice
physicalDevice
PhysicalDeviceExternalTensorInfoARM
externalTensorInfo = IO ExternalTensorPropertiesARM -> io ExternalTensorPropertiesARM
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ExternalTensorPropertiesARM -> io ExternalTensorPropertiesARM)
-> (ContT
ExternalTensorPropertiesARM IO ExternalTensorPropertiesARM
-> IO ExternalTensorPropertiesARM)
-> ContT ExternalTensorPropertiesARM IO ExternalTensorPropertiesARM
-> io ExternalTensorPropertiesARM
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ExternalTensorPropertiesARM IO ExternalTensorPropertiesARM
-> IO ExternalTensorPropertiesARM
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ExternalTensorPropertiesARM IO ExternalTensorPropertiesARM
-> io ExternalTensorPropertiesARM)
-> ContT ExternalTensorPropertiesARM IO ExternalTensorPropertiesARM
-> io ExternalTensorPropertiesARM
forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceExternalTensorPropertiesARMPtr :: FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
vkGetPhysicalDeviceExternalTensorPropertiesARMPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
pVkGetPhysicalDeviceExternalTensorPropertiesARM (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds :: PhysicalDevice -> InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
IO () -> ContT ExternalTensorPropertiesARM IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ExternalTensorPropertiesARM m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ExternalTensorPropertiesARM IO ())
-> IO () -> ContT ExternalTensorPropertiesARM IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
vkGetPhysicalDeviceExternalTensorPropertiesARMPtr FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
-> FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> 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 vkGetPhysicalDeviceExternalTensorPropertiesARM is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetPhysicalDeviceExternalTensorPropertiesARM' :: Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ()
vkGetPhysicalDeviceExternalTensorPropertiesARM' = FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
-> Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ()
mkVkGetPhysicalDeviceExternalTensorPropertiesARM FunPtr
(Ptr PhysicalDevice_T
-> Ptr PhysicalDeviceExternalTensorInfoARM
-> Ptr ExternalTensorPropertiesARM
-> IO ())
vkGetPhysicalDeviceExternalTensorPropertiesARMPtr
pExternalTensorInfo <- ((Ptr PhysicalDeviceExternalTensorInfoARM
-> IO ExternalTensorPropertiesARM)
-> IO ExternalTensorPropertiesARM)
-> ContT
ExternalTensorPropertiesARM
IO
(Ptr PhysicalDeviceExternalTensorInfoARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr PhysicalDeviceExternalTensorInfoARM
-> IO ExternalTensorPropertiesARM)
-> IO ExternalTensorPropertiesARM)
-> ContT
ExternalTensorPropertiesARM
IO
(Ptr PhysicalDeviceExternalTensorInfoARM))
-> ((Ptr PhysicalDeviceExternalTensorInfoARM
-> IO ExternalTensorPropertiesARM)
-> IO ExternalTensorPropertiesARM)
-> ContT
ExternalTensorPropertiesARM
IO
(Ptr PhysicalDeviceExternalTensorInfoARM)
forall a b. (a -> b) -> a -> b
$ PhysicalDeviceExternalTensorInfoARM
-> (Ptr PhysicalDeviceExternalTensorInfoARM
-> IO ExternalTensorPropertiesARM)
-> IO ExternalTensorPropertiesARM
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
PhysicalDeviceExternalTensorInfoARM
-> (Ptr PhysicalDeviceExternalTensorInfoARM -> IO b) -> IO b
withCStruct (PhysicalDeviceExternalTensorInfoARM
externalTensorInfo)
pPExternalTensorProperties <- ContT (withZeroCStruct @ExternalTensorPropertiesARM)
lift $ traceAroundEvent "vkGetPhysicalDeviceExternalTensorPropertiesARM" (vkGetPhysicalDeviceExternalTensorPropertiesARM'
(physicalDeviceHandle (physicalDevice))
pExternalTensorInfo
(pPExternalTensorProperties))
pExternalTensorProperties <- lift $ peekCStruct @ExternalTensorPropertiesARM pPExternalTensorProperties
pure $ (pExternalTensorProperties)
data TensorDescriptionARM = TensorDescriptionARM
{
TensorDescriptionARM -> TensorTilingARM
tiling :: TensorTilingARM
,
TensorDescriptionARM -> Format
format :: Format
,
TensorDescriptionARM -> Vector Int64
dimensions :: Vector Int64
,
TensorDescriptionARM -> Vector Int64
strides :: Vector Int64
,
TensorDescriptionARM -> TensorUsageFlagsARM
usage :: TensorUsageFlagsARM
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorDescriptionARM)
#endif
deriving instance Show TensorDescriptionARM
instance ToCStruct TensorDescriptionARM where
withCStruct :: forall b.
TensorDescriptionARM -> (Ptr TensorDescriptionARM -> IO b) -> IO b
withCStruct TensorDescriptionARM
x Ptr TensorDescriptionARM -> IO b
f = Int -> (Ptr TensorDescriptionARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> (Ptr TensorDescriptionARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorDescriptionARM
p -> Ptr TensorDescriptionARM -> TensorDescriptionARM -> IO b -> IO b
forall b.
Ptr TensorDescriptionARM -> TensorDescriptionARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorDescriptionARM
p TensorDescriptionARM
x (Ptr TensorDescriptionARM -> IO b
f Ptr TensorDescriptionARM
p)
pokeCStruct :: forall b.
Ptr TensorDescriptionARM -> TensorDescriptionARM -> IO b -> IO b
pokeCStruct Ptr TensorDescriptionARM
p TensorDescriptionARM{Vector Int64
Format
TensorTilingARM
TensorUsageFlagsARM
tiling :: TensorDescriptionARM -> TensorTilingARM
format :: TensorDescriptionARM -> Format
dimensions :: TensorDescriptionARM -> Vector Int64
strides :: TensorDescriptionARM -> Vector Int64
usage :: TensorDescriptionARM -> TensorUsageFlagsARM
tiling :: TensorTilingARM
format :: Format
dimensions :: Vector Int64
strides :: Vector Int64
usage :: TensorUsageFlagsARM
..} 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 TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_DESCRIPTION_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 TensorTilingARM -> TensorTilingARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr TensorTilingARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorTilingARM)) (TensorTilingARM
tiling)
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 Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Format)) (Format
format)
let pDimensionsLength :: Int
pDimensionsLength = Vector Int64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Int64 -> Int) -> Vector Int64 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Int64
dimensions)
let pStridesLength :: Int
pStridesLength = Vector Int64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Int64 -> Int) -> Vector Int64 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Int64
strides)
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
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pStridesLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
pDimensionsLength Bool -> Bool -> Bool
|| Int
pStridesLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (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
"pStrides and pDimensions must have the same length" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
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 TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pDimensionsLength :: Word32))
pPDimensions' <- ((Ptr Int64 -> IO b) -> IO b) -> ContT b IO (Ptr Int64)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Int64 -> IO b) -> IO b) -> ContT b IO (Ptr Int64))
-> ((Ptr Int64 -> IO b) -> IO b) -> ContT b IO (Ptr Int64)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Int64 ((Vector Int64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Int64
dimensions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
lift $ Data.Vector.imapM_ (\Int
i Int64
e -> Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Int64
pPDimensions' Ptr Int64 -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Int64) (Int64
e)) (dimensions)
lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr Int64))) (pPDimensions')
pStrides'' <- if Data.Vector.null (strides)
then pure nullPtr
else do
pPStrides <- ContT $ allocaBytes @Int64 (((Data.Vector.length (strides))) * 8)
lift $ Data.Vector.imapM_ (\Int
i Int64
e -> Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Int64
pPStrides Ptr Int64 -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Int64) (Int64
e)) ((strides))
pure $ pPStrides
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr Int64))) pStrides''
lift $ poke ((p `plusPtr` 48 :: Ptr TensorUsageFlagsARM)) (usage)
lift $ f
cStructSize :: Int
cStructSize = Int
56
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorDescriptionARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorDescriptionARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_DESCRIPTION_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorTilingARM -> TensorTilingARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr TensorTilingARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorTilingARM)) (TensorTilingARM
forall a. Zero a => a
zero)
Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
Ptr TensorUsageFlagsARM -> TensorUsageFlagsARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr TensorUsageFlagsARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr TensorUsageFlagsARM)) (TensorUsageFlagsARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorDescriptionARM where
peekCStruct :: Ptr TensorDescriptionARM -> IO TensorDescriptionARM
peekCStruct Ptr TensorDescriptionARM
p = do
tiling <- forall a. Storable a => Ptr a -> IO a
peek @TensorTilingARM ((Ptr TensorDescriptionARM
p Ptr TensorDescriptionARM -> Int -> Ptr TensorTilingARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorTilingARM))
format <- peek @Format ((p `plusPtr` 20 :: Ptr Format))
dimensionCount <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
pDimensions <- peek @(Ptr Int64) ((p `plusPtr` 32 :: Ptr (Ptr Int64)))
pDimensions' <- generateM (fromIntegral dimensionCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr Int64
pDimensions Ptr Int64 -> Int -> Ptr Int64
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Int64)))
pStrides <- peek @(Ptr Int64) ((p `plusPtr` 40 :: Ptr (Ptr Int64)))
let pStridesLength = if Ptr Int64
pStrides Ptr Int64 -> Ptr Int64 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Int64
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dimensionCount)
pStrides' <- generateM pStridesLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr Int64
pStrides Ptr Int64 -> Int -> Ptr Int64
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Int64)))
usage <- peek @TensorUsageFlagsARM ((p `plusPtr` 48 :: Ptr TensorUsageFlagsARM))
pure $ TensorDescriptionARM
tiling format pDimensions' pStrides' usage
instance Zero TensorDescriptionARM where
zero :: TensorDescriptionARM
zero = TensorTilingARM
-> Format
-> Vector Int64
-> Vector Int64
-> TensorUsageFlagsARM
-> TensorDescriptionARM
TensorDescriptionARM
TensorTilingARM
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
Vector Int64
forall a. Monoid a => a
mempty
Vector Int64
forall a. Monoid a => a
mempty
TensorUsageFlagsARM
forall a. Zero a => a
zero
data TensorCreateInfoARM (es :: [Type]) = TensorCreateInfoARM
{
forall (es :: [*]). TensorCreateInfoARM es -> Chain es
next :: Chain es
,
forall (es :: [*]). TensorCreateInfoARM es -> TensorCreateFlagsARM
flags :: TensorCreateFlagsARM
,
forall (es :: [*]). TensorCreateInfoARM es -> TensorDescriptionARM
description :: TensorDescriptionARM
,
forall (es :: [*]). TensorCreateInfoARM es -> SharingMode
sharingMode :: SharingMode
,
forall (es :: [*]). TensorCreateInfoARM es -> Vector Word32
queueFamilyIndices :: Vector Word32
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorCreateInfoARM (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (TensorCreateInfoARM es)
instance Extensible TensorCreateInfoARM where
extensibleTypeName :: String
extensibleTypeName = String
"TensorCreateInfoARM"
setNext :: forall (ds :: [*]) (es :: [*]).
TensorCreateInfoARM ds -> Chain es -> TensorCreateInfoARM es
setNext TensorCreateInfoARM{Vector Word32
SharingMode
Chain ds
TensorDescriptionARM
TensorCreateFlagsARM
next :: forall (es :: [*]). TensorCreateInfoARM es -> Chain es
flags :: forall (es :: [*]). TensorCreateInfoARM es -> TensorCreateFlagsARM
description :: forall (es :: [*]). TensorCreateInfoARM es -> TensorDescriptionARM
sharingMode :: forall (es :: [*]). TensorCreateInfoARM es -> SharingMode
queueFamilyIndices :: forall (es :: [*]). TensorCreateInfoARM es -> Vector Word32
next :: Chain ds
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
sharingMode :: SharingMode
queueFamilyIndices :: Vector Word32
..} Chain es
next' = TensorCreateInfoARM{next :: Chain es
next = Chain es
next', Vector Word32
SharingMode
TensorDescriptionARM
TensorCreateFlagsARM
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
sharingMode :: SharingMode
queueFamilyIndices :: Vector Word32
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
sharingMode :: SharingMode
queueFamilyIndices :: Vector Word32
..}
getNext :: forall (es :: [*]). TensorCreateInfoARM es -> Chain es
getNext TensorCreateInfoARM{Vector Word32
SharingMode
Chain es
TensorDescriptionARM
TensorCreateFlagsARM
next :: forall (es :: [*]). TensorCreateInfoARM es -> Chain es
flags :: forall (es :: [*]). TensorCreateInfoARM es -> TensorCreateFlagsARM
description :: forall (es :: [*]). TensorCreateInfoARM es -> TensorDescriptionARM
sharingMode :: forall (es :: [*]). TensorCreateInfoARM es -> SharingMode
queueFamilyIndices :: forall (es :: [*]). TensorCreateInfoARM es -> Vector Word32
next :: Chain es
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
sharingMode :: SharingMode
queueFamilyIndices :: Vector Word32
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends TensorCreateInfoARM e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends TensorCreateInfoARM e => b) -> Maybe b
extends proxy e
_ Extends TensorCreateInfoARM e => b
f
| Just e :~: OpaqueCaptureDataCreateInfoEXT
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 @OpaqueCaptureDataCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends TensorCreateInfoARM e => b
f
| Just e :~: ExternalMemoryTensorCreateInfoARM
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 @ExternalMemoryTensorCreateInfoARM = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends TensorCreateInfoARM e => b
f
| Just e :~: OpaqueCaptureDescriptorDataCreateInfoEXT
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 @OpaqueCaptureDescriptorDataCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends TensorCreateInfoARM e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss TensorCreateInfoARM es
, PokeChain es ) => ToCStruct (TensorCreateInfoARM es) where
withCStruct :: forall b.
TensorCreateInfoARM es
-> (Ptr (TensorCreateInfoARM es) -> IO b) -> IO b
withCStruct TensorCreateInfoARM es
x Ptr (TensorCreateInfoARM es) -> IO b
f = Int -> (Ptr (TensorCreateInfoARM es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (TensorCreateInfoARM es) -> IO b) -> IO b)
-> (Ptr (TensorCreateInfoARM es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (TensorCreateInfoARM es)
p -> Ptr (TensorCreateInfoARM es)
-> TensorCreateInfoARM es -> IO b -> IO b
forall b.
Ptr (TensorCreateInfoARM es)
-> TensorCreateInfoARM es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (TensorCreateInfoARM es)
p TensorCreateInfoARM es
x (Ptr (TensorCreateInfoARM es) -> IO b
f Ptr (TensorCreateInfoARM es)
p)
pokeCStruct :: forall b.
Ptr (TensorCreateInfoARM es)
-> TensorCreateInfoARM es -> IO b -> IO b
pokeCStruct Ptr (TensorCreateInfoARM es)
p TensorCreateInfoARM{Vector Word32
SharingMode
Chain es
TensorDescriptionARM
TensorCreateFlagsARM
next :: forall (es :: [*]). TensorCreateInfoARM es -> Chain es
flags :: forall (es :: [*]). TensorCreateInfoARM es -> TensorCreateFlagsARM
description :: forall (es :: [*]). TensorCreateInfoARM es -> TensorDescriptionARM
sharingMode :: forall (es :: [*]). TensorCreateInfoARM es -> SharingMode
queueFamilyIndices :: forall (es :: [*]). TensorCreateInfoARM es -> Vector Word32
next :: Chain es
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
sharingMode :: SharingMode
queueFamilyIndices :: Vector Word32
..} 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 (TensorCreateInfoARM es)
p Ptr (TensorCreateInfoARM es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_CREATE_INFO_ARM)
pNext'' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: 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) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 TensorCreateFlagsARM)) (flags)
pDescription'' <- ContT $ withCStruct (description)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM))) pDescription''
lift $ poke ((p `plusPtr` 32 :: Ptr SharingMode)) (sharingMode)
lift $ poke ((p `plusPtr` 36 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (queueFamilyIndices)) :: Word32))
pPQueueFamilyIndices' <- ContT $ allocaBytes @Word32 ((Data.Vector.length (queueFamilyIndices)) * 4)
lift $ Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPQueueFamilyIndices' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (queueFamilyIndices)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr Word32))) (pPQueueFamilyIndices')
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (TensorCreateInfoARM es) -> IO b -> IO b
pokeZeroCStruct Ptr (TensorCreateInfoARM 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 (TensorCreateInfoARM es)
p Ptr (TensorCreateInfoARM es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_CREATE_INFO_ARM)
pNext' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: 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) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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'
pDescription'' <- ContT $ withCStruct (zero)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM))) pDescription''
lift $ poke ((p `plusPtr` 32 :: Ptr SharingMode)) (zero)
lift $ f
instance ( Extendss TensorCreateInfoARM es
, PeekChain es ) => FromCStruct (TensorCreateInfoARM es) where
peekCStruct :: Ptr (TensorCreateInfoARM es) -> IO (TensorCreateInfoARM es)
peekCStruct Ptr (TensorCreateInfoARM es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (TensorCreateInfoARM es)
p Ptr (TensorCreateInfoARM es) -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
flags <- peek @TensorCreateFlagsARM ((p `plusPtr` 16 :: Ptr TensorCreateFlagsARM))
pDescription <- peekCStruct @TensorDescriptionARM =<< peek ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM)))
sharingMode <- peek @SharingMode ((p `plusPtr` 32 :: Ptr SharingMode))
queueFamilyIndexCount <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
pQueueFamilyIndices <- peek @(Ptr Word32) ((p `plusPtr` 40 :: Ptr (Ptr Word32)))
pQueueFamilyIndices' <- generateM (fromIntegral queueFamilyIndexCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pQueueFamilyIndices Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
pure $ TensorCreateInfoARM
next flags pDescription sharingMode pQueueFamilyIndices'
instance es ~ '[] => Zero (TensorCreateInfoARM es) where
zero :: TensorCreateInfoARM es
zero = Chain es
-> TensorCreateFlagsARM
-> TensorDescriptionARM
-> SharingMode
-> Vector Word32
-> TensorCreateInfoARM es
forall (es :: [*]).
Chain es
-> TensorCreateFlagsARM
-> TensorDescriptionARM
-> SharingMode
-> Vector Word32
-> TensorCreateInfoARM es
TensorCreateInfoARM
()
TensorCreateFlagsARM
forall a. Zero a => a
zero
TensorDescriptionARM
forall a. Zero a => a
zero
SharingMode
forall a. Zero a => a
zero
Vector Word32
forall a. Monoid a => a
mempty
data TensorViewCreateInfoARM (es :: [Type]) = TensorViewCreateInfoARM
{
forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
next :: Chain es
,
forall (es :: [*]).
TensorViewCreateInfoARM es -> TensorViewCreateFlagsARM
flags :: TensorViewCreateFlagsARM
,
forall (es :: [*]). TensorViewCreateInfoARM es -> TensorARM
tensor :: TensorARM
,
forall (es :: [*]). TensorViewCreateInfoARM es -> Format
format :: Format
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorViewCreateInfoARM (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (TensorViewCreateInfoARM es)
instance Extensible TensorViewCreateInfoARM where
extensibleTypeName :: String
extensibleTypeName = String
"TensorViewCreateInfoARM"
setNext :: forall (ds :: [*]) (es :: [*]).
TensorViewCreateInfoARM ds
-> Chain es -> TensorViewCreateInfoARM es
setNext TensorViewCreateInfoARM{Format
TensorARM
Chain ds
TensorViewCreateFlagsARM
next :: forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
flags :: forall (es :: [*]).
TensorViewCreateInfoARM es -> TensorViewCreateFlagsARM
tensor :: forall (es :: [*]). TensorViewCreateInfoARM es -> TensorARM
format :: forall (es :: [*]). TensorViewCreateInfoARM es -> Format
next :: Chain ds
flags :: TensorViewCreateFlagsARM
tensor :: TensorARM
format :: Format
..} Chain es
next' = TensorViewCreateInfoARM{next :: Chain es
next = Chain es
next', Format
TensorARM
TensorViewCreateFlagsARM
flags :: TensorViewCreateFlagsARM
tensor :: TensorARM
format :: Format
flags :: TensorViewCreateFlagsARM
tensor :: TensorARM
format :: Format
..}
getNext :: forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
getNext TensorViewCreateInfoARM{Format
TensorARM
Chain es
TensorViewCreateFlagsARM
next :: forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
flags :: forall (es :: [*]).
TensorViewCreateInfoARM es -> TensorViewCreateFlagsARM
tensor :: forall (es :: [*]). TensorViewCreateInfoARM es -> TensorARM
format :: forall (es :: [*]). TensorViewCreateInfoARM es -> Format
next :: Chain es
flags :: TensorViewCreateFlagsARM
tensor :: TensorARM
format :: Format
..} = Chain es
next
extends :: forall e b proxy. Typeable e => proxy e -> (Extends TensorViewCreateInfoARM e => b) -> Maybe b
extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends TensorViewCreateInfoARM e => b) -> Maybe b
extends proxy e
_ Extends TensorViewCreateInfoARM e => b
f
| Just e :~: OpaqueCaptureDescriptorDataCreateInfoEXT
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 @OpaqueCaptureDescriptorDataCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends TensorViewCreateInfoARM e => b
f
| Bool
otherwise = Maybe b
forall a. Maybe a
Nothing
instance ( Extendss TensorViewCreateInfoARM es
, PokeChain es ) => ToCStruct (TensorViewCreateInfoARM es) where
withCStruct :: forall b.
TensorViewCreateInfoARM es
-> (Ptr (TensorViewCreateInfoARM es) -> IO b) -> IO b
withCStruct TensorViewCreateInfoARM es
x Ptr (TensorViewCreateInfoARM es) -> IO b
f = Int -> (Ptr (TensorViewCreateInfoARM es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr (TensorViewCreateInfoARM es) -> IO b) -> IO b)
-> (Ptr (TensorViewCreateInfoARM es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (TensorViewCreateInfoARM es)
p -> Ptr (TensorViewCreateInfoARM es)
-> TensorViewCreateInfoARM es -> IO b -> IO b
forall b.
Ptr (TensorViewCreateInfoARM es)
-> TensorViewCreateInfoARM es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (TensorViewCreateInfoARM es)
p TensorViewCreateInfoARM es
x (Ptr (TensorViewCreateInfoARM es) -> IO b
f Ptr (TensorViewCreateInfoARM es)
p)
pokeCStruct :: forall b.
Ptr (TensorViewCreateInfoARM es)
-> TensorViewCreateInfoARM es -> IO b -> IO b
pokeCStruct Ptr (TensorViewCreateInfoARM es)
p TensorViewCreateInfoARM{Format
TensorARM
Chain es
TensorViewCreateFlagsARM
next :: forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
flags :: forall (es :: [*]).
TensorViewCreateInfoARM es -> TensorViewCreateFlagsARM
tensor :: forall (es :: [*]). TensorViewCreateInfoARM es -> TensorARM
format :: forall (es :: [*]). TensorViewCreateInfoARM es -> Format
next :: Chain es
flags :: TensorViewCreateFlagsARM
tensor :: TensorARM
format :: Format
..} 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 (TensorViewCreateInfoARM es)
p Ptr (TensorViewCreateInfoARM es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_VIEW_CREATE_INFO_ARM)
pNext'' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: 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) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 TensorViewCreateFlagsARM)) (flags)
lift $ poke ((p `plusPtr` 24 :: Ptr TensorARM)) (tensor)
lift $ poke ((p `plusPtr` 32 :: Ptr Format)) (format)
lift $ f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr (TensorViewCreateInfoARM es) -> IO b -> IO b
pokeZeroCStruct Ptr (TensorViewCreateInfoARM 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 (TensorViewCreateInfoARM es)
p Ptr (TensorViewCreateInfoARM es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_VIEW_CREATE_INFO_ARM)
pNext' <- (Ptr (Chain es) -> "data" ::: Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: 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) -> "data" ::: Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO ("data" ::: Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 ("data" ::: Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO ("data" ::: 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 TensorARM)) (zero)
lift $ poke ((p `plusPtr` 32 :: Ptr Format)) (zero)
lift $ f
instance ( Extendss TensorViewCreateInfoARM es
, PeekChain es ) => FromCStruct (TensorViewCreateInfoARM es) where
peekCStruct :: Ptr (TensorViewCreateInfoARM es) -> IO (TensorViewCreateInfoARM es)
peekCStruct Ptr (TensorViewCreateInfoARM es)
p = do
pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (TensorViewCreateInfoARM es)
p Ptr (TensorViewCreateInfoARM es) -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
next <- peekChain (castPtr pNext)
flags <- peek @TensorViewCreateFlagsARM ((p `plusPtr` 16 :: Ptr TensorViewCreateFlagsARM))
tensor <- peek @TensorARM ((p `plusPtr` 24 :: Ptr TensorARM))
format <- peek @Format ((p `plusPtr` 32 :: Ptr Format))
pure $ TensorViewCreateInfoARM
next flags tensor format
instance es ~ '[] => Zero (TensorViewCreateInfoARM es) where
zero :: TensorViewCreateInfoARM es
zero = Chain es
-> TensorViewCreateFlagsARM
-> TensorARM
-> Format
-> TensorViewCreateInfoARM es
forall (es :: [*]).
Chain es
-> TensorViewCreateFlagsARM
-> TensorARM
-> Format
-> TensorViewCreateInfoARM es
TensorViewCreateInfoARM
()
TensorViewCreateFlagsARM
forall a. Zero a => a
zero
TensorARM
forall a. Zero a => a
zero
Format
forall a. Zero a => a
zero
data TensorMemoryRequirementsInfoARM = TensorMemoryRequirementsInfoARM
{
TensorMemoryRequirementsInfoARM -> TensorARM
tensor :: TensorARM }
deriving (Typeable, TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool
(TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool)
-> (TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool)
-> Eq TensorMemoryRequirementsInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool
== :: TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool
$c/= :: TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool
/= :: TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorMemoryRequirementsInfoARM)
#endif
deriving instance Show TensorMemoryRequirementsInfoARM
instance ToCStruct TensorMemoryRequirementsInfoARM where
withCStruct :: forall b.
TensorMemoryRequirementsInfoARM
-> (Ptr TensorMemoryRequirementsInfoARM -> IO b) -> IO b
withCStruct TensorMemoryRequirementsInfoARM
x Ptr TensorMemoryRequirementsInfoARM -> IO b
f = Int -> (Ptr TensorMemoryRequirementsInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr TensorMemoryRequirementsInfoARM -> IO b) -> IO b)
-> (Ptr TensorMemoryRequirementsInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorMemoryRequirementsInfoARM
p -> Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO b -> IO b
forall b.
Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorMemoryRequirementsInfoARM
p TensorMemoryRequirementsInfoARM
x (Ptr TensorMemoryRequirementsInfoARM -> IO b
f Ptr TensorMemoryRequirementsInfoARM
p)
pokeCStruct :: forall b.
Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO b -> IO b
pokeCStruct Ptr TensorMemoryRequirementsInfoARM
p TensorMemoryRequirementsInfoARM{TensorARM
tensor :: TensorMemoryRequirementsInfoARM -> TensorARM
tensor :: TensorARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_MEMORY_REQUIREMENTS_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
tensor)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorMemoryRequirementsInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorMemoryRequirementsInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_MEMORY_REQUIREMENTS_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorMemoryRequirementsInfoARM where
peekCStruct :: Ptr TensorMemoryRequirementsInfoARM
-> IO TensorMemoryRequirementsInfoARM
peekCStruct Ptr TensorMemoryRequirementsInfoARM
p = do
tensor <- forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr TensorMemoryRequirementsInfoARM
p Ptr TensorMemoryRequirementsInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM))
pure $ TensorMemoryRequirementsInfoARM
tensor
instance Storable TensorMemoryRequirementsInfoARM where
sizeOf :: TensorMemoryRequirementsInfoARM -> Int
sizeOf ~TensorMemoryRequirementsInfoARM
_ = Int
24
alignment :: TensorMemoryRequirementsInfoARM -> Int
alignment ~TensorMemoryRequirementsInfoARM
_ = Int
8
peek :: Ptr TensorMemoryRequirementsInfoARM
-> IO TensorMemoryRequirementsInfoARM
peek = Ptr TensorMemoryRequirementsInfoARM
-> IO TensorMemoryRequirementsInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO ()
poke Ptr TensorMemoryRequirementsInfoARM
ptr TensorMemoryRequirementsInfoARM
poked = Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO () -> IO ()
forall b.
Ptr TensorMemoryRequirementsInfoARM
-> TensorMemoryRequirementsInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorMemoryRequirementsInfoARM
ptr TensorMemoryRequirementsInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TensorMemoryRequirementsInfoARM where
zero :: TensorMemoryRequirementsInfoARM
zero = TensorARM -> TensorMemoryRequirementsInfoARM
TensorMemoryRequirementsInfoARM
TensorARM
forall a. Zero a => a
zero
data BindTensorMemoryInfoARM = BindTensorMemoryInfoARM
{
BindTensorMemoryInfoARM -> TensorARM
tensor :: TensorARM
,
BindTensorMemoryInfoARM -> DeviceMemory
memory :: DeviceMemory
,
BindTensorMemoryInfoARM -> Word64
memoryOffset :: DeviceSize
}
deriving (Typeable, BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool
(BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool)
-> (BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool)
-> Eq BindTensorMemoryInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool
== :: BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool
$c/= :: BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool
/= :: BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BindTensorMemoryInfoARM)
#endif
deriving instance Show BindTensorMemoryInfoARM
instance ToCStruct BindTensorMemoryInfoARM where
withCStruct :: forall b.
BindTensorMemoryInfoARM
-> (Ptr BindTensorMemoryInfoARM -> IO b) -> IO b
withCStruct BindTensorMemoryInfoARM
x Ptr BindTensorMemoryInfoARM -> IO b
f = Int -> (Ptr BindTensorMemoryInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr BindTensorMemoryInfoARM -> IO b) -> IO b)
-> (Ptr BindTensorMemoryInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr BindTensorMemoryInfoARM
p -> Ptr BindTensorMemoryInfoARM
-> BindTensorMemoryInfoARM -> IO b -> IO b
forall b.
Ptr BindTensorMemoryInfoARM
-> BindTensorMemoryInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindTensorMemoryInfoARM
p BindTensorMemoryInfoARM
x (Ptr BindTensorMemoryInfoARM -> IO b
f Ptr BindTensorMemoryInfoARM
p)
pokeCStruct :: forall b.
Ptr BindTensorMemoryInfoARM
-> BindTensorMemoryInfoARM -> IO b -> IO b
pokeCStruct Ptr BindTensorMemoryInfoARM
p BindTensorMemoryInfoARM{Word64
DeviceMemory
TensorARM
tensor :: BindTensorMemoryInfoARM -> TensorARM
memory :: BindTensorMemoryInfoARM -> DeviceMemory
memoryOffset :: BindTensorMemoryInfoARM -> Word64
tensor :: TensorARM
memory :: DeviceMemory
memoryOffset :: Word64
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_TENSOR_MEMORY_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
tensor)
Ptr DeviceMemory -> DeviceMemory -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr DeviceMemory
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (DeviceMemory
memory)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (Word64
memoryOffset)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr BindTensorMemoryInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr BindTensorMemoryInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BIND_TENSOR_MEMORY_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
Ptr DeviceMemory -> DeviceMemory -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr DeviceMemory
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceMemory)) (DeviceMemory
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr DeviceSize)) (Word64
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct BindTensorMemoryInfoARM where
peekCStruct :: Ptr BindTensorMemoryInfoARM -> IO BindTensorMemoryInfoARM
peekCStruct Ptr BindTensorMemoryInfoARM
p = do
tensor <- forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr BindTensorMemoryInfoARM
p Ptr BindTensorMemoryInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM))
memory <- peek @DeviceMemory ((p `plusPtr` 24 :: Ptr DeviceMemory))
memoryOffset <- peek @DeviceSize ((p `plusPtr` 32 :: Ptr DeviceSize))
pure $ BindTensorMemoryInfoARM
tensor memory memoryOffset
instance Storable BindTensorMemoryInfoARM where
sizeOf :: BindTensorMemoryInfoARM -> Int
sizeOf ~BindTensorMemoryInfoARM
_ = Int
40
alignment :: BindTensorMemoryInfoARM -> Int
alignment ~BindTensorMemoryInfoARM
_ = Int
8
peek :: Ptr BindTensorMemoryInfoARM -> IO BindTensorMemoryInfoARM
peek = Ptr BindTensorMemoryInfoARM -> IO BindTensorMemoryInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr BindTensorMemoryInfoARM -> BindTensorMemoryInfoARM -> IO ()
poke Ptr BindTensorMemoryInfoARM
ptr BindTensorMemoryInfoARM
poked = Ptr BindTensorMemoryInfoARM
-> BindTensorMemoryInfoARM -> IO () -> IO ()
forall b.
Ptr BindTensorMemoryInfoARM
-> BindTensorMemoryInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BindTensorMemoryInfoARM
ptr BindTensorMemoryInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero BindTensorMemoryInfoARM where
zero :: BindTensorMemoryInfoARM
zero = TensorARM -> DeviceMemory -> Word64 -> BindTensorMemoryInfoARM
BindTensorMemoryInfoARM
TensorARM
forall a. Zero a => a
zero
DeviceMemory
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
data WriteDescriptorSetTensorARM = WriteDescriptorSetTensorARM
{
WriteDescriptorSetTensorARM -> Vector TensorViewARM
tensorViews :: Vector TensorViewARM }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (WriteDescriptorSetTensorARM)
#endif
deriving instance Show WriteDescriptorSetTensorARM
instance ToCStruct WriteDescriptorSetTensorARM where
withCStruct :: forall b.
WriteDescriptorSetTensorARM
-> (Ptr WriteDescriptorSetTensorARM -> IO b) -> IO b
withCStruct WriteDescriptorSetTensorARM
x Ptr WriteDescriptorSetTensorARM -> IO b
f = Int -> (Ptr WriteDescriptorSetTensorARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr WriteDescriptorSetTensorARM -> IO b) -> IO b)
-> (Ptr WriteDescriptorSetTensorARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr WriteDescriptorSetTensorARM
p -> Ptr WriteDescriptorSetTensorARM
-> WriteDescriptorSetTensorARM -> IO b -> IO b
forall b.
Ptr WriteDescriptorSetTensorARM
-> WriteDescriptorSetTensorARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr WriteDescriptorSetTensorARM
p WriteDescriptorSetTensorARM
x (Ptr WriteDescriptorSetTensorARM -> IO b
f Ptr WriteDescriptorSetTensorARM
p)
pokeCStruct :: forall b.
Ptr WriteDescriptorSetTensorARM
-> WriteDescriptorSetTensorARM -> IO b -> IO b
pokeCStruct Ptr WriteDescriptorSetTensorARM
p WriteDescriptorSetTensorARM{Vector TensorViewARM
tensorViews :: WriteDescriptorSetTensorARM -> Vector TensorViewARM
tensorViews :: Vector TensorViewARM
..} 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 WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_TENSOR_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector TensorViewARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorViewARM -> Int) -> Vector TensorViewARM -> Int
forall a b. (a -> b) -> a -> b
$ (Vector TensorViewARM
tensorViews)) :: Word32))
pPTensorViews' <- ((Ptr TensorViewARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorViewARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorViewARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorViewARM))
-> ((Ptr TensorViewARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorViewARM)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @TensorViewARM ((Vector TensorViewARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorViewARM
tensorViews)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
lift $ Data.Vector.imapM_ (\Int
i TensorViewARM
e -> Ptr TensorViewARM -> TensorViewARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TensorViewARM
pPTensorViews' Ptr TensorViewARM -> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorViewARM) (TensorViewARM
e)) (tensorViews)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorViewARM))) (pPTensorViews')
lift $ f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr WriteDescriptorSetTensorARM -> IO b -> IO b
pokeZeroCStruct Ptr WriteDescriptorSetTensorARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_TENSOR_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct WriteDescriptorSetTensorARM where
peekCStruct :: Ptr WriteDescriptorSetTensorARM -> IO WriteDescriptorSetTensorARM
peekCStruct Ptr WriteDescriptorSetTensorARM
p = do
tensorViewCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr WriteDescriptorSetTensorARM
p Ptr WriteDescriptorSetTensorARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
pTensorViews <- peek @(Ptr TensorViewARM) ((p `plusPtr` 24 :: Ptr (Ptr TensorViewARM)))
pTensorViews' <- generateM (fromIntegral tensorViewCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @TensorViewARM ((Ptr TensorViewARM
pTensorViews Ptr TensorViewARM -> Int -> Ptr TensorViewARM
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorViewARM)))
pure $ WriteDescriptorSetTensorARM
pTensorViews'
instance Zero WriteDescriptorSetTensorARM where
zero :: WriteDescriptorSetTensorARM
zero = Vector TensorViewARM -> WriteDescriptorSetTensorARM
WriteDescriptorSetTensorARM
Vector TensorViewARM
forall a. Monoid a => a
mempty
data TensorFormatPropertiesARM = TensorFormatPropertiesARM
{
TensorFormatPropertiesARM -> FormatFeatureFlags2
optimalTilingTensorFeatures :: FormatFeatureFlags2
,
TensorFormatPropertiesARM -> FormatFeatureFlags2
linearTilingTensorFeatures :: FormatFeatureFlags2
}
deriving (Typeable, TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool
(TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool)
-> (TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool)
-> Eq TensorFormatPropertiesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool
== :: TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool
$c/= :: TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool
/= :: TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorFormatPropertiesARM)
#endif
deriving instance Show TensorFormatPropertiesARM
instance ToCStruct TensorFormatPropertiesARM where
withCStruct :: forall b.
TensorFormatPropertiesARM
-> (Ptr TensorFormatPropertiesARM -> IO b) -> IO b
withCStruct TensorFormatPropertiesARM
x Ptr TensorFormatPropertiesARM -> IO b
f = Int -> (Ptr TensorFormatPropertiesARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr TensorFormatPropertiesARM -> IO b) -> IO b)
-> (Ptr TensorFormatPropertiesARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorFormatPropertiesARM
p -> Ptr TensorFormatPropertiesARM
-> TensorFormatPropertiesARM -> IO b -> IO b
forall b.
Ptr TensorFormatPropertiesARM
-> TensorFormatPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorFormatPropertiesARM
p TensorFormatPropertiesARM
x (Ptr TensorFormatPropertiesARM -> IO b
f Ptr TensorFormatPropertiesARM
p)
pokeCStruct :: forall b.
Ptr TensorFormatPropertiesARM
-> TensorFormatPropertiesARM -> IO b -> IO b
pokeCStruct Ptr TensorFormatPropertiesARM
p TensorFormatPropertiesARM{FormatFeatureFlags2
optimalTilingTensorFeatures :: TensorFormatPropertiesARM -> FormatFeatureFlags2
linearTilingTensorFeatures :: TensorFormatPropertiesARM -> FormatFeatureFlags2
optimalTilingTensorFeatures :: FormatFeatureFlags2
linearTilingTensorFeatures :: FormatFeatureFlags2
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_FORMAT_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr FormatFeatureFlags2 -> FormatFeatureFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr FormatFeatureFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FormatFeatureFlags2)) (FormatFeatureFlags2
optimalTilingTensorFeatures)
Ptr FormatFeatureFlags2 -> FormatFeatureFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr FormatFeatureFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr FormatFeatureFlags2)) (FormatFeatureFlags2
linearTilingTensorFeatures)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorFormatPropertiesARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorFormatPropertiesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_FORMAT_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr FormatFeatureFlags2 -> FormatFeatureFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr FormatFeatureFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FormatFeatureFlags2)) (FormatFeatureFlags2
forall a. Zero a => a
zero)
Ptr FormatFeatureFlags2 -> FormatFeatureFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr FormatFeatureFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr FormatFeatureFlags2)) (FormatFeatureFlags2
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorFormatPropertiesARM where
peekCStruct :: Ptr TensorFormatPropertiesARM -> IO TensorFormatPropertiesARM
peekCStruct Ptr TensorFormatPropertiesARM
p = do
optimalTilingTensorFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags2 ((Ptr TensorFormatPropertiesARM
p Ptr TensorFormatPropertiesARM -> Int -> Ptr FormatFeatureFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FormatFeatureFlags2))
linearTilingTensorFeatures <- peek @FormatFeatureFlags2 ((p `plusPtr` 24 :: Ptr FormatFeatureFlags2))
pure $ TensorFormatPropertiesARM
optimalTilingTensorFeatures linearTilingTensorFeatures
instance Storable TensorFormatPropertiesARM where
sizeOf :: TensorFormatPropertiesARM -> Int
sizeOf ~TensorFormatPropertiesARM
_ = Int
32
alignment :: TensorFormatPropertiesARM -> Int
alignment ~TensorFormatPropertiesARM
_ = Int
8
peek :: Ptr TensorFormatPropertiesARM -> IO TensorFormatPropertiesARM
peek = Ptr TensorFormatPropertiesARM -> IO TensorFormatPropertiesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TensorFormatPropertiesARM -> TensorFormatPropertiesARM -> IO ()
poke Ptr TensorFormatPropertiesARM
ptr TensorFormatPropertiesARM
poked = Ptr TensorFormatPropertiesARM
-> TensorFormatPropertiesARM -> IO () -> IO ()
forall b.
Ptr TensorFormatPropertiesARM
-> TensorFormatPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorFormatPropertiesARM
ptr TensorFormatPropertiesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TensorFormatPropertiesARM where
zero :: TensorFormatPropertiesARM
zero = FormatFeatureFlags2
-> FormatFeatureFlags2 -> TensorFormatPropertiesARM
TensorFormatPropertiesARM
FormatFeatureFlags2
forall a. Zero a => a
zero
FormatFeatureFlags2
forall a. Zero a => a
zero
data PhysicalDeviceTensorPropertiesARM = PhysicalDeviceTensorPropertiesARM
{
PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorDimensionCount :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorElements :: Word64
,
PhysicalDeviceTensorPropertiesARM -> Word64
maxPerDimensionTensorElements :: Word64
,
PhysicalDeviceTensorPropertiesARM -> Int64
maxTensorStride :: Int64
,
PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorSize :: Word64
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorShaderAccessArrayLength :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorShaderAccessSize :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetStorageTensors :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorSetStorageTensors :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetUpdateAfterBindStorageTensors :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorUpdateAfterBindStorageTensors :: Word32
,
PhysicalDeviceTensorPropertiesARM -> Bool
shaderStorageTensorArrayNonUniformIndexingNative :: Bool
,
PhysicalDeviceTensorPropertiesARM -> ShaderStageFlags
shaderTensorSupportedStages :: ShaderStageFlags
}
deriving (Typeable, PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool
(PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool)
-> (PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool)
-> Eq PhysicalDeviceTensorPropertiesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool
== :: PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool
$c/= :: PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool
/= :: PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceTensorPropertiesARM)
#endif
deriving instance Show PhysicalDeviceTensorPropertiesARM
instance ToCStruct PhysicalDeviceTensorPropertiesARM where
withCStruct :: forall b.
PhysicalDeviceTensorPropertiesARM
-> (Ptr PhysicalDeviceTensorPropertiesARM -> IO b) -> IO b
withCStruct PhysicalDeviceTensorPropertiesARM
x Ptr PhysicalDeviceTensorPropertiesARM -> IO b
f = Int -> (Ptr PhysicalDeviceTensorPropertiesARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 ((Ptr PhysicalDeviceTensorPropertiesARM -> IO b) -> IO b)
-> (Ptr PhysicalDeviceTensorPropertiesARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceTensorPropertiesARM
p -> Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO b -> IO b
forall b.
Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorPropertiesARM
p PhysicalDeviceTensorPropertiesARM
x (Ptr PhysicalDeviceTensorPropertiesARM -> IO b
f Ptr PhysicalDeviceTensorPropertiesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorPropertiesARM
p PhysicalDeviceTensorPropertiesARM{Bool
Int64
Word32
Word64
ShaderStageFlags
maxTensorDimensionCount :: PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorElements :: PhysicalDeviceTensorPropertiesARM -> Word64
maxPerDimensionTensorElements :: PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorStride :: PhysicalDeviceTensorPropertiesARM -> Int64
maxTensorSize :: PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorShaderAccessArrayLength :: PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorShaderAccessSize :: PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetStorageTensors :: PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorSetStorageTensors :: PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetUpdateAfterBindStorageTensors :: PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorUpdateAfterBindStorageTensors :: PhysicalDeviceTensorPropertiesARM -> Word32
shaderStorageTensorArrayNonUniformIndexingNative :: PhysicalDeviceTensorPropertiesARM -> Bool
shaderTensorSupportedStages :: PhysicalDeviceTensorPropertiesARM -> ShaderStageFlags
maxTensorDimensionCount :: Word32
maxTensorElements :: Word64
maxPerDimensionTensorElements :: Word64
maxTensorStride :: Int64
maxTensorSize :: Word64
maxTensorShaderAccessArrayLength :: Word32
maxTensorShaderAccessSize :: Word32
maxDescriptorSetStorageTensors :: Word32
maxPerStageDescriptorSetStorageTensors :: Word32
maxDescriptorSetUpdateAfterBindStorageTensors :: Word32
maxPerStageDescriptorUpdateAfterBindStorageTensors :: Word32
shaderStorageTensorArrayNonUniformIndexingNative :: Bool
shaderTensorSupportedStages :: ShaderStageFlags
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
maxTensorDimensionCount)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (Word64
maxTensorElements)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (Word64
maxPerDimensionTensorElements)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (Int64
maxTensorStride)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word64)) (Word64
maxTensorSize)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word32)) (Word32
maxTensorShaderAccessArrayLength)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Word32)) (Word32
maxTensorShaderAccessSize)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32)) (Word32
maxDescriptorSetStorageTensors)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr Word32)) (Word32
maxPerStageDescriptorSetStorageTensors)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) (Word32
maxDescriptorSetUpdateAfterBindStorageTensors)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
76 :: Ptr Word32)) (Word32
maxPerStageDescriptorUpdateAfterBindStorageTensors)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderStorageTensorArrayNonUniformIndexingNative))
Ptr ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84 :: Ptr ShaderStageFlags)) (ShaderStageFlags
shaderTensorSupportedStages)
IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceTensorPropertiesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceTensorPropertiesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word64)) (Word64
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (Word64
forall a. Zero a => a
zero)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (Int64
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word64)) (Word64
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
68 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
76 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr ShaderStageFlags -> ShaderStageFlags -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM
-> Int -> Ptr ShaderStageFlags
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84 :: Ptr ShaderStageFlags)) (ShaderStageFlags
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct PhysicalDeviceTensorPropertiesARM where
peekCStruct :: Ptr PhysicalDeviceTensorPropertiesARM
-> IO PhysicalDeviceTensorPropertiesARM
peekCStruct Ptr PhysicalDeviceTensorPropertiesARM
p = do
maxTensorDimensionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceTensorPropertiesARM
p Ptr PhysicalDeviceTensorPropertiesARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
maxTensorElements <- peek @Word64 ((p `plusPtr` 24 :: Ptr Word64))
maxPerDimensionTensorElements <- peek @Word64 ((p `plusPtr` 32 :: Ptr Word64))
maxTensorStride <- peek @Int64 ((p `plusPtr` 40 :: Ptr Int64))
maxTensorSize <- peek @Word64 ((p `plusPtr` 48 :: Ptr Word64))
maxTensorShaderAccessArrayLength <- peek @Word32 ((p `plusPtr` 56 :: Ptr Word32))
maxTensorShaderAccessSize <- peek @Word32 ((p `plusPtr` 60 :: Ptr Word32))
maxDescriptorSetStorageTensors <- peek @Word32 ((p `plusPtr` 64 :: Ptr Word32))
maxPerStageDescriptorSetStorageTensors <- peek @Word32 ((p `plusPtr` 68 :: Ptr Word32))
maxDescriptorSetUpdateAfterBindStorageTensors <- peek @Word32 ((p `plusPtr` 72 :: Ptr Word32))
maxPerStageDescriptorUpdateAfterBindStorageTensors <- peek @Word32 ((p `plusPtr` 76 :: Ptr Word32))
shaderStorageTensorArrayNonUniformIndexingNative <- peek @Bool32 ((p `plusPtr` 80 :: Ptr Bool32))
shaderTensorSupportedStages <- peek @ShaderStageFlags ((p `plusPtr` 84 :: Ptr ShaderStageFlags))
pure $ PhysicalDeviceTensorPropertiesARM
maxTensorDimensionCount
maxTensorElements
maxPerDimensionTensorElements
maxTensorStride
maxTensorSize
maxTensorShaderAccessArrayLength
maxTensorShaderAccessSize
maxDescriptorSetStorageTensors
maxPerStageDescriptorSetStorageTensors
maxDescriptorSetUpdateAfterBindStorageTensors
maxPerStageDescriptorUpdateAfterBindStorageTensors
(bool32ToBool shaderStorageTensorArrayNonUniformIndexingNative)
shaderTensorSupportedStages
instance Storable PhysicalDeviceTensorPropertiesARM where
sizeOf :: PhysicalDeviceTensorPropertiesARM -> Int
sizeOf ~PhysicalDeviceTensorPropertiesARM
_ = Int
88
alignment :: PhysicalDeviceTensorPropertiesARM -> Int
alignment ~PhysicalDeviceTensorPropertiesARM
_ = Int
8
peek :: Ptr PhysicalDeviceTensorPropertiesARM
-> IO PhysicalDeviceTensorPropertiesARM
peek = Ptr PhysicalDeviceTensorPropertiesARM
-> IO PhysicalDeviceTensorPropertiesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO ()
poke Ptr PhysicalDeviceTensorPropertiesARM
ptr PhysicalDeviceTensorPropertiesARM
poked = Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceTensorPropertiesARM
-> PhysicalDeviceTensorPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorPropertiesARM
ptr PhysicalDeviceTensorPropertiesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceTensorPropertiesARM where
zero :: PhysicalDeviceTensorPropertiesARM
zero = Word32
-> Word64
-> Word64
-> Int64
-> Word64
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Bool
-> ShaderStageFlags
-> PhysicalDeviceTensorPropertiesARM
PhysicalDeviceTensorPropertiesARM
Word32
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
Int64
forall a. Zero a => a
zero
Word64
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
Bool
forall a. Zero a => a
zero
ShaderStageFlags
forall a. Zero a => a
zero
data TensorMemoryBarrierARM = TensorMemoryBarrierARM
{
TensorMemoryBarrierARM -> PipelineStageFlags2
srcStageMask :: PipelineStageFlags2
,
TensorMemoryBarrierARM -> AccessFlags2
srcAccessMask :: AccessFlags2
,
TensorMemoryBarrierARM -> PipelineStageFlags2
dstStageMask :: PipelineStageFlags2
,
TensorMemoryBarrierARM -> AccessFlags2
dstAccessMask :: AccessFlags2
,
TensorMemoryBarrierARM -> Word32
srcQueueFamilyIndex :: Word32
,
TensorMemoryBarrierARM -> Word32
dstQueueFamilyIndex :: Word32
,
TensorMemoryBarrierARM -> TensorARM
tensor :: TensorARM
}
deriving (Typeable, TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool
(TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool)
-> (TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool)
-> Eq TensorMemoryBarrierARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool
== :: TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool
$c/= :: TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool
/= :: TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorMemoryBarrierARM)
#endif
deriving instance Show TensorMemoryBarrierARM
instance ToCStruct TensorMemoryBarrierARM where
withCStruct :: forall b.
TensorMemoryBarrierARM
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
withCStruct TensorMemoryBarrierARM
x Ptr TensorMemoryBarrierARM -> IO b
f = Int -> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
64 ((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorMemoryBarrierARM
p -> Ptr TensorMemoryBarrierARM
-> TensorMemoryBarrierARM -> IO b -> IO b
forall b.
Ptr TensorMemoryBarrierARM
-> TensorMemoryBarrierARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorMemoryBarrierARM
p TensorMemoryBarrierARM
x (Ptr TensorMemoryBarrierARM -> IO b
f Ptr TensorMemoryBarrierARM
p)
pokeCStruct :: forall b.
Ptr TensorMemoryBarrierARM
-> TensorMemoryBarrierARM -> IO b -> IO b
pokeCStruct Ptr TensorMemoryBarrierARM
p TensorMemoryBarrierARM{Word32
PipelineStageFlags2
AccessFlags2
TensorARM
srcStageMask :: TensorMemoryBarrierARM -> PipelineStageFlags2
srcAccessMask :: TensorMemoryBarrierARM -> AccessFlags2
dstStageMask :: TensorMemoryBarrierARM -> PipelineStageFlags2
dstAccessMask :: TensorMemoryBarrierARM -> AccessFlags2
srcQueueFamilyIndex :: TensorMemoryBarrierARM -> Word32
dstQueueFamilyIndex :: TensorMemoryBarrierARM -> Word32
tensor :: TensorMemoryBarrierARM -> TensorARM
srcStageMask :: PipelineStageFlags2
srcAccessMask :: AccessFlags2
dstStageMask :: PipelineStageFlags2
dstAccessMask :: AccessFlags2
srcQueueFamilyIndex :: Word32
dstQueueFamilyIndex :: Word32
tensor :: TensorARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_MEMORY_BARRIER_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr PipelineStageFlags2 -> PipelineStageFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr PipelineStageFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineStageFlags2)) (PipelineStageFlags2
srcStageMask)
Ptr AccessFlags2 -> AccessFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr AccessFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr AccessFlags2)) (AccessFlags2
srcAccessMask)
Ptr PipelineStageFlags2 -> PipelineStageFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr PipelineStageFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr PipelineStageFlags2)) (PipelineStageFlags2
dstStageMask)
Ptr AccessFlags2 -> AccessFlags2 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr AccessFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr AccessFlags2)) (AccessFlags2
dstAccessMask)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
srcQueueFamilyIndex)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Word32)) (Word32
dstQueueFamilyIndex)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr TensorARM)) (TensorARM
tensor)
IO b
f
cStructSize :: Int
cStructSize = Int
64
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorMemoryBarrierARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorMemoryBarrierARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_MEMORY_BARRIER_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
52 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorMemoryBarrierARM where
peekCStruct :: Ptr TensorMemoryBarrierARM -> IO TensorMemoryBarrierARM
peekCStruct Ptr TensorMemoryBarrierARM
p = do
srcStageMask <- forall a. Storable a => Ptr a -> IO a
peek @PipelineStageFlags2 ((Ptr TensorMemoryBarrierARM
p Ptr TensorMemoryBarrierARM -> Int -> Ptr PipelineStageFlags2
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr PipelineStageFlags2))
srcAccessMask <- peek @AccessFlags2 ((p `plusPtr` 24 :: Ptr AccessFlags2))
dstStageMask <- peek @PipelineStageFlags2 ((p `plusPtr` 32 :: Ptr PipelineStageFlags2))
dstAccessMask <- peek @AccessFlags2 ((p `plusPtr` 40 :: Ptr AccessFlags2))
srcQueueFamilyIndex <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
dstQueueFamilyIndex <- peek @Word32 ((p `plusPtr` 52 :: Ptr Word32))
tensor <- peek @TensorARM ((p `plusPtr` 56 :: Ptr TensorARM))
pure $ TensorMemoryBarrierARM
srcStageMask
srcAccessMask
dstStageMask
dstAccessMask
srcQueueFamilyIndex
dstQueueFamilyIndex
tensor
instance Storable TensorMemoryBarrierARM where
sizeOf :: TensorMemoryBarrierARM -> Int
sizeOf ~TensorMemoryBarrierARM
_ = Int
64
alignment :: TensorMemoryBarrierARM -> Int
alignment ~TensorMemoryBarrierARM
_ = Int
8
peek :: Ptr TensorMemoryBarrierARM -> IO TensorMemoryBarrierARM
peek = Ptr TensorMemoryBarrierARM -> IO TensorMemoryBarrierARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TensorMemoryBarrierARM -> TensorMemoryBarrierARM -> IO ()
poke Ptr TensorMemoryBarrierARM
ptr TensorMemoryBarrierARM
poked = Ptr TensorMemoryBarrierARM
-> TensorMemoryBarrierARM -> IO () -> IO ()
forall b.
Ptr TensorMemoryBarrierARM
-> TensorMemoryBarrierARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorMemoryBarrierARM
ptr TensorMemoryBarrierARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TensorMemoryBarrierARM where
zero :: TensorMemoryBarrierARM
zero = PipelineStageFlags2
-> AccessFlags2
-> PipelineStageFlags2
-> AccessFlags2
-> Word32
-> Word32
-> TensorARM
-> TensorMemoryBarrierARM
TensorMemoryBarrierARM
PipelineStageFlags2
forall a. Zero a => a
zero
AccessFlags2
forall a. Zero a => a
zero
PipelineStageFlags2
forall a. Zero a => a
zero
AccessFlags2
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
TensorARM
forall a. Zero a => a
zero
data TensorDependencyInfoARM = TensorDependencyInfoARM
{
TensorDependencyInfoARM -> Word32
tensorMemoryBarrierCount :: Word32
,
TensorDependencyInfoARM -> TensorMemoryBarrierARM
tensorMemoryBarriers :: TensorMemoryBarrierARM
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorDependencyInfoARM)
#endif
deriving instance Show TensorDependencyInfoARM
instance ToCStruct TensorDependencyInfoARM where
withCStruct :: forall b.
TensorDependencyInfoARM
-> (Ptr TensorDependencyInfoARM -> IO b) -> IO b
withCStruct TensorDependencyInfoARM
x Ptr TensorDependencyInfoARM -> IO b
f = Int -> (Ptr TensorDependencyInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr TensorDependencyInfoARM -> IO b) -> IO b)
-> (Ptr TensorDependencyInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorDependencyInfoARM
p -> Ptr TensorDependencyInfoARM
-> TensorDependencyInfoARM -> IO b -> IO b
forall b.
Ptr TensorDependencyInfoARM
-> TensorDependencyInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorDependencyInfoARM
p TensorDependencyInfoARM
x (Ptr TensorDependencyInfoARM -> IO b
f Ptr TensorDependencyInfoARM
p)
pokeCStruct :: forall b.
Ptr TensorDependencyInfoARM
-> TensorDependencyInfoARM -> IO b -> IO b
pokeCStruct Ptr TensorDependencyInfoARM
p TensorDependencyInfoARM{Word32
TensorMemoryBarrierARM
tensorMemoryBarrierCount :: TensorDependencyInfoARM -> Word32
tensorMemoryBarriers :: TensorDependencyInfoARM -> TensorMemoryBarrierARM
tensorMemoryBarrierCount :: Word32
tensorMemoryBarriers :: TensorMemoryBarrierARM
..} 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 TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_DEPENDENCY_INFO_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
tensorMemoryBarrierCount)
pTensorMemoryBarriers'' <- ((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM))
-> ((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM)
forall a b. (a -> b) -> a -> b
$ TensorMemoryBarrierARM
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorMemoryBarrierARM
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
withCStruct (TensorMemoryBarrierARM
tensorMemoryBarriers)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorMemoryBarrierARM))) pTensorMemoryBarriers''
lift $ f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorDependencyInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorDependencyInfoARM
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 TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_DEPENDENCY_INFO_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
pTensorMemoryBarriers'' <- ((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM))
-> ((Ptr TensorMemoryBarrierARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorMemoryBarrierARM)
forall a b. (a -> b) -> a -> b
$ TensorMemoryBarrierARM
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorMemoryBarrierARM
-> (Ptr TensorMemoryBarrierARM -> IO b) -> IO b
withCStruct (TensorMemoryBarrierARM
forall a. Zero a => a
zero)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorMemoryBarrierARM))) pTensorMemoryBarriers''
lift $ f
instance FromCStruct TensorDependencyInfoARM where
peekCStruct :: Ptr TensorDependencyInfoARM -> IO TensorDependencyInfoARM
peekCStruct Ptr TensorDependencyInfoARM
p = do
tensorMemoryBarrierCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr TensorDependencyInfoARM
p Ptr TensorDependencyInfoARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
pTensorMemoryBarriers <- peekCStruct @TensorMemoryBarrierARM =<< peek ((p `plusPtr` 24 :: Ptr (Ptr TensorMemoryBarrierARM)))
pure $ TensorDependencyInfoARM
tensorMemoryBarrierCount pTensorMemoryBarriers
instance Zero TensorDependencyInfoARM where
zero :: TensorDependencyInfoARM
zero = Word32 -> TensorMemoryBarrierARM -> TensorDependencyInfoARM
TensorDependencyInfoARM
Word32
forall a. Zero a => a
zero
TensorMemoryBarrierARM
forall a. Zero a => a
zero
data PhysicalDeviceTensorFeaturesARM = PhysicalDeviceTensorFeaturesARM
{
PhysicalDeviceTensorFeaturesARM -> Bool
tensorNonPacked :: Bool
,
PhysicalDeviceTensorFeaturesARM -> Bool
shaderTensorAccess :: Bool
,
PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayDynamicIndexing :: Bool
,
PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayNonUniformIndexing :: Bool
,
PhysicalDeviceTensorFeaturesARM -> Bool
descriptorBindingStorageTensorUpdateAfterBind :: Bool
,
PhysicalDeviceTensorFeaturesARM -> Bool
tensors :: Bool
}
deriving (Typeable, PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool
(PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool)
-> (PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool)
-> Eq PhysicalDeviceTensorFeaturesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool
== :: PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool
$c/= :: PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool
/= :: PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceTensorFeaturesARM)
#endif
deriving instance Show PhysicalDeviceTensorFeaturesARM
instance ToCStruct PhysicalDeviceTensorFeaturesARM where
withCStruct :: forall b.
PhysicalDeviceTensorFeaturesARM
-> (Ptr PhysicalDeviceTensorFeaturesARM -> IO b) -> IO b
withCStruct PhysicalDeviceTensorFeaturesARM
x Ptr PhysicalDeviceTensorFeaturesARM -> IO b
f = Int -> (Ptr PhysicalDeviceTensorFeaturesARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDeviceTensorFeaturesARM -> IO b) -> IO b)
-> (Ptr PhysicalDeviceTensorFeaturesARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceTensorFeaturesARM
p -> Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO b -> IO b
forall b.
Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorFeaturesARM
p PhysicalDeviceTensorFeaturesARM
x (Ptr PhysicalDeviceTensorFeaturesARM -> IO b
f Ptr PhysicalDeviceTensorFeaturesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorFeaturesARM
p PhysicalDeviceTensorFeaturesARM{Bool
tensorNonPacked :: PhysicalDeviceTensorFeaturesARM -> Bool
shaderTensorAccess :: PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayDynamicIndexing :: PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayNonUniformIndexing :: PhysicalDeviceTensorFeaturesARM -> Bool
descriptorBindingStorageTensorUpdateAfterBind :: PhysicalDeviceTensorFeaturesARM -> Bool
tensors :: PhysicalDeviceTensorFeaturesARM -> Bool
tensorNonPacked :: Bool
shaderTensorAccess :: Bool
shaderStorageTensorArrayDynamicIndexing :: Bool
shaderStorageTensorArrayNonUniformIndexing :: Bool
descriptorBindingStorageTensorUpdateAfterBind :: Bool
tensors :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_FEATURES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
tensorNonPacked))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderTensorAccess))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderStorageTensorArrayDynamicIndexing))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
shaderStorageTensorArrayNonUniformIndexing))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
descriptorBindingStorageTensorUpdateAfterBind))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
tensors))
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceTensorFeaturesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceTensorFeaturesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_FEATURES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> 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))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceTensorFeaturesARM where
peekCStruct :: Ptr PhysicalDeviceTensorFeaturesARM
-> IO PhysicalDeviceTensorFeaturesARM
peekCStruct Ptr PhysicalDeviceTensorFeaturesARM
p = do
tensorNonPacked <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceTensorFeaturesARM
p Ptr PhysicalDeviceTensorFeaturesARM -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
shaderTensorAccess <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
shaderStorageTensorArrayDynamicIndexing <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
shaderStorageTensorArrayNonUniformIndexing <- peek @Bool32 ((p `plusPtr` 28 :: Ptr Bool32))
descriptorBindingStorageTensorUpdateAfterBind <- peek @Bool32 ((p `plusPtr` 32 :: Ptr Bool32))
tensors <- peek @Bool32 ((p `plusPtr` 36 :: Ptr Bool32))
pure $ PhysicalDeviceTensorFeaturesARM
(bool32ToBool tensorNonPacked)
(bool32ToBool shaderTensorAccess)
(bool32ToBool shaderStorageTensorArrayDynamicIndexing)
(bool32ToBool shaderStorageTensorArrayNonUniformIndexing)
(bool32ToBool descriptorBindingStorageTensorUpdateAfterBind)
(bool32ToBool tensors)
instance Storable PhysicalDeviceTensorFeaturesARM where
sizeOf :: PhysicalDeviceTensorFeaturesARM -> Int
sizeOf ~PhysicalDeviceTensorFeaturesARM
_ = Int
40
alignment :: PhysicalDeviceTensorFeaturesARM -> Int
alignment ~PhysicalDeviceTensorFeaturesARM
_ = Int
8
peek :: Ptr PhysicalDeviceTensorFeaturesARM
-> IO PhysicalDeviceTensorFeaturesARM
peek = Ptr PhysicalDeviceTensorFeaturesARM
-> IO PhysicalDeviceTensorFeaturesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO ()
poke Ptr PhysicalDeviceTensorFeaturesARM
ptr PhysicalDeviceTensorFeaturesARM
poked = Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceTensorFeaturesARM
-> PhysicalDeviceTensorFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceTensorFeaturesARM
ptr PhysicalDeviceTensorFeaturesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceTensorFeaturesARM where
zero :: PhysicalDeviceTensorFeaturesARM
zero = Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceTensorFeaturesARM
PhysicalDeviceTensorFeaturesARM
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
data DeviceTensorMemoryRequirementsARM = DeviceTensorMemoryRequirementsARM
{
("info" ::: DeviceTensorMemoryRequirementsARM)
-> SomeStruct TensorCreateInfoARM
createInfo :: SomeStruct TensorCreateInfoARM }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceTensorMemoryRequirementsARM)
#endif
deriving instance Show DeviceTensorMemoryRequirementsARM
instance ToCStruct DeviceTensorMemoryRequirementsARM where
withCStruct :: forall b.
("info" ::: DeviceTensorMemoryRequirementsARM)
-> (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b)
-> IO b
withCStruct "info" ::: DeviceTensorMemoryRequirementsARM
x Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b
f = Int
-> (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b)
-> IO b)
-> (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p -> Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b -> IO b
forall b.
Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p "info" ::: DeviceTensorMemoryRequirementsARM
x (Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b
f Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p)
pokeCStruct :: forall b.
Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b -> IO b
pokeCStruct Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p DeviceTensorMemoryRequirementsARM{SomeStruct TensorCreateInfoARM
createInfo :: ("info" ::: DeviceTensorMemoryRequirementsARM)
-> SomeStruct TensorCreateInfoARM
createInfo :: SomeStruct TensorCreateInfoARM
..} 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 ("info" ::: DeviceTensorMemoryRequirementsARM)
p Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_TENSOR_MEMORY_REQUIREMENTS_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
forall r (m :: * -> *) a. ((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (TensorCreateInfoARM '[])) (((Ptr (TensorCreateInfoARM '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (TensorCreateInfoARM '[])))
-> ((Ptr (TensorCreateInfoARM '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (TensorCreateInfoARM '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (TensorCreateInfoARM '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @TensorCreateInfoARM (SomeStruct TensorCreateInfoARM
createInfo) (Ptr (TensorCreateInfoARM '[]) -> IO b
cont (Ptr (TensorCreateInfoARM '[]) -> IO b)
-> (Ptr (TensorCreateInfoARM es) -> Ptr (TensorCreateInfoARM '[]))
-> Ptr (TensorCreateInfoARM es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (TensorCreateInfoARM es) -> Ptr (TensorCreateInfoARM '[])
forall a b. Ptr a -> Ptr b
castPtr)
lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr (TensorCreateInfoARM _)))) pCreateInfo''
lift $ f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr ("info" ::: DeviceTensorMemoryRequirementsARM) -> IO b -> IO b
pokeZeroCStruct Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
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 ("info" ::: DeviceTensorMemoryRequirementsARM)
p Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_TENSOR_MEMORY_REQUIREMENTS_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
pCreateInfo'' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
forall r (m :: * -> *) a. ((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (TensorCreateInfoARM '[])) (((Ptr (TensorCreateInfoARM '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (TensorCreateInfoARM '[])))
-> ((Ptr (TensorCreateInfoARM '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (TensorCreateInfoARM '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (TensorCreateInfoARM '[]) -> IO b
cont -> forall (a :: [*] -> *) b.
(forall (es :: [*]).
(Extendss a es, PokeChain es) =>
ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
(Extendss a es, PokeChain es) =>
Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @TensorCreateInfoARM ((TensorCreateInfoARM '[] -> SomeStruct TensorCreateInfoARM
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct TensorCreateInfoARM '[]
forall a. Zero a => a
zero)) (Ptr (TensorCreateInfoARM '[]) -> IO b
cont (Ptr (TensorCreateInfoARM '[]) -> IO b)
-> (Ptr (TensorCreateInfoARM es) -> Ptr (TensorCreateInfoARM '[]))
-> Ptr (TensorCreateInfoARM es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (TensorCreateInfoARM es) -> Ptr (TensorCreateInfoARM '[])
forall a b. Ptr a -> Ptr b
castPtr)
lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr (TensorCreateInfoARM _)))) pCreateInfo''
lift $ f
instance FromCStruct DeviceTensorMemoryRequirementsARM where
peekCStruct :: Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> IO ("info" ::: DeviceTensorMemoryRequirementsARM)
peekCStruct Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p = do
pCreateInfo <- Ptr (SomeStruct TensorCreateInfoARM)
-> IO (SomeStruct TensorCreateInfoARM)
forall (a :: [*] -> *).
(Extensible a,
forall (es :: [*]).
(Extendss a es, PeekChain es) =>
FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SomeStruct TensorCreateInfoARM)
-> IO (SomeStruct TensorCreateInfoARM))
-> (Ptr (TensorCreateInfoARM (ZonkAny 0))
-> Ptr (SomeStruct TensorCreateInfoARM))
-> Ptr (TensorCreateInfoARM (ZonkAny 0))
-> IO (SomeStruct TensorCreateInfoARM)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (TensorCreateInfoARM (ZonkAny 0))
-> Ptr (SomeStruct TensorCreateInfoARM)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (TensorCreateInfoARM (ZonkAny 0))
-> IO (SomeStruct TensorCreateInfoARM))
-> IO (Ptr (TensorCreateInfoARM (ZonkAny 0)))
-> IO (SomeStruct TensorCreateInfoARM)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr (TensorCreateInfoARM (ZonkAny 0)))
-> IO (Ptr (TensorCreateInfoARM (ZonkAny 0)))
forall a. Storable a => Ptr a -> IO a
peek ((Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
p Ptr ("info" ::: DeviceTensorMemoryRequirementsARM)
-> Int -> Ptr (Ptr (TensorCreateInfoARM w))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (TensorCreateInfoARM _))))
pure $ DeviceTensorMemoryRequirementsARM
pCreateInfo
instance Zero DeviceTensorMemoryRequirementsARM where
zero :: "info" ::: DeviceTensorMemoryRequirementsARM
zero = SomeStruct TensorCreateInfoARM
-> "info" ::: DeviceTensorMemoryRequirementsARM
DeviceTensorMemoryRequirementsARM
(TensorCreateInfoARM '[] -> SomeStruct TensorCreateInfoARM
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct TensorCreateInfoARM '[]
forall a. Zero a => a
zero)
data CopyTensorInfoARM = CopyTensorInfoARM
{
CopyTensorInfoARM -> TensorARM
srcTensor :: TensorARM
,
CopyTensorInfoARM -> TensorARM
dstTensor :: TensorARM
,
CopyTensorInfoARM -> Vector TensorCopyARM
regions :: Vector TensorCopyARM
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyTensorInfoARM)
#endif
deriving instance Show CopyTensorInfoARM
instance ToCStruct CopyTensorInfoARM where
withCStruct :: forall b.
CopyTensorInfoARM -> (Ptr CopyTensorInfoARM -> IO b) -> IO b
withCStruct CopyTensorInfoARM
x Ptr CopyTensorInfoARM -> IO b
f = Int -> (Ptr CopyTensorInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr CopyTensorInfoARM -> IO b) -> IO b)
-> (Ptr CopyTensorInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CopyTensorInfoARM
p -> Ptr CopyTensorInfoARM -> CopyTensorInfoARM -> IO b -> IO b
forall b.
Ptr CopyTensorInfoARM -> CopyTensorInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CopyTensorInfoARM
p CopyTensorInfoARM
x (Ptr CopyTensorInfoARM -> IO b
f Ptr CopyTensorInfoARM
p)
pokeCStruct :: forall b.
Ptr CopyTensorInfoARM -> CopyTensorInfoARM -> IO b -> IO b
pokeCStruct Ptr CopyTensorInfoARM
p CopyTensorInfoARM{Vector TensorCopyARM
TensorARM
srcTensor :: CopyTensorInfoARM -> TensorARM
dstTensor :: CopyTensorInfoARM -> TensorARM
regions :: CopyTensorInfoARM -> Vector TensorCopyARM
srcTensor :: TensorARM
dstTensor :: TensorARM
regions :: Vector TensorCopyARM
..} 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 CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_TENSOR_INFO_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
srcTensor)
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 TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr TensorARM)) (TensorARM
dstTensor)
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 CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector TensorCopyARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorCopyARM -> Int) -> Vector TensorCopyARM -> Int
forall a b. (a -> b) -> a -> b
$ (Vector TensorCopyARM
regions)) :: Word32))
pPRegions' <- ((Ptr TensorCopyARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorCopyARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorCopyARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorCopyARM))
-> ((Ptr TensorCopyARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorCopyARM)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @TensorCopyARM ((Vector TensorCopyARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorCopyARM
regions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
48)
Data.Vector.imapM_ (\Int
i TensorCopyARM
e -> ((() -> IO b) -> IO b) -> ContT b IO ()
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr TensorCopyARM -> TensorCopyARM -> IO b -> IO b
forall b. Ptr TensorCopyARM -> TensorCopyARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr TensorCopyARM
pPRegions' Ptr TensorCopyARM -> Int -> Ptr TensorCopyARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorCopyARM) (TensorCopyARM
e) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())) (regions)
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr TensorCopyARM))) (pPRegions')
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr CopyTensorInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr CopyTensorInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_TENSOR_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct CopyTensorInfoARM where
peekCStruct :: Ptr CopyTensorInfoARM -> IO CopyTensorInfoARM
peekCStruct Ptr CopyTensorInfoARM
p = do
srcTensor <- forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr CopyTensorInfoARM
p Ptr CopyTensorInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM))
dstTensor <- peek @TensorARM ((p `plusPtr` 24 :: Ptr TensorARM))
regionCount <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
pRegions <- peek @(Ptr TensorCopyARM) ((p `plusPtr` 40 :: Ptr (Ptr TensorCopyARM)))
pRegions' <- generateM (fromIntegral regionCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @TensorCopyARM ((Ptr TensorCopyARM
pRegions Ptr TensorCopyARM -> Int -> Ptr TensorCopyARM
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorCopyARM)))
pure $ CopyTensorInfoARM
srcTensor dstTensor pRegions'
instance Zero CopyTensorInfoARM where
zero :: CopyTensorInfoARM
zero = TensorARM -> TensorARM -> Vector TensorCopyARM -> CopyTensorInfoARM
CopyTensorInfoARM
TensorARM
forall a. Zero a => a
zero
TensorARM
forall a. Zero a => a
zero
Vector TensorCopyARM
forall a. Monoid a => a
mempty
data TensorCopyARM = TensorCopyARM
{
TensorCopyARM -> Word32
dimensionCount :: Word32
,
TensorCopyARM -> Vector Word64
srcOffset :: Vector Word64
,
TensorCopyARM -> Vector Word64
dstOffset :: Vector Word64
,
TensorCopyARM -> Vector Word64
extent :: Vector Word64
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorCopyARM)
#endif
deriving instance Show TensorCopyARM
instance ToCStruct TensorCopyARM where
withCStruct :: forall b. TensorCopyARM -> (Ptr TensorCopyARM -> IO b) -> IO b
withCStruct TensorCopyARM
x Ptr TensorCopyARM -> IO b
f = Int -> (Ptr TensorCopyARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr TensorCopyARM -> IO b) -> IO b)
-> (Ptr TensorCopyARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorCopyARM
p -> Ptr TensorCopyARM -> TensorCopyARM -> IO b -> IO b
forall b. Ptr TensorCopyARM -> TensorCopyARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorCopyARM
p TensorCopyARM
x (Ptr TensorCopyARM -> IO b
f Ptr TensorCopyARM
p)
pokeCStruct :: forall b. Ptr TensorCopyARM -> TensorCopyARM -> IO b -> IO b
pokeCStruct Ptr TensorCopyARM
p TensorCopyARM{Word32
Vector Word64
dimensionCount :: TensorCopyARM -> Word32
srcOffset :: TensorCopyARM -> Vector Word64
dstOffset :: TensorCopyARM -> Vector Word64
extent :: TensorCopyARM -> Vector Word64
dimensionCount :: Word32
srcOffset :: Vector Word64
dstOffset :: Vector Word64
extent :: Vector Word64
..} 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 TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_COPY_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
let pSrcOffsetLength :: Int
pSrcOffsetLength = Vector Word64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word64 -> Int) -> Vector Word64 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word64
srcOffset)
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
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pSrcOffsetLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
dimensionCount) Bool -> Bool -> Bool
|| Int
pSrcOffsetLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (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
"pSrcOffset must be empty or have 'dimensionCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let pDstOffsetLength :: Int
pDstOffsetLength = Vector Word64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word64 -> Int) -> Vector Word64 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word64
dstOffset)
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
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pDstOffsetLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
dimensionCount) Bool -> Bool -> Bool
|| Int
pDstOffsetLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (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
"pDstOffset must be empty or have 'dimensionCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let pExtentLength :: Int
pExtentLength = Vector Word64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word64 -> Int) -> Vector Word64 -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Word64
extent)
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
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pExtentLength Word32 -> Word32 -> Bool
forall a. Eq a => a -> a -> Bool
== (Word32
dimensionCount) Bool -> Bool -> Bool
|| Int
pExtentLength Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0) (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
"pExtent must be empty or have 'dimensionCount' elements" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
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 TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((Word32
dimensionCount))
pSrcOffset'' <- if Vector Word64 -> Bool
forall a. Vector a -> Bool
Data.Vector.null (Vector Word64
srcOffset)
then Ptr Word64 -> ContT b IO (Ptr Word64)
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr Word64
forall a. Ptr a
nullPtr
else do
pPSrcOffset <- ((Ptr Word64 -> IO b) -> IO b) -> ContT b IO (Ptr Word64)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Word64 -> IO b) -> IO b) -> ContT b IO (Ptr Word64))
-> ((Ptr Word64 -> IO b) -> IO b) -> ContT b IO (Ptr Word64)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Word64 (((Vector Word64 -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Word64
srcOffset))) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
lift $ Data.Vector.imapM_ (\Int
i Word64
e -> Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word64
pPSrcOffset Ptr Word64 -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64) (Word64
e)) ((srcOffset))
pure $ pPSrcOffset
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Word64))) pSrcOffset''
pDstOffset'' <- if Data.Vector.null (dstOffset)
then pure nullPtr
else do
pPDstOffset <- ContT $ allocaBytes @Word64 (((Data.Vector.length (dstOffset))) * 8)
lift $ Data.Vector.imapM_ (\Int
i Word64
e -> Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word64
pPDstOffset Ptr Word64 -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64) (Word64
e)) ((dstOffset))
pure $ pPDstOffset
lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr Word64))) pDstOffset''
pExtent'' <- if Data.Vector.null (extent)
then pure nullPtr
else do
pPExtent <- ContT $ allocaBytes @Word64 (((Data.Vector.length (extent))) * 8)
lift $ Data.Vector.imapM_ (\Int
i Word64
e -> Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word64
pPExtent Ptr Word64 -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64) (Word64
e)) ((extent))
pure $ pPExtent
lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr Word64))) pExtent''
lift $ f
cStructSize :: Int
cStructSize = Int
48
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorCopyARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorCopyARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_COPY_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct TensorCopyARM where
peekCStruct :: Ptr TensorCopyARM -> IO TensorCopyARM
peekCStruct Ptr TensorCopyARM
p = do
dimensionCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr TensorCopyARM
p Ptr TensorCopyARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
pSrcOffset <- peek @(Ptr Word64) ((p `plusPtr` 24 :: Ptr (Ptr Word64)))
let pSrcOffsetLength = if Ptr Word64
pSrcOffset Ptr Word64 -> Ptr Word64 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word64
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dimensionCount)
pSrcOffset' <- generateM pSrcOffsetLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr Word64
pSrcOffset Ptr Word64 -> Int -> Ptr Word64
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64)))
pDstOffset <- peek @(Ptr Word64) ((p `plusPtr` 32 :: Ptr (Ptr Word64)))
let pDstOffsetLength = if Ptr Word64
pDstOffset Ptr Word64 -> Ptr Word64 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word64
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dimensionCount)
pDstOffset' <- generateM pDstOffsetLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr Word64
pDstOffset Ptr Word64 -> Int -> Ptr Word64
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64)))
pExtent <- peek @(Ptr Word64) ((p `plusPtr` 40 :: Ptr (Ptr Word64)))
let pExtentLength = if Ptr Word64
pExtent Ptr Word64 -> Ptr Word64 -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Word64
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
dimensionCount)
pExtent' <- generateM pExtentLength (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr Word64
pExtent Ptr Word64 -> Int -> Ptr Word64
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word64)))
pure $ TensorCopyARM
dimensionCount pSrcOffset' pDstOffset' pExtent'
instance Zero TensorCopyARM where
zero :: TensorCopyARM
zero = Word32
-> Vector Word64 -> Vector Word64 -> Vector Word64 -> TensorCopyARM
TensorCopyARM
Word32
forall a. Zero a => a
zero
Vector Word64
forall a. Monoid a => a
mempty
Vector Word64
forall a. Monoid a => a
mempty
Vector Word64
forall a. Monoid a => a
mempty
data MemoryDedicatedAllocateInfoTensorARM = MemoryDedicatedAllocateInfoTensorARM
{
MemoryDedicatedAllocateInfoTensorARM -> TensorARM
tensor :: TensorARM }
deriving (Typeable, MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool
(MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool)
-> (MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool)
-> Eq MemoryDedicatedAllocateInfoTensorARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool
== :: MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool
$c/= :: MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool
/= :: MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (MemoryDedicatedAllocateInfoTensorARM)
#endif
deriving instance Show MemoryDedicatedAllocateInfoTensorARM
instance ToCStruct MemoryDedicatedAllocateInfoTensorARM where
withCStruct :: forall b.
MemoryDedicatedAllocateInfoTensorARM
-> (Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b) -> IO b
withCStruct MemoryDedicatedAllocateInfoTensorARM
x Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b
f = Int -> (Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b) -> IO b)
-> (Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr MemoryDedicatedAllocateInfoTensorARM
p -> Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO b -> IO b
forall b.
Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr MemoryDedicatedAllocateInfoTensorARM
p MemoryDedicatedAllocateInfoTensorARM
x (Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b
f Ptr MemoryDedicatedAllocateInfoTensorARM
p)
pokeCStruct :: forall b.
Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO b -> IO b
pokeCStruct Ptr MemoryDedicatedAllocateInfoTensorARM
p MemoryDedicatedAllocateInfoTensorARM{TensorARM
tensor :: MemoryDedicatedAllocateInfoTensorARM -> TensorARM
tensor :: TensorARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_TENSOR_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
tensor)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr MemoryDedicatedAllocateInfoTensorARM -> IO b -> IO b
pokeZeroCStruct Ptr MemoryDedicatedAllocateInfoTensorARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_TENSOR_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct MemoryDedicatedAllocateInfoTensorARM where
peekCStruct :: Ptr MemoryDedicatedAllocateInfoTensorARM
-> IO MemoryDedicatedAllocateInfoTensorARM
peekCStruct Ptr MemoryDedicatedAllocateInfoTensorARM
p = do
tensor <- forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr MemoryDedicatedAllocateInfoTensorARM
p Ptr MemoryDedicatedAllocateInfoTensorARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM))
pure $ MemoryDedicatedAllocateInfoTensorARM
tensor
instance Storable MemoryDedicatedAllocateInfoTensorARM where
sizeOf :: MemoryDedicatedAllocateInfoTensorARM -> Int
sizeOf ~MemoryDedicatedAllocateInfoTensorARM
_ = Int
24
alignment :: MemoryDedicatedAllocateInfoTensorARM -> Int
alignment ~MemoryDedicatedAllocateInfoTensorARM
_ = Int
8
peek :: Ptr MemoryDedicatedAllocateInfoTensorARM
-> IO MemoryDedicatedAllocateInfoTensorARM
peek = Ptr MemoryDedicatedAllocateInfoTensorARM
-> IO MemoryDedicatedAllocateInfoTensorARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO ()
poke Ptr MemoryDedicatedAllocateInfoTensorARM
ptr MemoryDedicatedAllocateInfoTensorARM
poked = Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO () -> IO ()
forall b.
Ptr MemoryDedicatedAllocateInfoTensorARM
-> MemoryDedicatedAllocateInfoTensorARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr MemoryDedicatedAllocateInfoTensorARM
ptr MemoryDedicatedAllocateInfoTensorARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero MemoryDedicatedAllocateInfoTensorARM where
zero :: MemoryDedicatedAllocateInfoTensorARM
zero = TensorARM -> MemoryDedicatedAllocateInfoTensorARM
MemoryDedicatedAllocateInfoTensorARM
TensorARM
forall a. Zero a => a
zero
data PhysicalDeviceDescriptorBufferTensorPropertiesARM = PhysicalDeviceDescriptorBufferTensorPropertiesARM
{
PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorCaptureReplayDescriptorDataSize :: Word64
,
PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorViewCaptureReplayDescriptorDataSize :: Word64
,
PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorDescriptorSize :: Word64
}
deriving (Typeable, PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool
(PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool)
-> (PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool)
-> Eq PhysicalDeviceDescriptorBufferTensorPropertiesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool
== :: PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool
$c/= :: PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool
/= :: PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDescriptorBufferTensorPropertiesARM)
#endif
deriving instance Show PhysicalDeviceDescriptorBufferTensorPropertiesARM
instance ToCStruct PhysicalDeviceDescriptorBufferTensorPropertiesARM where
withCStruct :: forall b.
PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> (Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b)
-> IO b
withCStruct PhysicalDeviceDescriptorBufferTensorPropertiesARM
x Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b
f = Int
-> (Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p -> Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO b
-> IO b
forall b.
Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p PhysicalDeviceDescriptorBufferTensorPropertiesARM
x (Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO b
f Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p PhysicalDeviceDescriptorBufferTensorPropertiesARM{Word64
tensorCaptureReplayDescriptorDataSize :: PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorViewCaptureReplayDescriptorDataSize :: PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorDescriptorSize :: PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorCaptureReplayDescriptorDataSize :: Word64
tensorViewCaptureReplayDescriptorDataSize :: Word64
tensorDescriptorSize :: Word64
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
tensorCaptureReplayDescriptorDataSize))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
tensorViewCaptureReplayDescriptorDataSize))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
tensorDescriptorSize))
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr CSize)) (Word64 -> CSize
CSize (Word64
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceDescriptorBufferTensorPropertiesARM where
peekCStruct :: Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO PhysicalDeviceDescriptorBufferTensorPropertiesARM
peekCStruct Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p = do
tensorCaptureReplayDescriptorDataSize <- forall a. Storable a => Ptr a -> IO a
peek @CSize ((Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
p Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CSize))
tensorViewCaptureReplayDescriptorDataSize <- peek @CSize ((p `plusPtr` 24 :: Ptr CSize))
tensorDescriptorSize <- peek @CSize ((p `plusPtr` 32 :: Ptr CSize))
pure $ PhysicalDeviceDescriptorBufferTensorPropertiesARM
(coerce @CSize @Word64 tensorCaptureReplayDescriptorDataSize)
(coerce @CSize @Word64 tensorViewCaptureReplayDescriptorDataSize)
(coerce @CSize @Word64 tensorDescriptorSize)
instance Storable PhysicalDeviceDescriptorBufferTensorPropertiesARM where
sizeOf :: PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Int
sizeOf ~PhysicalDeviceDescriptorBufferTensorPropertiesARM
_ = Int
40
alignment :: PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Int
alignment ~PhysicalDeviceDescriptorBufferTensorPropertiesARM
_ = Int
8
peek :: Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO PhysicalDeviceDescriptorBufferTensorPropertiesARM
peek = Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO PhysicalDeviceDescriptorBufferTensorPropertiesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM -> IO ()
poke Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
poked = Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO ()
-> IO ()
forall b.
Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
ptr PhysicalDeviceDescriptorBufferTensorPropertiesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDescriptorBufferTensorPropertiesARM where
zero :: PhysicalDeviceDescriptorBufferTensorPropertiesARM
zero = Word64
-> Word64
-> Word64
-> PhysicalDeviceDescriptorBufferTensorPropertiesARM
PhysicalDeviceDescriptorBufferTensorPropertiesARM
Word64
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
data PhysicalDeviceDescriptorBufferTensorFeaturesARM = PhysicalDeviceDescriptorBufferTensorFeaturesARM
{
PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
descriptorBufferTensorDescriptors :: Bool }
deriving (Typeable, PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
(PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool)
-> (PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool)
-> Eq PhysicalDeviceDescriptorBufferTensorFeaturesARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
== :: PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
$c/= :: PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
/= :: PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDescriptorBufferTensorFeaturesARM)
#endif
deriving instance Show PhysicalDeviceDescriptorBufferTensorFeaturesARM
instance ToCStruct PhysicalDeviceDescriptorBufferTensorFeaturesARM where
withCStruct :: forall b.
PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> (Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b)
-> IO b
withCStruct PhysicalDeviceDescriptorBufferTensorFeaturesARM
x Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b
f = Int
-> (Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p -> Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b -> IO b
forall b.
Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p PhysicalDeviceDescriptorBufferTensorFeaturesARM
x (Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b
f Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p PhysicalDeviceDescriptorBufferTensorFeaturesARM{Bool
descriptorBufferTensorDescriptors :: PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Bool
descriptorBufferTensorDescriptors :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_FEATURES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
descriptorBufferTensorDescriptors))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_FEATURES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> 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 PhysicalDeviceDescriptorBufferTensorFeaturesARM where
peekCStruct :: Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> IO PhysicalDeviceDescriptorBufferTensorFeaturesARM
peekCStruct Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p = do
descriptorBufferTensorDescriptors <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
p Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
pure $ PhysicalDeviceDescriptorBufferTensorFeaturesARM
(bool32ToBool descriptorBufferTensorDescriptors)
instance Storable PhysicalDeviceDescriptorBufferTensorFeaturesARM where
sizeOf :: PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Int
sizeOf ~PhysicalDeviceDescriptorBufferTensorFeaturesARM
_ = Int
24
alignment :: PhysicalDeviceDescriptorBufferTensorFeaturesARM -> Int
alignment ~PhysicalDeviceDescriptorBufferTensorFeaturesARM
_ = Int
8
peek :: Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> IO PhysicalDeviceDescriptorBufferTensorFeaturesARM
peek = Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> IO PhysicalDeviceDescriptorBufferTensorFeaturesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO ()
poke Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
poked = Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> IO ()
-> IO ()
forall b.
Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
-> PhysicalDeviceDescriptorBufferTensorFeaturesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
ptr PhysicalDeviceDescriptorBufferTensorFeaturesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDescriptorBufferTensorFeaturesARM where
zero :: PhysicalDeviceDescriptorBufferTensorFeaturesARM
zero = Bool -> PhysicalDeviceDescriptorBufferTensorFeaturesARM
PhysicalDeviceDescriptorBufferTensorFeaturesARM
Bool
forall a. Zero a => a
zero
data TensorCaptureDescriptorDataInfoARM = TensorCaptureDescriptorDataInfoARM
{
TensorCaptureDescriptorDataInfoARM -> TensorARM
tensor :: TensorARM }
deriving (Typeable, TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool
(TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool)
-> (TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool)
-> Eq TensorCaptureDescriptorDataInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool
== :: TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool
$c/= :: TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool
/= :: TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorCaptureDescriptorDataInfoARM)
#endif
deriving instance Show TensorCaptureDescriptorDataInfoARM
instance ToCStruct TensorCaptureDescriptorDataInfoARM where
withCStruct :: forall b.
TensorCaptureDescriptorDataInfoARM
-> (Ptr TensorCaptureDescriptorDataInfoARM -> IO b) -> IO b
withCStruct TensorCaptureDescriptorDataInfoARM
x Ptr TensorCaptureDescriptorDataInfoARM -> IO b
f = Int -> (Ptr TensorCaptureDescriptorDataInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr TensorCaptureDescriptorDataInfoARM -> IO b) -> IO b)
-> (Ptr TensorCaptureDescriptorDataInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorCaptureDescriptorDataInfoARM
p -> Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO b -> IO b
forall b.
Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorCaptureDescriptorDataInfoARM
p TensorCaptureDescriptorDataInfoARM
x (Ptr TensorCaptureDescriptorDataInfoARM -> IO b
f Ptr TensorCaptureDescriptorDataInfoARM
p)
pokeCStruct :: forall b.
Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO b -> IO b
pokeCStruct Ptr TensorCaptureDescriptorDataInfoARM
p TensorCaptureDescriptorDataInfoARM{TensorARM
tensor :: TensorCaptureDescriptorDataInfoARM -> TensorARM
tensor :: TensorARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_CAPTURE_DESCRIPTOR_DATA_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
tensor)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr TensorCaptureDescriptorDataInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorCaptureDescriptorDataInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_CAPTURE_DESCRIPTOR_DATA_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM)) (TensorARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorCaptureDescriptorDataInfoARM where
peekCStruct :: Ptr TensorCaptureDescriptorDataInfoARM
-> IO TensorCaptureDescriptorDataInfoARM
peekCStruct Ptr TensorCaptureDescriptorDataInfoARM
p = do
tensor <- forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr TensorCaptureDescriptorDataInfoARM
p Ptr TensorCaptureDescriptorDataInfoARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorARM))
pure $ TensorCaptureDescriptorDataInfoARM
tensor
instance Storable TensorCaptureDescriptorDataInfoARM where
sizeOf :: TensorCaptureDescriptorDataInfoARM -> Int
sizeOf ~TensorCaptureDescriptorDataInfoARM
_ = Int
24
alignment :: TensorCaptureDescriptorDataInfoARM -> Int
alignment ~TensorCaptureDescriptorDataInfoARM
_ = Int
8
peek :: Ptr TensorCaptureDescriptorDataInfoARM
-> IO TensorCaptureDescriptorDataInfoARM
peek = Ptr TensorCaptureDescriptorDataInfoARM
-> IO TensorCaptureDescriptorDataInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO ()
poke Ptr TensorCaptureDescriptorDataInfoARM
ptr TensorCaptureDescriptorDataInfoARM
poked = Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO () -> IO ()
forall b.
Ptr TensorCaptureDescriptorDataInfoARM
-> TensorCaptureDescriptorDataInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorCaptureDescriptorDataInfoARM
ptr TensorCaptureDescriptorDataInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TensorCaptureDescriptorDataInfoARM where
zero :: TensorCaptureDescriptorDataInfoARM
zero = TensorARM -> TensorCaptureDescriptorDataInfoARM
TensorCaptureDescriptorDataInfoARM
TensorARM
forall a. Zero a => a
zero
data TensorViewCaptureDescriptorDataInfoARM = TensorViewCaptureDescriptorDataInfoARM
{
TensorViewCaptureDescriptorDataInfoARM -> TensorViewARM
tensorView :: TensorViewARM }
deriving (Typeable, TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool
(TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool)
-> (TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool)
-> Eq TensorViewCaptureDescriptorDataInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool
== :: TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool
$c/= :: TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool
/= :: TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (TensorViewCaptureDescriptorDataInfoARM)
#endif
deriving instance Show TensorViewCaptureDescriptorDataInfoARM
instance ToCStruct TensorViewCaptureDescriptorDataInfoARM where
withCStruct :: forall b.
TensorViewCaptureDescriptorDataInfoARM
-> (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b) -> IO b
withCStruct TensorViewCaptureDescriptorDataInfoARM
x Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b
f = Int -> (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b) -> IO b)
-> (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr TensorViewCaptureDescriptorDataInfoARM
p -> Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO b -> IO b
forall b.
Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorViewCaptureDescriptorDataInfoARM
p TensorViewCaptureDescriptorDataInfoARM
x (Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b
f Ptr TensorViewCaptureDescriptorDataInfoARM
p)
pokeCStruct :: forall b.
Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO b -> IO b
pokeCStruct Ptr TensorViewCaptureDescriptorDataInfoARM
p TensorViewCaptureDescriptorDataInfoARM{TensorViewARM
tensorView :: TensorViewCaptureDescriptorDataInfoARM -> TensorViewARM
tensorView :: TensorViewARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorViewARM -> TensorViewARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorViewARM)) (TensorViewARM
tensorView)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr TensorViewCaptureDescriptorDataInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr TensorViewCaptureDescriptorDataInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_TENSOR_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorViewARM -> TensorViewARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorViewARM)) (TensorViewARM
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct TensorViewCaptureDescriptorDataInfoARM where
peekCStruct :: Ptr TensorViewCaptureDescriptorDataInfoARM
-> IO TensorViewCaptureDescriptorDataInfoARM
peekCStruct Ptr TensorViewCaptureDescriptorDataInfoARM
p = do
tensorView <- forall a. Storable a => Ptr a -> IO a
peek @TensorViewARM ((Ptr TensorViewCaptureDescriptorDataInfoARM
p Ptr TensorViewCaptureDescriptorDataInfoARM
-> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorViewARM))
pure $ TensorViewCaptureDescriptorDataInfoARM
tensorView
instance Storable TensorViewCaptureDescriptorDataInfoARM where
sizeOf :: TensorViewCaptureDescriptorDataInfoARM -> Int
sizeOf ~TensorViewCaptureDescriptorDataInfoARM
_ = Int
24
alignment :: TensorViewCaptureDescriptorDataInfoARM -> Int
alignment ~TensorViewCaptureDescriptorDataInfoARM
_ = Int
8
peek :: Ptr TensorViewCaptureDescriptorDataInfoARM
-> IO TensorViewCaptureDescriptorDataInfoARM
peek = Ptr TensorViewCaptureDescriptorDataInfoARM
-> IO TensorViewCaptureDescriptorDataInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO ()
poke Ptr TensorViewCaptureDescriptorDataInfoARM
ptr TensorViewCaptureDescriptorDataInfoARM
poked = Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO () -> IO ()
forall b.
Ptr TensorViewCaptureDescriptorDataInfoARM
-> TensorViewCaptureDescriptorDataInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr TensorViewCaptureDescriptorDataInfoARM
ptr TensorViewCaptureDescriptorDataInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero TensorViewCaptureDescriptorDataInfoARM where
zero :: TensorViewCaptureDescriptorDataInfoARM
zero = TensorViewARM -> TensorViewCaptureDescriptorDataInfoARM
TensorViewCaptureDescriptorDataInfoARM
TensorViewARM
forall a. Zero a => a
zero
data DescriptorGetTensorInfoARM = DescriptorGetTensorInfoARM
{
DescriptorGetTensorInfoARM -> TensorViewARM
tensorView :: TensorViewARM }
deriving (Typeable, DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool
(DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool)
-> (DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> Bool)
-> Eq DescriptorGetTensorInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool
== :: DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool
$c/= :: DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool
/= :: DescriptorGetTensorInfoARM -> DescriptorGetTensorInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DescriptorGetTensorInfoARM)
#endif
deriving instance Show DescriptorGetTensorInfoARM
instance ToCStruct DescriptorGetTensorInfoARM where
withCStruct :: forall b.
DescriptorGetTensorInfoARM
-> (Ptr DescriptorGetTensorInfoARM -> IO b) -> IO b
withCStruct DescriptorGetTensorInfoARM
x Ptr DescriptorGetTensorInfoARM -> IO b
f = Int -> (Ptr DescriptorGetTensorInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr DescriptorGetTensorInfoARM -> IO b) -> IO b)
-> (Ptr DescriptorGetTensorInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr DescriptorGetTensorInfoARM
p -> Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO b -> IO b
forall b.
Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DescriptorGetTensorInfoARM
p DescriptorGetTensorInfoARM
x (Ptr DescriptorGetTensorInfoARM -> IO b
f Ptr DescriptorGetTensorInfoARM
p)
pokeCStruct :: forall b.
Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO b -> IO b
pokeCStruct Ptr DescriptorGetTensorInfoARM
p DescriptorGetTensorInfoARM{TensorViewARM
tensorView :: DescriptorGetTensorInfoARM -> TensorViewARM
tensorView :: TensorViewARM
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_GET_TENSOR_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr TensorViewARM -> TensorViewARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorViewARM)) (TensorViewARM
tensorView)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DescriptorGetTensorInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr DescriptorGetTensorInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DESCRIPTOR_GET_TENSOR_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct DescriptorGetTensorInfoARM where
peekCStruct :: Ptr DescriptorGetTensorInfoARM -> IO DescriptorGetTensorInfoARM
peekCStruct Ptr DescriptorGetTensorInfoARM
p = do
tensorView <- forall a. Storable a => Ptr a -> IO a
peek @TensorViewARM ((Ptr DescriptorGetTensorInfoARM
p Ptr DescriptorGetTensorInfoARM -> Int -> Ptr TensorViewARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorViewARM))
pure $ DescriptorGetTensorInfoARM
tensorView
instance Storable DescriptorGetTensorInfoARM where
sizeOf :: DescriptorGetTensorInfoARM -> Int
sizeOf ~DescriptorGetTensorInfoARM
_ = Int
24
alignment :: DescriptorGetTensorInfoARM -> Int
alignment ~DescriptorGetTensorInfoARM
_ = Int
8
peek :: Ptr DescriptorGetTensorInfoARM -> IO DescriptorGetTensorInfoARM
peek = Ptr DescriptorGetTensorInfoARM -> IO DescriptorGetTensorInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO ()
poke Ptr DescriptorGetTensorInfoARM
ptr DescriptorGetTensorInfoARM
poked = Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO () -> IO ()
forall b.
Ptr DescriptorGetTensorInfoARM
-> DescriptorGetTensorInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DescriptorGetTensorInfoARM
ptr DescriptorGetTensorInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DescriptorGetTensorInfoARM where
zero :: DescriptorGetTensorInfoARM
zero = TensorViewARM -> DescriptorGetTensorInfoARM
DescriptorGetTensorInfoARM
TensorViewARM
forall a. Zero a => a
zero
data FrameBoundaryTensorsARM = FrameBoundaryTensorsARM
{
FrameBoundaryTensorsARM -> Vector TensorARM
tensors :: Vector TensorARM }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (FrameBoundaryTensorsARM)
#endif
deriving instance Show FrameBoundaryTensorsARM
instance ToCStruct FrameBoundaryTensorsARM where
withCStruct :: forall b.
FrameBoundaryTensorsARM
-> (Ptr FrameBoundaryTensorsARM -> IO b) -> IO b
withCStruct FrameBoundaryTensorsARM
x Ptr FrameBoundaryTensorsARM -> IO b
f = Int -> (Ptr FrameBoundaryTensorsARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr FrameBoundaryTensorsARM -> IO b) -> IO b)
-> (Ptr FrameBoundaryTensorsARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr FrameBoundaryTensorsARM
p -> Ptr FrameBoundaryTensorsARM
-> FrameBoundaryTensorsARM -> IO b -> IO b
forall b.
Ptr FrameBoundaryTensorsARM
-> FrameBoundaryTensorsARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr FrameBoundaryTensorsARM
p FrameBoundaryTensorsARM
x (Ptr FrameBoundaryTensorsARM -> IO b
f Ptr FrameBoundaryTensorsARM
p)
pokeCStruct :: forall b.
Ptr FrameBoundaryTensorsARM
-> FrameBoundaryTensorsARM -> IO b -> IO b
pokeCStruct Ptr FrameBoundaryTensorsARM
p FrameBoundaryTensorsARM{Vector TensorARM
tensors :: FrameBoundaryTensorsARM -> Vector TensorARM
tensors :: Vector TensorARM
..} 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 FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector TensorARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorARM -> Int) -> Vector TensorARM -> Int
forall a b. (a -> b) -> a -> b
$ (Vector TensorARM
tensors)) :: Word32))
pPTensors' <- ((Ptr TensorARM -> IO b) -> IO b) -> ContT b IO (Ptr TensorARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorARM -> IO b) -> IO b) -> ContT b IO (Ptr TensorARM))
-> ((Ptr TensorARM -> IO b) -> IO b) -> ContT b IO (Ptr TensorARM)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @TensorARM ((Vector TensorARM -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector TensorARM
tensors)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
lift $ Data.Vector.imapM_ (\Int
i TensorARM
e -> Ptr TensorARM -> TensorARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TensorARM
pPTensors' Ptr TensorARM -> Int -> Ptr TensorARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorARM) (TensorARM
e)) (tensors)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorARM))) (pPTensors')
lift $ f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr FrameBoundaryTensorsARM -> IO b -> IO b
pokeZeroCStruct Ptr FrameBoundaryTensorsARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct FrameBoundaryTensorsARM where
peekCStruct :: Ptr FrameBoundaryTensorsARM -> IO FrameBoundaryTensorsARM
peekCStruct Ptr FrameBoundaryTensorsARM
p = do
tensorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr FrameBoundaryTensorsARM
p Ptr FrameBoundaryTensorsARM -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
pTensors <- peek @(Ptr TensorARM) ((p `plusPtr` 24 :: Ptr (Ptr TensorARM)))
pTensors' <- generateM (fromIntegral tensorCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @TensorARM ((Ptr TensorARM
pTensors Ptr TensorARM -> Int -> Ptr TensorARM
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr TensorARM)))
pure $ FrameBoundaryTensorsARM
pTensors'
instance Zero FrameBoundaryTensorsARM where
zero :: FrameBoundaryTensorsARM
zero = Vector TensorARM -> FrameBoundaryTensorsARM
FrameBoundaryTensorsARM
Vector TensorARM
forall a. Monoid a => a
mempty
data PhysicalDeviceExternalTensorInfoARM = PhysicalDeviceExternalTensorInfoARM
{
PhysicalDeviceExternalTensorInfoARM -> TensorCreateFlagsARM
flags :: TensorCreateFlagsARM
,
PhysicalDeviceExternalTensorInfoARM -> TensorDescriptionARM
description :: TensorDescriptionARM
,
PhysicalDeviceExternalTensorInfoARM
-> ExternalMemoryHandleTypeFlagBits
handleType :: ExternalMemoryHandleTypeFlagBits
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExternalTensorInfoARM)
#endif
deriving instance Show PhysicalDeviceExternalTensorInfoARM
instance ToCStruct PhysicalDeviceExternalTensorInfoARM where
withCStruct :: forall b.
PhysicalDeviceExternalTensorInfoARM
-> (Ptr PhysicalDeviceExternalTensorInfoARM -> IO b) -> IO b
withCStruct PhysicalDeviceExternalTensorInfoARM
x Ptr PhysicalDeviceExternalTensorInfoARM -> IO b
f = Int -> (Ptr PhysicalDeviceExternalTensorInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDeviceExternalTensorInfoARM -> IO b) -> IO b)
-> (Ptr PhysicalDeviceExternalTensorInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceExternalTensorInfoARM
p -> Ptr PhysicalDeviceExternalTensorInfoARM
-> PhysicalDeviceExternalTensorInfoARM -> IO b -> IO b
forall b.
Ptr PhysicalDeviceExternalTensorInfoARM
-> PhysicalDeviceExternalTensorInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalTensorInfoARM
p PhysicalDeviceExternalTensorInfoARM
x (Ptr PhysicalDeviceExternalTensorInfoARM -> IO b
f Ptr PhysicalDeviceExternalTensorInfoARM
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceExternalTensorInfoARM
-> PhysicalDeviceExternalTensorInfoARM -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExternalTensorInfoARM
p PhysicalDeviceExternalTensorInfoARM{ExternalMemoryHandleTypeFlagBits
TensorDescriptionARM
TensorCreateFlagsARM
flags :: PhysicalDeviceExternalTensorInfoARM -> TensorCreateFlagsARM
description :: PhysicalDeviceExternalTensorInfoARM -> TensorDescriptionARM
handleType :: PhysicalDeviceExternalTensorInfoARM
-> ExternalMemoryHandleTypeFlagBits
flags :: TensorCreateFlagsARM
description :: TensorDescriptionARM
handleType :: ExternalMemoryHandleTypeFlagBits
..} 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 PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_TENSOR_INFO_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: 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 TensorCreateFlagsARM -> TensorCreateFlagsARM -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM
-> Int -> Ptr TensorCreateFlagsARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorCreateFlagsARM)) (TensorCreateFlagsARM
flags)
pDescription'' <- ((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM))
-> ((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM)
forall a b. (a -> b) -> a -> b
$ TensorDescriptionARM -> (Ptr TensorDescriptionARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorDescriptionARM -> (Ptr TensorDescriptionARM -> IO b) -> IO b
withCStruct (TensorDescriptionARM
description)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM))) pDescription''
lift $ poke ((p `plusPtr` 32 :: Ptr ExternalMemoryHandleTypeFlagBits)) (handleType)
lift $ f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr PhysicalDeviceExternalTensorInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceExternalTensorInfoARM
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 PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_TENSOR_INFO_ARM)
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 ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
pDescription'' <- ((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM))
-> ((Ptr TensorDescriptionARM -> IO b) -> IO b)
-> ContT b IO (Ptr TensorDescriptionARM)
forall a b. (a -> b) -> a -> b
$ TensorDescriptionARM -> (Ptr TensorDescriptionARM -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
TensorDescriptionARM -> (Ptr TensorDescriptionARM -> IO b) -> IO b
withCStruct (TensorDescriptionARM
forall a. Zero a => a
zero)
lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM))) pDescription''
lift $ poke ((p `plusPtr` 32 :: Ptr ExternalMemoryHandleTypeFlagBits)) (zero)
lift $ f
instance FromCStruct PhysicalDeviceExternalTensorInfoARM where
peekCStruct :: Ptr PhysicalDeviceExternalTensorInfoARM
-> IO PhysicalDeviceExternalTensorInfoARM
peekCStruct Ptr PhysicalDeviceExternalTensorInfoARM
p = do
flags <- forall a. Storable a => Ptr a -> IO a
peek @TensorCreateFlagsARM ((Ptr PhysicalDeviceExternalTensorInfoARM
p Ptr PhysicalDeviceExternalTensorInfoARM
-> Int -> Ptr TensorCreateFlagsARM
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr TensorCreateFlagsARM))
pDescription <- peekCStruct @TensorDescriptionARM =<< peek ((p `plusPtr` 24 :: Ptr (Ptr TensorDescriptionARM)))
handleType <- peek @ExternalMemoryHandleTypeFlagBits ((p `plusPtr` 32 :: Ptr ExternalMemoryHandleTypeFlagBits))
pure $ PhysicalDeviceExternalTensorInfoARM
flags pDescription handleType
instance Zero PhysicalDeviceExternalTensorInfoARM where
zero :: PhysicalDeviceExternalTensorInfoARM
zero = TensorCreateFlagsARM
-> TensorDescriptionARM
-> ExternalMemoryHandleTypeFlagBits
-> PhysicalDeviceExternalTensorInfoARM
PhysicalDeviceExternalTensorInfoARM
TensorCreateFlagsARM
forall a. Zero a => a
zero
TensorDescriptionARM
forall a. Zero a => a
zero
ExternalMemoryHandleTypeFlagBits
forall a. Zero a => a
zero
data ExternalTensorPropertiesARM = ExternalTensorPropertiesARM
{
ExternalTensorPropertiesARM -> ExternalMemoryProperties
externalMemoryProperties :: ExternalMemoryProperties }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalTensorPropertiesARM)
#endif
deriving instance Show ExternalTensorPropertiesARM
instance ToCStruct ExternalTensorPropertiesARM where
withCStruct :: forall b.
ExternalTensorPropertiesARM
-> (Ptr ExternalTensorPropertiesARM -> IO b) -> IO b
withCStruct ExternalTensorPropertiesARM
x Ptr ExternalTensorPropertiesARM -> IO b
f = Int -> (Ptr ExternalTensorPropertiesARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr ExternalTensorPropertiesARM -> IO b) -> IO b)
-> (Ptr ExternalTensorPropertiesARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ExternalTensorPropertiesARM
p -> Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO b -> IO b
forall b.
Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalTensorPropertiesARM
p ExternalTensorPropertiesARM
x (Ptr ExternalTensorPropertiesARM -> IO b
f Ptr ExternalTensorPropertiesARM
p)
pokeCStruct :: forall b.
Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO b -> IO b
pokeCStruct Ptr ExternalTensorPropertiesARM
p ExternalTensorPropertiesARM{ExternalMemoryProperties
externalMemoryProperties :: ExternalTensorPropertiesARM -> ExternalMemoryProperties
externalMemoryProperties :: ExternalMemoryProperties
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
externalMemoryProperties)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ExternalTensorPropertiesARM -> IO b -> IO b
pokeZeroCStruct Ptr ExternalTensorPropertiesARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_TENSOR_PROPERTIES_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM -> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryProperties -> ExternalMemoryProperties -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryProperties)) (ExternalMemoryProperties
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ExternalTensorPropertiesARM where
peekCStruct :: Ptr ExternalTensorPropertiesARM -> IO ExternalTensorPropertiesARM
peekCStruct Ptr ExternalTensorPropertiesARM
p = do
externalMemoryProperties <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ExternalMemoryProperties ((Ptr ExternalTensorPropertiesARM
p Ptr ExternalTensorPropertiesARM
-> Int -> Ptr ExternalMemoryProperties
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryProperties))
pure $ ExternalTensorPropertiesARM
externalMemoryProperties
instance Storable ExternalTensorPropertiesARM where
sizeOf :: ExternalTensorPropertiesARM -> Int
sizeOf ~ExternalTensorPropertiesARM
_ = Int
32
alignment :: ExternalTensorPropertiesARM -> Int
alignment ~ExternalTensorPropertiesARM
_ = Int
8
peek :: Ptr ExternalTensorPropertiesARM -> IO ExternalTensorPropertiesARM
peek = Ptr ExternalTensorPropertiesARM -> IO ExternalTensorPropertiesARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO ()
poke Ptr ExternalTensorPropertiesARM
ptr ExternalTensorPropertiesARM
poked = Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO () -> IO ()
forall b.
Ptr ExternalTensorPropertiesARM
-> ExternalTensorPropertiesARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalTensorPropertiesARM
ptr ExternalTensorPropertiesARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalTensorPropertiesARM where
zero :: ExternalTensorPropertiesARM
zero = ExternalMemoryProperties -> ExternalTensorPropertiesARM
ExternalTensorPropertiesARM
ExternalMemoryProperties
forall a. Zero a => a
zero
data ExternalMemoryTensorCreateInfoARM = ExternalMemoryTensorCreateInfoARM
{
ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryHandleTypeFlagBits
handleTypes :: ExternalMemoryHandleTypeFlags }
deriving (Typeable, ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool
(ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool)
-> (ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool)
-> Eq ExternalMemoryTensorCreateInfoARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool
== :: ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool
$c/= :: ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool
/= :: ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ExternalMemoryTensorCreateInfoARM)
#endif
deriving instance Show ExternalMemoryTensorCreateInfoARM
instance ToCStruct ExternalMemoryTensorCreateInfoARM where
withCStruct :: forall b.
ExternalMemoryTensorCreateInfoARM
-> (Ptr ExternalMemoryTensorCreateInfoARM -> IO b) -> IO b
withCStruct ExternalMemoryTensorCreateInfoARM
x Ptr ExternalMemoryTensorCreateInfoARM -> IO b
f = Int -> (Ptr ExternalMemoryTensorCreateInfoARM -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr ExternalMemoryTensorCreateInfoARM -> IO b) -> IO b)
-> (Ptr ExternalMemoryTensorCreateInfoARM -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ExternalMemoryTensorCreateInfoARM
p -> Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO b -> IO b
forall b.
Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalMemoryTensorCreateInfoARM
p ExternalMemoryTensorCreateInfoARM
x (Ptr ExternalMemoryTensorCreateInfoARM -> IO b
f Ptr ExternalMemoryTensorCreateInfoARM
p)
pokeCStruct :: forall b.
Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO b -> IO b
pokeCStruct Ptr ExternalMemoryTensorCreateInfoARM
p ExternalMemoryTensorCreateInfoARM{ExternalMemoryHandleTypeFlagBits
handleTypes :: ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryHandleTypeFlagBits
handleTypes :: ExternalMemoryHandleTypeFlagBits
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_MEMORY_TENSOR_CREATE_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
Ptr ExternalMemoryHandleTypeFlagBits
-> ExternalMemoryHandleTypeFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM
-> Int -> Ptr ExternalMemoryHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlags)) (ExternalMemoryHandleTypeFlagBits
handleTypes)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ExternalMemoryTensorCreateInfoARM -> IO b -> IO b
pokeZeroCStruct Ptr ExternalMemoryTensorCreateInfoARM
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_EXTERNAL_MEMORY_TENSOR_CREATE_INFO_ARM)
Ptr ("data" ::: Ptr ()) -> ("data" ::: Ptr ()) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM
-> Int -> Ptr ("data" ::: Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) ("data" ::: Ptr ()
forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct ExternalMemoryTensorCreateInfoARM where
peekCStruct :: Ptr ExternalMemoryTensorCreateInfoARM
-> IO ExternalMemoryTensorCreateInfoARM
peekCStruct Ptr ExternalMemoryTensorCreateInfoARM
p = do
handleTypes <- forall a. Storable a => Ptr a -> IO a
peek @ExternalMemoryHandleTypeFlags ((Ptr ExternalMemoryTensorCreateInfoARM
p Ptr ExternalMemoryTensorCreateInfoARM
-> Int -> Ptr ExternalMemoryHandleTypeFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ExternalMemoryHandleTypeFlags))
pure $ ExternalMemoryTensorCreateInfoARM
handleTypes
instance Storable ExternalMemoryTensorCreateInfoARM where
sizeOf :: ExternalMemoryTensorCreateInfoARM -> Int
sizeOf ~ExternalMemoryTensorCreateInfoARM
_ = Int
24
alignment :: ExternalMemoryTensorCreateInfoARM -> Int
alignment ~ExternalMemoryTensorCreateInfoARM
_ = Int
8
peek :: Ptr ExternalMemoryTensorCreateInfoARM
-> IO ExternalMemoryTensorCreateInfoARM
peek = Ptr ExternalMemoryTensorCreateInfoARM
-> IO ExternalMemoryTensorCreateInfoARM
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO ()
poke Ptr ExternalMemoryTensorCreateInfoARM
ptr ExternalMemoryTensorCreateInfoARM
poked = Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO () -> IO ()
forall b.
Ptr ExternalMemoryTensorCreateInfoARM
-> ExternalMemoryTensorCreateInfoARM -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ExternalMemoryTensorCreateInfoARM
ptr ExternalMemoryTensorCreateInfoARM
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ExternalMemoryTensorCreateInfoARM where
zero :: ExternalMemoryTensorCreateInfoARM
zero = ExternalMemoryHandleTypeFlagBits
-> ExternalMemoryTensorCreateInfoARM
ExternalMemoryTensorCreateInfoARM
ExternalMemoryHandleTypeFlagBits
forall a. Zero a => a
zero
type TensorCreateFlagsARM = TensorCreateFlagBitsARM
newtype TensorCreateFlagBitsARM = TensorCreateFlagBitsARM Flags64
deriving newtype (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
(TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> Eq TensorCreateFlagsARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
== :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
$c/= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
/= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
Eq, Eq TensorCreateFlagsARM
Eq TensorCreateFlagsARM =>
(TensorCreateFlagsARM -> TensorCreateFlagsARM -> Ordering)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> Ord TensorCreateFlagsARM
TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
TensorCreateFlagsARM -> TensorCreateFlagsARM -> Ordering
TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Ordering
compare :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Ordering
$c< :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
< :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
$c<= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
<= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
$c> :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
> :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
$c>= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
>= :: TensorCreateFlagsARM -> TensorCreateFlagsARM -> Bool
$cmax :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
max :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
$cmin :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
min :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
Ord, Ptr TensorCreateFlagsARM -> IO TensorCreateFlagsARM
Ptr TensorCreateFlagsARM -> Int -> IO TensorCreateFlagsARM
Ptr TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM -> IO ()
Ptr TensorCreateFlagsARM -> TensorCreateFlagsARM -> IO ()
TensorCreateFlagsARM -> Int
(TensorCreateFlagsARM -> Int)
-> (TensorCreateFlagsARM -> Int)
-> (Ptr TensorCreateFlagsARM -> Int -> IO TensorCreateFlagsARM)
-> (Ptr TensorCreateFlagsARM
-> Int -> TensorCreateFlagsARM -> IO ())
-> (forall b. Ptr b -> Int -> IO TensorCreateFlagsARM)
-> (forall b. Ptr b -> Int -> TensorCreateFlagsARM -> IO ())
-> (Ptr TensorCreateFlagsARM -> IO TensorCreateFlagsARM)
-> (Ptr TensorCreateFlagsARM -> TensorCreateFlagsARM -> IO ())
-> Storable TensorCreateFlagsARM
forall b. Ptr b -> Int -> IO TensorCreateFlagsARM
forall b. Ptr b -> Int -> TensorCreateFlagsARM -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: TensorCreateFlagsARM -> Int
sizeOf :: TensorCreateFlagsARM -> Int
$calignment :: TensorCreateFlagsARM -> Int
alignment :: TensorCreateFlagsARM -> Int
$cpeekElemOff :: Ptr TensorCreateFlagsARM -> Int -> IO TensorCreateFlagsARM
peekElemOff :: Ptr TensorCreateFlagsARM -> Int -> IO TensorCreateFlagsARM
$cpokeElemOff :: Ptr TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM -> IO ()
pokeElemOff :: Ptr TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO TensorCreateFlagsARM
peekByteOff :: forall b. Ptr b -> Int -> IO TensorCreateFlagsARM
$cpokeByteOff :: forall b. Ptr b -> Int -> TensorCreateFlagsARM -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> TensorCreateFlagsARM -> IO ()
$cpeek :: Ptr TensorCreateFlagsARM -> IO TensorCreateFlagsARM
peek :: Ptr TensorCreateFlagsARM -> IO TensorCreateFlagsARM
$cpoke :: Ptr TensorCreateFlagsARM -> TensorCreateFlagsARM -> IO ()
poke :: Ptr TensorCreateFlagsARM -> TensorCreateFlagsARM -> IO ()
Storable, TensorCreateFlagsARM
TensorCreateFlagsARM -> Zero TensorCreateFlagsARM
forall a. a -> Zero a
$czero :: TensorCreateFlagsARM
zero :: TensorCreateFlagsARM
Zero, Eq TensorCreateFlagsARM
TensorCreateFlagsARM
Eq TensorCreateFlagsARM =>
(TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> TensorCreateFlagsARM
-> (Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> Bool)
-> (TensorCreateFlagsARM -> Maybe Int)
-> (TensorCreateFlagsARM -> Int)
-> (TensorCreateFlagsARM -> Bool)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM)
-> (TensorCreateFlagsARM -> Int)
-> Bits TensorCreateFlagsARM
Int -> TensorCreateFlagsARM
TensorCreateFlagsARM -> Bool
TensorCreateFlagsARM -> Int
TensorCreateFlagsARM -> Maybe Int
TensorCreateFlagsARM -> TensorCreateFlagsARM
TensorCreateFlagsARM -> Int -> Bool
TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
.&. :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
$c.|. :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
.|. :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
$cxor :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
xor :: TensorCreateFlagsARM
-> TensorCreateFlagsARM -> TensorCreateFlagsARM
$ccomplement :: TensorCreateFlagsARM -> TensorCreateFlagsARM
complement :: TensorCreateFlagsARM -> TensorCreateFlagsARM
$cshift :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
shift :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$crotate :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
rotate :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$czeroBits :: TensorCreateFlagsARM
zeroBits :: TensorCreateFlagsARM
$cbit :: Int -> TensorCreateFlagsARM
bit :: Int -> TensorCreateFlagsARM
$csetBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
setBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$cclearBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
clearBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$ccomplementBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
complementBit :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$ctestBit :: TensorCreateFlagsARM -> Int -> Bool
testBit :: TensorCreateFlagsARM -> Int -> Bool
$cbitSizeMaybe :: TensorCreateFlagsARM -> Maybe Int
bitSizeMaybe :: TensorCreateFlagsARM -> Maybe Int
$cbitSize :: TensorCreateFlagsARM -> Int
bitSize :: TensorCreateFlagsARM -> Int
$cisSigned :: TensorCreateFlagsARM -> Bool
isSigned :: TensorCreateFlagsARM -> Bool
$cshiftL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
shiftL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$cunsafeShiftL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
unsafeShiftL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$cshiftR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
shiftR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$cunsafeShiftR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
unsafeShiftR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$crotateL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
rotateL :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$crotateR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
rotateR :: TensorCreateFlagsARM -> Int -> TensorCreateFlagsARM
$cpopCount :: TensorCreateFlagsARM -> Int
popCount :: TensorCreateFlagsARM -> Int
Bits, Bits TensorCreateFlagsARM
Bits TensorCreateFlagsARM =>
(TensorCreateFlagsARM -> Int)
-> (TensorCreateFlagsARM -> Int)
-> (TensorCreateFlagsARM -> Int)
-> FiniteBits TensorCreateFlagsARM
TensorCreateFlagsARM -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: TensorCreateFlagsARM -> Int
finiteBitSize :: TensorCreateFlagsARM -> Int
$ccountLeadingZeros :: TensorCreateFlagsARM -> Int
countLeadingZeros :: TensorCreateFlagsARM -> Int
$ccountTrailingZeros :: TensorCreateFlagsARM -> Int
countTrailingZeros :: TensorCreateFlagsARM -> Int
FiniteBits)
pattern $mTENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM :: forall {r}.
TensorCreateFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM :: TensorCreateFlagsARM
TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM = TensorCreateFlagBitsARM 0x0000000000000001
pattern $mTENSOR_CREATE_PROTECTED_BIT_ARM :: forall {r}.
TensorCreateFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_CREATE_PROTECTED_BIT_ARM :: TensorCreateFlagsARM
TENSOR_CREATE_PROTECTED_BIT_ARM = TensorCreateFlagBitsARM 0x0000000000000002
pattern $mTENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM :: forall {r}.
TensorCreateFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM :: TensorCreateFlagsARM
TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM = TensorCreateFlagBitsARM 0x0000000000000004
pattern $mTENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM :: forall {r}.
TensorCreateFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM :: TensorCreateFlagsARM
TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM = TensorCreateFlagBitsARM 0x0000000000000008
conNameTensorCreateFlagBitsARM :: String
conNameTensorCreateFlagBitsARM :: String
conNameTensorCreateFlagBitsARM = String
"TensorCreateFlagBitsARM"
enumPrefixTensorCreateFlagBitsARM :: String
enumPrefixTensorCreateFlagBitsARM :: String
enumPrefixTensorCreateFlagBitsARM = String
"TENSOR_CREATE_"
showTableTensorCreateFlagBitsARM :: [(TensorCreateFlagBitsARM, String)]
showTableTensorCreateFlagBitsARM :: [(TensorCreateFlagsARM, String)]
showTableTensorCreateFlagBitsARM =
[
( TensorCreateFlagsARM
TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM
, String
"MUTABLE_FORMAT_BIT_ARM"
)
,
( TensorCreateFlagsARM
TENSOR_CREATE_PROTECTED_BIT_ARM
, String
"PROTECTED_BIT_ARM"
)
,
( TensorCreateFlagsARM
TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM
, String
"DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM"
)
,
( TensorCreateFlagsARM
TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM
, String
"DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM"
)
]
instance Show TensorCreateFlagBitsARM where
showsPrec :: Int -> TensorCreateFlagsARM -> ShowS
showsPrec =
String
-> [(TensorCreateFlagsARM, String)]
-> String
-> (TensorCreateFlagsARM -> Word64)
-> (Word64 -> ShowS)
-> Int
-> TensorCreateFlagsARM
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixTensorCreateFlagBitsARM
[(TensorCreateFlagsARM, String)]
showTableTensorCreateFlagBitsARM
String
conNameTensorCreateFlagBitsARM
(\(TensorCreateFlagBitsARM Word64
x) -> Word64
x)
(\Word64
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word64 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word64
x)
instance Read TensorCreateFlagBitsARM where
readPrec :: ReadPrec TensorCreateFlagsARM
readPrec =
String
-> [(TensorCreateFlagsARM, String)]
-> String
-> (Word64 -> TensorCreateFlagsARM)
-> ReadPrec TensorCreateFlagsARM
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixTensorCreateFlagBitsARM
[(TensorCreateFlagsARM, String)]
showTableTensorCreateFlagBitsARM
String
conNameTensorCreateFlagBitsARM
Word64 -> TensorCreateFlagsARM
TensorCreateFlagBitsARM
type TensorUsageFlagsARM = TensorUsageFlagBitsARM
newtype TensorUsageFlagBitsARM = TensorUsageFlagBitsARM Flags64
deriving newtype (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
(TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> Eq TensorUsageFlagsARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
== :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
$c/= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
/= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
Eq, Eq TensorUsageFlagsARM
Eq TensorUsageFlagsARM =>
(TensorUsageFlagsARM -> TensorUsageFlagsARM -> Ordering)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM
-> TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM
-> TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> Ord TensorUsageFlagsARM
TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
TensorUsageFlagsARM -> TensorUsageFlagsARM -> Ordering
TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Ordering
compare :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Ordering
$c< :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
< :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
$c<= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
<= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
$c> :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
> :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
$c>= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
>= :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> Bool
$cmax :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
max :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
$cmin :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
min :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
Ord, Ptr TensorUsageFlagsARM -> IO TensorUsageFlagsARM
Ptr TensorUsageFlagsARM -> Int -> IO TensorUsageFlagsARM
Ptr TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM -> IO ()
Ptr TensorUsageFlagsARM -> TensorUsageFlagsARM -> IO ()
TensorUsageFlagsARM -> Int
(TensorUsageFlagsARM -> Int)
-> (TensorUsageFlagsARM -> Int)
-> (Ptr TensorUsageFlagsARM -> Int -> IO TensorUsageFlagsARM)
-> (Ptr TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM -> IO ())
-> (forall b. Ptr b -> Int -> IO TensorUsageFlagsARM)
-> (forall b. Ptr b -> Int -> TensorUsageFlagsARM -> IO ())
-> (Ptr TensorUsageFlagsARM -> IO TensorUsageFlagsARM)
-> (Ptr TensorUsageFlagsARM -> TensorUsageFlagsARM -> IO ())
-> Storable TensorUsageFlagsARM
forall b. Ptr b -> Int -> IO TensorUsageFlagsARM
forall b. Ptr b -> Int -> TensorUsageFlagsARM -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: TensorUsageFlagsARM -> Int
sizeOf :: TensorUsageFlagsARM -> Int
$calignment :: TensorUsageFlagsARM -> Int
alignment :: TensorUsageFlagsARM -> Int
$cpeekElemOff :: Ptr TensorUsageFlagsARM -> Int -> IO TensorUsageFlagsARM
peekElemOff :: Ptr TensorUsageFlagsARM -> Int -> IO TensorUsageFlagsARM
$cpokeElemOff :: Ptr TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM -> IO ()
pokeElemOff :: Ptr TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO TensorUsageFlagsARM
peekByteOff :: forall b. Ptr b -> Int -> IO TensorUsageFlagsARM
$cpokeByteOff :: forall b. Ptr b -> Int -> TensorUsageFlagsARM -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> TensorUsageFlagsARM -> IO ()
$cpeek :: Ptr TensorUsageFlagsARM -> IO TensorUsageFlagsARM
peek :: Ptr TensorUsageFlagsARM -> IO TensorUsageFlagsARM
$cpoke :: Ptr TensorUsageFlagsARM -> TensorUsageFlagsARM -> IO ()
poke :: Ptr TensorUsageFlagsARM -> TensorUsageFlagsARM -> IO ()
Storable, TensorUsageFlagsARM
TensorUsageFlagsARM -> Zero TensorUsageFlagsARM
forall a. a -> Zero a
$czero :: TensorUsageFlagsARM
zero :: TensorUsageFlagsARM
Zero, Eq TensorUsageFlagsARM
TensorUsageFlagsARM
Eq TensorUsageFlagsARM =>
(TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM
-> TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM
-> TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> TensorUsageFlagsARM
-> (Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> Bool)
-> (TensorUsageFlagsARM -> Maybe Int)
-> (TensorUsageFlagsARM -> Int)
-> (TensorUsageFlagsARM -> Bool)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM)
-> (TensorUsageFlagsARM -> Int)
-> Bits TensorUsageFlagsARM
Int -> TensorUsageFlagsARM
TensorUsageFlagsARM -> Bool
TensorUsageFlagsARM -> Int
TensorUsageFlagsARM -> Maybe Int
TensorUsageFlagsARM -> TensorUsageFlagsARM
TensorUsageFlagsARM -> Int -> Bool
TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
.&. :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
$c.|. :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
.|. :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
$cxor :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
xor :: TensorUsageFlagsARM -> TensorUsageFlagsARM -> TensorUsageFlagsARM
$ccomplement :: TensorUsageFlagsARM -> TensorUsageFlagsARM
complement :: TensorUsageFlagsARM -> TensorUsageFlagsARM
$cshift :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
shift :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$crotate :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
rotate :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$czeroBits :: TensorUsageFlagsARM
zeroBits :: TensorUsageFlagsARM
$cbit :: Int -> TensorUsageFlagsARM
bit :: Int -> TensorUsageFlagsARM
$csetBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
setBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$cclearBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
clearBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$ccomplementBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
complementBit :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$ctestBit :: TensorUsageFlagsARM -> Int -> Bool
testBit :: TensorUsageFlagsARM -> Int -> Bool
$cbitSizeMaybe :: TensorUsageFlagsARM -> Maybe Int
bitSizeMaybe :: TensorUsageFlagsARM -> Maybe Int
$cbitSize :: TensorUsageFlagsARM -> Int
bitSize :: TensorUsageFlagsARM -> Int
$cisSigned :: TensorUsageFlagsARM -> Bool
isSigned :: TensorUsageFlagsARM -> Bool
$cshiftL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
shiftL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$cunsafeShiftL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
unsafeShiftL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$cshiftR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
shiftR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$cunsafeShiftR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
unsafeShiftR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$crotateL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
rotateL :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$crotateR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
rotateR :: TensorUsageFlagsARM -> Int -> TensorUsageFlagsARM
$cpopCount :: TensorUsageFlagsARM -> Int
popCount :: TensorUsageFlagsARM -> Int
Bits, Bits TensorUsageFlagsARM
Bits TensorUsageFlagsARM =>
(TensorUsageFlagsARM -> Int)
-> (TensorUsageFlagsARM -> Int)
-> (TensorUsageFlagsARM -> Int)
-> FiniteBits TensorUsageFlagsARM
TensorUsageFlagsARM -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: TensorUsageFlagsARM -> Int
finiteBitSize :: TensorUsageFlagsARM -> Int
$ccountLeadingZeros :: TensorUsageFlagsARM -> Int
countLeadingZeros :: TensorUsageFlagsARM -> Int
$ccountTrailingZeros :: TensorUsageFlagsARM -> Int
countTrailingZeros :: TensorUsageFlagsARM -> Int
FiniteBits)
pattern $mTENSOR_USAGE_SHADER_BIT_ARM :: forall {r}.
TensorUsageFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_USAGE_SHADER_BIT_ARM :: TensorUsageFlagsARM
TENSOR_USAGE_SHADER_BIT_ARM = TensorUsageFlagBitsARM 0x0000000000000002
pattern $mTENSOR_USAGE_TRANSFER_SRC_BIT_ARM :: forall {r}.
TensorUsageFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_USAGE_TRANSFER_SRC_BIT_ARM :: TensorUsageFlagsARM
TENSOR_USAGE_TRANSFER_SRC_BIT_ARM = TensorUsageFlagBitsARM 0x0000000000000004
pattern $mTENSOR_USAGE_TRANSFER_DST_BIT_ARM :: forall {r}.
TensorUsageFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_USAGE_TRANSFER_DST_BIT_ARM :: TensorUsageFlagsARM
TENSOR_USAGE_TRANSFER_DST_BIT_ARM = TensorUsageFlagBitsARM 0x0000000000000008
pattern $mTENSOR_USAGE_IMAGE_ALIASING_BIT_ARM :: forall {r}.
TensorUsageFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_USAGE_IMAGE_ALIASING_BIT_ARM :: TensorUsageFlagsARM
TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM = TensorUsageFlagBitsARM 0x0000000000000010
pattern $mTENSOR_USAGE_DATA_GRAPH_BIT_ARM :: forall {r}.
TensorUsageFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_USAGE_DATA_GRAPH_BIT_ARM :: TensorUsageFlagsARM
TENSOR_USAGE_DATA_GRAPH_BIT_ARM = TensorUsageFlagBitsARM 0x0000000000000020
conNameTensorUsageFlagBitsARM :: String
conNameTensorUsageFlagBitsARM :: String
conNameTensorUsageFlagBitsARM = String
"TensorUsageFlagBitsARM"
enumPrefixTensorUsageFlagBitsARM :: String
enumPrefixTensorUsageFlagBitsARM :: String
enumPrefixTensorUsageFlagBitsARM = String
"TENSOR_USAGE_"
showTableTensorUsageFlagBitsARM :: [(TensorUsageFlagBitsARM, String)]
showTableTensorUsageFlagBitsARM :: [(TensorUsageFlagsARM, String)]
showTableTensorUsageFlagBitsARM =
[
( TensorUsageFlagsARM
TENSOR_USAGE_SHADER_BIT_ARM
, String
"SHADER_BIT_ARM"
)
,
( TensorUsageFlagsARM
TENSOR_USAGE_TRANSFER_SRC_BIT_ARM
, String
"TRANSFER_SRC_BIT_ARM"
)
,
( TensorUsageFlagsARM
TENSOR_USAGE_TRANSFER_DST_BIT_ARM
, String
"TRANSFER_DST_BIT_ARM"
)
,
( TensorUsageFlagsARM
TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM
, String
"IMAGE_ALIASING_BIT_ARM"
)
,
( TensorUsageFlagsARM
TENSOR_USAGE_DATA_GRAPH_BIT_ARM
, String
"DATA_GRAPH_BIT_ARM"
)
]
instance Show TensorUsageFlagBitsARM where
showsPrec :: Int -> TensorUsageFlagsARM -> ShowS
showsPrec =
String
-> [(TensorUsageFlagsARM, String)]
-> String
-> (TensorUsageFlagsARM -> Word64)
-> (Word64 -> ShowS)
-> Int
-> TensorUsageFlagsARM
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixTensorUsageFlagBitsARM
[(TensorUsageFlagsARM, String)]
showTableTensorUsageFlagBitsARM
String
conNameTensorUsageFlagBitsARM
(\(TensorUsageFlagBitsARM Word64
x) -> Word64
x)
(\Word64
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word64 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word64
x)
instance Read TensorUsageFlagBitsARM where
readPrec :: ReadPrec TensorUsageFlagsARM
readPrec =
String
-> [(TensorUsageFlagsARM, String)]
-> String
-> (Word64 -> TensorUsageFlagsARM)
-> ReadPrec TensorUsageFlagsARM
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixTensorUsageFlagBitsARM
[(TensorUsageFlagsARM, String)]
showTableTensorUsageFlagBitsARM
String
conNameTensorUsageFlagBitsARM
Word64 -> TensorUsageFlagsARM
TensorUsageFlagBitsARM
newtype TensorTilingARM = TensorTilingARM Int32
deriving newtype (TensorTilingARM -> TensorTilingARM -> Bool
(TensorTilingARM -> TensorTilingARM -> Bool)
-> (TensorTilingARM -> TensorTilingARM -> Bool)
-> Eq TensorTilingARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorTilingARM -> TensorTilingARM -> Bool
== :: TensorTilingARM -> TensorTilingARM -> Bool
$c/= :: TensorTilingARM -> TensorTilingARM -> Bool
/= :: TensorTilingARM -> TensorTilingARM -> Bool
Eq, Eq TensorTilingARM
Eq TensorTilingARM =>
(TensorTilingARM -> TensorTilingARM -> Ordering)
-> (TensorTilingARM -> TensorTilingARM -> Bool)
-> (TensorTilingARM -> TensorTilingARM -> Bool)
-> (TensorTilingARM -> TensorTilingARM -> Bool)
-> (TensorTilingARM -> TensorTilingARM -> Bool)
-> (TensorTilingARM -> TensorTilingARM -> TensorTilingARM)
-> (TensorTilingARM -> TensorTilingARM -> TensorTilingARM)
-> Ord TensorTilingARM
TensorTilingARM -> TensorTilingARM -> Bool
TensorTilingARM -> TensorTilingARM -> Ordering
TensorTilingARM -> TensorTilingARM -> TensorTilingARM
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TensorTilingARM -> TensorTilingARM -> Ordering
compare :: TensorTilingARM -> TensorTilingARM -> Ordering
$c< :: TensorTilingARM -> TensorTilingARM -> Bool
< :: TensorTilingARM -> TensorTilingARM -> Bool
$c<= :: TensorTilingARM -> TensorTilingARM -> Bool
<= :: TensorTilingARM -> TensorTilingARM -> Bool
$c> :: TensorTilingARM -> TensorTilingARM -> Bool
> :: TensorTilingARM -> TensorTilingARM -> Bool
$c>= :: TensorTilingARM -> TensorTilingARM -> Bool
>= :: TensorTilingARM -> TensorTilingARM -> Bool
$cmax :: TensorTilingARM -> TensorTilingARM -> TensorTilingARM
max :: TensorTilingARM -> TensorTilingARM -> TensorTilingARM
$cmin :: TensorTilingARM -> TensorTilingARM -> TensorTilingARM
min :: TensorTilingARM -> TensorTilingARM -> TensorTilingARM
Ord, Ptr TensorTilingARM -> IO TensorTilingARM
Ptr TensorTilingARM -> Int -> IO TensorTilingARM
Ptr TensorTilingARM -> Int -> TensorTilingARM -> IO ()
Ptr TensorTilingARM -> TensorTilingARM -> IO ()
TensorTilingARM -> Int
(TensorTilingARM -> Int)
-> (TensorTilingARM -> Int)
-> (Ptr TensorTilingARM -> Int -> IO TensorTilingARM)
-> (Ptr TensorTilingARM -> Int -> TensorTilingARM -> IO ())
-> (forall b. Ptr b -> Int -> IO TensorTilingARM)
-> (forall b. Ptr b -> Int -> TensorTilingARM -> IO ())
-> (Ptr TensorTilingARM -> IO TensorTilingARM)
-> (Ptr TensorTilingARM -> TensorTilingARM -> IO ())
-> Storable TensorTilingARM
forall b. Ptr b -> Int -> IO TensorTilingARM
forall b. Ptr b -> Int -> TensorTilingARM -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: TensorTilingARM -> Int
sizeOf :: TensorTilingARM -> Int
$calignment :: TensorTilingARM -> Int
alignment :: TensorTilingARM -> Int
$cpeekElemOff :: Ptr TensorTilingARM -> Int -> IO TensorTilingARM
peekElemOff :: Ptr TensorTilingARM -> Int -> IO TensorTilingARM
$cpokeElemOff :: Ptr TensorTilingARM -> Int -> TensorTilingARM -> IO ()
pokeElemOff :: Ptr TensorTilingARM -> Int -> TensorTilingARM -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO TensorTilingARM
peekByteOff :: forall b. Ptr b -> Int -> IO TensorTilingARM
$cpokeByteOff :: forall b. Ptr b -> Int -> TensorTilingARM -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> TensorTilingARM -> IO ()
$cpeek :: Ptr TensorTilingARM -> IO TensorTilingARM
peek :: Ptr TensorTilingARM -> IO TensorTilingARM
$cpoke :: Ptr TensorTilingARM -> TensorTilingARM -> IO ()
poke :: Ptr TensorTilingARM -> TensorTilingARM -> IO ()
Storable, TensorTilingARM
TensorTilingARM -> Zero TensorTilingARM
forall a. a -> Zero a
$czero :: TensorTilingARM
zero :: TensorTilingARM
Zero)
pattern $mTENSOR_TILING_OPTIMAL_ARM :: forall {r}. TensorTilingARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_TILING_OPTIMAL_ARM :: TensorTilingARM
TENSOR_TILING_OPTIMAL_ARM = TensorTilingARM 0
pattern $mTENSOR_TILING_LINEAR_ARM :: forall {r}. TensorTilingARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_TILING_LINEAR_ARM :: TensorTilingARM
TENSOR_TILING_LINEAR_ARM = TensorTilingARM 1
{-# COMPLETE
TENSOR_TILING_OPTIMAL_ARM
, TENSOR_TILING_LINEAR_ARM ::
TensorTilingARM
#-}
conNameTensorTilingARM :: String
conNameTensorTilingARM :: String
conNameTensorTilingARM = String
"TensorTilingARM"
enumPrefixTensorTilingARM :: String
enumPrefixTensorTilingARM :: String
enumPrefixTensorTilingARM = String
"TENSOR_TILING_"
showTableTensorTilingARM :: [(TensorTilingARM, String)]
showTableTensorTilingARM :: [(TensorTilingARM, String)]
showTableTensorTilingARM =
[ (TensorTilingARM
TENSOR_TILING_OPTIMAL_ARM, String
"OPTIMAL_ARM")
, (TensorTilingARM
TENSOR_TILING_LINEAR_ARM, String
"LINEAR_ARM")
]
instance Show TensorTilingARM where
showsPrec :: Int -> TensorTilingARM -> ShowS
showsPrec =
String
-> [(TensorTilingARM, String)]
-> String
-> (TensorTilingARM -> Int32)
-> (Int32 -> ShowS)
-> Int
-> TensorTilingARM
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixTensorTilingARM
[(TensorTilingARM, String)]
showTableTensorTilingARM
String
conNameTensorTilingARM
(\(TensorTilingARM Int32
x) -> Int32
x)
(Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)
instance Read TensorTilingARM where
readPrec :: ReadPrec TensorTilingARM
readPrec =
String
-> [(TensorTilingARM, String)]
-> String
-> (Int32 -> TensorTilingARM)
-> ReadPrec TensorTilingARM
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixTensorTilingARM
[(TensorTilingARM, String)]
showTableTensorTilingARM
String
conNameTensorTilingARM
Int32 -> TensorTilingARM
TensorTilingARM
type TensorViewCreateFlagsARM = TensorViewCreateFlagBitsARM
newtype TensorViewCreateFlagBitsARM = TensorViewCreateFlagBitsARM Flags64
deriving newtype (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
(TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> Eq TensorViewCreateFlagsARM
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
== :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
$c/= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
/= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
Eq, Eq TensorViewCreateFlagsARM
Eq TensorViewCreateFlagsARM =>
(TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Ordering)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> Ord TensorViewCreateFlagsARM
TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Ordering
TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Ordering
compare :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Ordering
$c< :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
< :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
$c<= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
<= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
$c> :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
> :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
$c>= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
>= :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> Bool
$cmax :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
max :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
$cmin :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
min :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
Ord, Ptr TensorViewCreateFlagsARM -> IO TensorViewCreateFlagsARM
Ptr TensorViewCreateFlagsARM -> Int -> IO TensorViewCreateFlagsARM
Ptr TensorViewCreateFlagsARM
-> Int -> TensorViewCreateFlagsARM -> IO ()
Ptr TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> IO ()
TensorViewCreateFlagsARM -> Int
(TensorViewCreateFlagsARM -> Int)
-> (TensorViewCreateFlagsARM -> Int)
-> (Ptr TensorViewCreateFlagsARM
-> Int -> IO TensorViewCreateFlagsARM)
-> (Ptr TensorViewCreateFlagsARM
-> Int -> TensorViewCreateFlagsARM -> IO ())
-> (forall b. Ptr b -> Int -> IO TensorViewCreateFlagsARM)
-> (forall b. Ptr b -> Int -> TensorViewCreateFlagsARM -> IO ())
-> (Ptr TensorViewCreateFlagsARM -> IO TensorViewCreateFlagsARM)
-> (Ptr TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> IO ())
-> Storable TensorViewCreateFlagsARM
forall b. Ptr b -> Int -> IO TensorViewCreateFlagsARM
forall b. Ptr b -> Int -> TensorViewCreateFlagsARM -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: TensorViewCreateFlagsARM -> Int
sizeOf :: TensorViewCreateFlagsARM -> Int
$calignment :: TensorViewCreateFlagsARM -> Int
alignment :: TensorViewCreateFlagsARM -> Int
$cpeekElemOff :: Ptr TensorViewCreateFlagsARM -> Int -> IO TensorViewCreateFlagsARM
peekElemOff :: Ptr TensorViewCreateFlagsARM -> Int -> IO TensorViewCreateFlagsARM
$cpokeElemOff :: Ptr TensorViewCreateFlagsARM
-> Int -> TensorViewCreateFlagsARM -> IO ()
pokeElemOff :: Ptr TensorViewCreateFlagsARM
-> Int -> TensorViewCreateFlagsARM -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO TensorViewCreateFlagsARM
peekByteOff :: forall b. Ptr b -> Int -> IO TensorViewCreateFlagsARM
$cpokeByteOff :: forall b. Ptr b -> Int -> TensorViewCreateFlagsARM -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> TensorViewCreateFlagsARM -> IO ()
$cpeek :: Ptr TensorViewCreateFlagsARM -> IO TensorViewCreateFlagsARM
peek :: Ptr TensorViewCreateFlagsARM -> IO TensorViewCreateFlagsARM
$cpoke :: Ptr TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> IO ()
poke :: Ptr TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM -> IO ()
Storable, TensorViewCreateFlagsARM
TensorViewCreateFlagsARM -> Zero TensorViewCreateFlagsARM
forall a. a -> Zero a
$czero :: TensorViewCreateFlagsARM
zero :: TensorViewCreateFlagsARM
Zero, Eq TensorViewCreateFlagsARM
TensorViewCreateFlagsARM
Eq TensorViewCreateFlagsARM =>
(TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> TensorViewCreateFlagsARM
-> (Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> Bool)
-> (TensorViewCreateFlagsARM -> Maybe Int)
-> (TensorViewCreateFlagsARM -> Int)
-> (TensorViewCreateFlagsARM -> Bool)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM)
-> (TensorViewCreateFlagsARM -> Int)
-> Bits TensorViewCreateFlagsARM
Int -> TensorViewCreateFlagsARM
TensorViewCreateFlagsARM -> Bool
TensorViewCreateFlagsARM -> Int
TensorViewCreateFlagsARM -> Maybe Int
TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
TensorViewCreateFlagsARM -> Int -> Bool
TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
.&. :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
$c.|. :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
.|. :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
$cxor :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
xor :: TensorViewCreateFlagsARM
-> TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
$ccomplement :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
complement :: TensorViewCreateFlagsARM -> TensorViewCreateFlagsARM
$cshift :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
shift :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$crotate :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
rotate :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$czeroBits :: TensorViewCreateFlagsARM
zeroBits :: TensorViewCreateFlagsARM
$cbit :: Int -> TensorViewCreateFlagsARM
bit :: Int -> TensorViewCreateFlagsARM
$csetBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
setBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$cclearBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
clearBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$ccomplementBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
complementBit :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$ctestBit :: TensorViewCreateFlagsARM -> Int -> Bool
testBit :: TensorViewCreateFlagsARM -> Int -> Bool
$cbitSizeMaybe :: TensorViewCreateFlagsARM -> Maybe Int
bitSizeMaybe :: TensorViewCreateFlagsARM -> Maybe Int
$cbitSize :: TensorViewCreateFlagsARM -> Int
bitSize :: TensorViewCreateFlagsARM -> Int
$cisSigned :: TensorViewCreateFlagsARM -> Bool
isSigned :: TensorViewCreateFlagsARM -> Bool
$cshiftL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
shiftL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$cunsafeShiftL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
unsafeShiftL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$cshiftR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
shiftR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$cunsafeShiftR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
unsafeShiftR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$crotateL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
rotateL :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$crotateR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
rotateR :: TensorViewCreateFlagsARM -> Int -> TensorViewCreateFlagsARM
$cpopCount :: TensorViewCreateFlagsARM -> Int
popCount :: TensorViewCreateFlagsARM -> Int
Bits, Bits TensorViewCreateFlagsARM
Bits TensorViewCreateFlagsARM =>
(TensorViewCreateFlagsARM -> Int)
-> (TensorViewCreateFlagsARM -> Int)
-> (TensorViewCreateFlagsARM -> Int)
-> FiniteBits TensorViewCreateFlagsARM
TensorViewCreateFlagsARM -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: TensorViewCreateFlagsARM -> Int
finiteBitSize :: TensorViewCreateFlagsARM -> Int
$ccountLeadingZeros :: TensorViewCreateFlagsARM -> Int
countLeadingZeros :: TensorViewCreateFlagsARM -> Int
$ccountTrailingZeros :: TensorViewCreateFlagsARM -> Int
countTrailingZeros :: TensorViewCreateFlagsARM -> Int
FiniteBits)
pattern $mTENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM :: forall {r}.
TensorViewCreateFlagsARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM :: TensorViewCreateFlagsARM
TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM = TensorViewCreateFlagBitsARM 0x0000000000000001
conNameTensorViewCreateFlagBitsARM :: String
conNameTensorViewCreateFlagBitsARM :: String
conNameTensorViewCreateFlagBitsARM = String
"TensorViewCreateFlagBitsARM"
enumPrefixTensorViewCreateFlagBitsARM :: String
enumPrefixTensorViewCreateFlagBitsARM :: String
enumPrefixTensorViewCreateFlagBitsARM = String
"TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM"
showTableTensorViewCreateFlagBitsARM :: [(TensorViewCreateFlagBitsARM, String)]
showTableTensorViewCreateFlagBitsARM :: [(TensorViewCreateFlagsARM, String)]
showTableTensorViewCreateFlagBitsARM =
[
( TensorViewCreateFlagsARM
TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM
, String
""
)
]
instance Show TensorViewCreateFlagBitsARM where
showsPrec :: Int -> TensorViewCreateFlagsARM -> ShowS
showsPrec =
String
-> [(TensorViewCreateFlagsARM, String)]
-> String
-> (TensorViewCreateFlagsARM -> Word64)
-> (Word64 -> ShowS)
-> Int
-> TensorViewCreateFlagsARM
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixTensorViewCreateFlagBitsARM
[(TensorViewCreateFlagsARM, String)]
showTableTensorViewCreateFlagBitsARM
String
conNameTensorViewCreateFlagBitsARM
(\(TensorViewCreateFlagBitsARM Word64
x) -> Word64
x)
(\Word64
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word64 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word64
x)
instance Read TensorViewCreateFlagBitsARM where
readPrec :: ReadPrec TensorViewCreateFlagsARM
readPrec =
String
-> [(TensorViewCreateFlagsARM, String)]
-> String
-> (Word64 -> TensorViewCreateFlagsARM)
-> ReadPrec TensorViewCreateFlagsARM
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixTensorViewCreateFlagBitsARM
[(TensorViewCreateFlagsARM, String)]
showTableTensorViewCreateFlagBitsARM
String
conNameTensorViewCreateFlagBitsARM
Word64 -> TensorViewCreateFlagsARM
TensorViewCreateFlagBitsARM
type ARM_TENSORS_SPEC_VERSION = 2
pattern ARM_TENSORS_SPEC_VERSION :: forall a . Integral a => a
pattern $mARM_TENSORS_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bARM_TENSORS_SPEC_VERSION :: forall a. Integral a => a
ARM_TENSORS_SPEC_VERSION = 2
type ARM_TENSORS_EXTENSION_NAME = "VK_ARM_tensors"
pattern ARM_TENSORS_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mARM_TENSORS_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bARM_TENSORS_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
ARM_TENSORS_EXTENSION_NAME = "VK_ARM_tensors"