{-# language CPP #-}
-- | = Name
--
-- VK_ARM_tensors - device extension
--
-- = VK_ARM_tensors
--
-- [__Name String__]
--     @VK_ARM_tensors@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     461
--
-- [__Revision__]
--     2
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.3 Vulkan Version 1.3>
--
-- [__API Interactions__]
--
--     -   Interacts with VK_EXT_descriptor_buffer
--
--     -   Interacts with VK_EXT_frame_boundary
--
--     -   Interacts with VK_EXT_shader_float8
--
--     -   Interacts with VK_KHR_shader_bfloat16
--
-- [__SPIR-V Dependencies__]
--
--     -   <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/ARM/SPV_ARM_tensors.html SPV_ARM_tensors>
--
-- [__Contact__]
--
--     -   Kevin Petit
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_ARM_tensors] @kpet%0A*Here describe the issue or question you have about the VK_ARM_tensors extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_ARM_tensors.adoc VK_ARM_tensors>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2026-01-07
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/ARM/SPV_ARM_tensors.html SPV_ARM_tensors>
--
--     -   This extension provides API support for
--         <https://github.com/KhronosGroup/GLSL/blob/main/extensions/arm/GL_ARM_tensors.txt GL_ARM_tensors>
--
--     -   This extension interacts with @VK_EXT_mutable_descriptor_type@
--
--     -   This extension interacts with @VK_EXT_descriptor_buffer@
--
--     -   This extension interacts with @VK_EXT_frame_boundary@
--
--     -   This extension interacts with @VK_EXT_robustness2@
--
--     -   This extension interacts with @VK_KHR_unified_image_layouts@
--
--     -   This extension interacts with @VK_KHR_shader_bfloat16@
--
--     -   This extension interacts with @VK_EXT_shader_float8@
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Kévin Petit, Arm Ltd.
--
--     -   Einar Hov, Arm Ltd.
--
--     -   Dominic Symes, Arm Ltd.
--
--     -   Jan-Harald Fredriksen, Arm Ltd.
--
--     -   Marco Cattani, Arm Ltd.
--
--     -   Lisa Wu, Arm Ltd.
--
--     -   Robert Hughes, Arm Ltd.
--
--     -   David Garbett, Arm Ltd.
--
--     -   Oualid Khelifi, Arm Ltd.
--
-- == Description
--
-- This extension adds support for tensors.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.TensorARM'
--
-- -   'Vulkan.Extensions.Handles.TensorViewARM'
--
-- == New Commands
--
-- -   'bindTensorMemoryARM'
--
-- -   'cmdCopyTensorARM'
--
-- -   'createTensorARM'
--
-- -   'createTensorViewARM'
--
-- -   'destroyTensorARM'
--
-- -   'destroyTensorViewARM'
--
-- -   'getDeviceTensorMemoryRequirementsARM'
--
-- -   'getPhysicalDeviceExternalTensorPropertiesARM'
--
-- -   'getTensorMemoryRequirementsARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   'getTensorOpaqueCaptureDescriptorDataARM'
--
-- -   'getTensorViewOpaqueCaptureDescriptorDataARM'
--
-- == New Structures
--
-- -   'BindTensorMemoryInfoARM'
--
-- -   'CopyTensorInfoARM'
--
-- -   'DeviceTensorMemoryRequirementsARM'
--
-- -   'ExternalTensorPropertiesARM'
--
-- -   'PhysicalDeviceExternalTensorInfoARM'
--
-- -   'TensorCopyARM'
--
-- -   'TensorCreateInfoARM'
--
-- -   'TensorMemoryRequirementsInfoARM'
--
-- -   'TensorViewCreateInfoARM'
--
-- -   Extending
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphPipelineResourceInfoARM',
--     'Vulkan.Extensions.VK_ARM_data_graph.DataGraphPipelineConstantARM':
--
--     -   'TensorDescriptionARM'
--
-- -   Extending
--     'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.DependencyInfo':
--
--     -   'TensorDependencyInfoARM'
--
--     -   'TensorMemoryBarrierARM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.FormatProperties2':
--
--     -   'TensorFormatPropertiesARM'
--
-- -   Extending 'Vulkan.Core10.Memory.MemoryAllocateInfo':
--
--     -   'MemoryDedicatedAllocateInfoTensorARM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceTensorFeaturesARM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceTensorPropertiesARM'
--
-- -   Extending 'TensorCreateInfoARM':
--
--     -   'ExternalMemoryTensorCreateInfoARM'
--
-- -   Extending 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet':
--
--     -   'WriteDescriptorSetTensorARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   'TensorCaptureDescriptorDataInfoARM'
--
-- -   'TensorViewCaptureDescriptorDataInfoARM'
--
-- -   Extending
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.DescriptorGetInfoEXT':
--
--     -   'DescriptorGetTensorInfoARM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceDescriptorBufferTensorFeaturesARM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceDescriptorBufferTensorPropertiesARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_frame_boundary VK_EXT_frame_boundary>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Queue.SubmitInfo',
--     'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.SubmitInfo2',
--     'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR',
--     'Vulkan.Core10.SparseResourceMemoryManagement.BindSparseInfo':
--
--     -   'FrameBoundaryTensorsARM'
--
-- == New Enums
--
-- -   'TensorCreateFlagBitsARM'
--
-- -   'TensorTilingARM'
--
-- -   'TensorUsageFlagBitsARM'
--
-- -   'TensorViewCreateFlagBitsARM'
--
-- == New Bitmasks
--
-- -   'TensorCreateFlagsARM'
--
-- -   'TensorUsageFlagsARM'
--
-- -   'TensorViewCreateFlagsARM'
--
-- == New Enum Constants
--
-- -   'ARM_TENSORS_EXTENSION_NAME'
--
-- -   'ARM_TENSORS_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.DescriptorType.DescriptorType':
--
--     -   'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
--
-- -   Extending 'Vulkan.Core10.Enums.Format.Format':
--
--     -   'Vulkan.Core10.Enums.Format.FORMAT_R8_BOOL_ARM'
--
-- -   Extending
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlagBits2':
--
--     -   'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_TENSOR_IMAGE_ALIASING_BIT_ARM'
--
--     -   'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_TENSOR_SHADER_BIT_ARM'
--
-- -   Extending 'Vulkan.Core10.Enums.ImageLayout.ImageLayout':
--
--     -   'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TENSOR_ALIASING_ARM'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TENSOR_ALIASING_BIT_ARM'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_TENSOR_ARM'
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_TENSOR_VIEW_ARM'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_TENSOR_MEMORY_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_TENSOR_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_TENSOR_MEMORY_REQUIREMENTS_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXTERNAL_MEMORY_TENSOR_CREATE_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_EXTERNAL_TENSOR_PROPERTIES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_TENSOR_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_TENSOR_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_FEATURES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_TENSOR_PROPERTIES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_COPY_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_CREATE_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_DEPENDENCY_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_DESCRIPTION_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_FORMAT_PROPERTIES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_MEMORY_BARRIER_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_MEMORY_REQUIREMENTS_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_VIEW_CREATE_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_TENSOR_ARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_GET_TENSOR_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_FEATURES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_TENSOR_PROPERTIES_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_CAPTURE_DESCRIPTOR_DATA_INFO_ARM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_ARM'
--
-- -   Extending 'TensorCreateFlagBitsARM':
--
--     -   'TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM'
--
-- -   Extending 'TensorViewCreateFlagBitsARM':
--
--     -   'TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_frame_boundary VK_EXT_frame_boundary>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_shader_float8 VK_EXT_shader_float8>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.Format.Format':
--
--     -   'Vulkan.Core10.Enums.Format.FORMAT_R8_SFLOAT_FPENCODING_FLOAT8E4M3_ARM'
--
--     -   'Vulkan.Core10.Enums.Format.FORMAT_R8_SFLOAT_FPENCODING_FLOAT8E5M2_ARM'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_shader_bfloat16 VK_KHR_shader_bfloat16>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.Format.Format':
--
--     -   'Vulkan.Core10.Enums.Format.FORMAT_R16_SFLOAT_FPENCODING_BFLOAT16_ARM'
--
-- == New SPIR-V Capabilities
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-TensorsARM TensorsARM>
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-StorageTensorArrayDynamicIndexingARM StorageTensorArrayDynamicIndexingARM>
--
-- -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#spirvenv-capabilities-table-StorageTensorArrayNonUniformIndexingARM StorageTensorArrayNonUniformIndexingARM>
--
-- == Issues
--
-- 1) Should tensor strides be passed in elements or in bytes?
--
-- __RESOLVED__: Strides are passed in bytes but are required to be a
-- multiple of the tensor element size. Passing strides in bytes makes it
-- possible to relax this requirement in the future without an interface
-- change. It also makes it easier to describe memory alignment
-- requirements.
--
-- 2) Should there be commands to copy data between tensors and
-- buffers\/images?
--
-- __RESOLVED__: Adding these commands would result in a rather large API
-- surface and not insignificant implementation and validation cost. The
-- same outcome can be achieved with memory aliasing and tensor to tensor
-- copy operations.
--
-- 3) Should this extension define transpose and\/or other data
-- reorganization operations?
--
-- __RESOLVED__: These operations are useful to expose but this extension
-- is only meant to add base support for tensors. Additional operations
-- should be layered on top and defined in other extensions.
--
-- 4) Why are tensor strides described using signed integers?
--
-- __RESOLVED__: Negative strides make it possible to describe different
-- linear data layouts. While this extension does not allow negative
-- strides, it uses signed integers for strides to make it possible to
-- relax this limitation in future extensions.
--
-- == Version History
--
-- -   Revision 2, 2026-01-07 (Kévin Petit)
--
--     -   Add interactions with VK_KHR_unified_image_layouts,
--         VK_KHR_shader_bfloat16, and VK_EXT_shader_float8
--
-- -   Revision 1, 2025-06-03 (Kévin Petit)
--
--     -   Initial revision
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_ARM_tensors Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
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

-- | vkCreateTensorARM - Create a new tensor object
--
-- == Valid Usage
--
-- -   #VUID-vkCreateTensorARM-tensors-09832# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-tensors tensors>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateTensorARM-device-parameter# @device@ /must/ be a valid
--     'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateTensorARM-pCreateInfo-parameter# @pCreateInfo@ /must/
--     be a valid pointer to a valid 'TensorCreateInfoARM' structure
--
-- -   #VUID-vkCreateTensorARM-pAllocator-parameter# If @pAllocator@ is not
--     @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateTensorARM-pTensor-parameter# @pTensor@ /must/ be a
--     valid pointer to a 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-vkCreateTensorARM-device-queuecount# The device /must/ have
--     been created with at least @1@ queue
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.TensorARM',
-- 'TensorCreateInfoARM'
createTensorARM :: forall a io
                 . (Extendss TensorCreateInfoARM a, PokeChain a, MonadIO io)
                => -- | @device@ is the logical device that creates the tensor.
                   Device
                -> -- | @pCreateInfo@ is a pointer to a 'TensorCreateInfoARM' structure
                   -- containing parameters to be used to create the tensor.
                   (TensorCreateInfoARM a)
                -> -- | @pAllocator@ controls host memory allocation as described in the
                   -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                   -- chapter.
                   ("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)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createTensorARM' and 'destroyTensorARM'
--
-- To ensure that 'destroyTensorARM' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
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 ()

-- | vkDestroyTensorARM - Destroy a tensor object
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyTensorARM-tensor-09730# All submitted commands that
--     refer to @tensor@, either directly or via a
--     'Vulkan.Extensions.Handles.TensorViewARM', /must/ have completed
--     execution
--
-- -   #VUID-vkDestroyTensorARM-tensor-09731# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @tensor@ was created, a compatible set of callbacks
--     /must/ be provided here
--
-- -   #VUID-vkDestroyTensorARM-tensor-09732# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @tensor@ was created, @pAllocator@ /must/ be @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyTensorARM-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyTensorARM-tensor-parameter# If @tensor@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @tensor@ /must/ be a valid
--     'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-vkDestroyTensorARM-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyTensorARM-tensor-parent# If @tensor@ is a valid
--     handle, it /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Host Synchronization
--
-- -   Host access to @tensor@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.TensorARM'
destroyTensorARM :: forall io
                  . (MonadIO io)
                 => -- | @device@ is the logical device that destroys the tensor.
                    Device
                 -> -- | @tensor@ is the tensor to destroy.
                    TensorARM
                 -> -- | @pAllocator@ controls host memory allocation as described in the
                    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                    -- chapter.
                    ("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

-- | vkCreateTensorViewARM - Create an tensor view from an existing tensor
--
-- = Description
--
-- Some of the tensor creation parameters are inherited by the view. In
-- particular, other than format, the tensor view creation inherits all
-- other parameters from the tensor.
--
-- The remaining parameters are contained in @pCreateInfo@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateTensorViewARM-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateTensorViewARM-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'TensorViewCreateInfoARM'
--     structure
--
-- -   #VUID-vkCreateTensorViewARM-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateTensorViewARM-pView-parameter# @pView@ /must/ be a
--     valid pointer to a 'Vulkan.Extensions.Handles.TensorViewARM' handle
--
-- -   #VUID-vkCreateTensorViewARM-device-queuecount# The device /must/
--     have been created with at least @1@ queue
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.TensorViewARM', 'TensorViewCreateInfoARM'
createTensorViewARM :: forall a io
                     . ( Extendss TensorViewCreateInfoARM a
                       , PokeChain a
                       , MonadIO io )
                    => -- | @device@ is the logical device that creates the tensor view.
                       Device
                    -> -- | @pCreateInfo@ is a pointer to an instance of the
                       -- 'TensorViewCreateInfoARM' structure containing parameters to be used to
                       -- create the tensor view.
                       (TensorViewCreateInfoARM a)
                    -> -- | @pAllocator@ controls host memory allocation as described in the
                       -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                       -- chapter.
                       ("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)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createTensorViewARM' and 'destroyTensorViewARM'
--
-- To ensure that 'destroyTensorViewARM' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
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 ()

-- | vkDestroyTensorViewARM - Destroy a tensor view object
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyTensorViewARM-tensorView-09750# All submitted
--     commands that refer to @tensorView@ /must/ have completed execution
--
-- -   #VUID-vkDestroyTensorViewARM-tensorView-09751# If
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @tensorView@ was created, a compatible set of
--     callbacks /must/ be provided here
--
-- -   #VUID-vkDestroyTensorViewARM-tensorView-09752# If no
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' were
--     provided when @tensorView@ was created, @pAllocator@ /must/ be
--     @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyTensorViewARM-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyTensorViewARM-tensorView-parameter# If @tensorView@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE', @tensorView@ /must/
--     be a valid 'Vulkan.Extensions.Handles.TensorViewARM' handle
--
-- -   #VUID-vkDestroyTensorViewARM-pAllocator-parameter# If @pAllocator@
--     is not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyTensorViewARM-tensorView-parent# If @tensorView@ is a
--     valid handle, it /must/ have been created, allocated, or retrieved
--     from @device@
--
-- == Host Synchronization
--
-- -   Host access to @tensorView@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.Handles.TensorViewARM'
destroyTensorViewARM :: forall io
                      . (MonadIO io)
                     => -- | @device@ is the logical device that destroys the tensor view.
                        Device
                     -> -- | @tensorView@ is the tensor view to destroy.
                        TensorViewARM
                     -> -- | @pAllocator@ controls host memory allocation as described in the
                        -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                        -- chapter.
                        ("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 ()

-- | vkGetTensorMemoryRequirementsARM - Returns the memory requirements for
-- specified Vulkan object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2',
-- 'TensorMemoryRequirementsInfoARM'
getTensorMemoryRequirementsARM :: forall a io
                                . ( Extendss MemoryRequirements2 a
                                  , PokeChain a
                                  , PeekChain a
                                  , MonadIO io )
                               => -- | @device@ is the logical device that owns the tensor.
                                  --
                                  -- #VUID-vkGetTensorMemoryRequirementsARM-device-parameter# @device@ /must/
                                  -- be a valid 'Vulkan.Core10.Handles.Device' handle
                                  Device
                               -> -- | @pInfo@ is a pointer to a 'TensorMemoryRequirementsInfoARM' structure
                                  -- containing parameters required for the memory requirements query.
                                  --
                                  -- #VUID-vkGetTensorMemoryRequirementsARM-pInfo-parameter# @pInfo@ /must/
                                  -- be a valid pointer to a valid 'TensorMemoryRequirementsInfoARM'
                                  -- structure
                                  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

-- | vkBindTensorMemoryARM - Bind device memory to tensor objects
--
-- = Description
--
-- On some implementations, it /may/ be more efficient to batch memory
-- bindings into a single command.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'BindTensorMemoryInfoARM', 'Vulkan.Core10.Handles.Device'
bindTensorMemoryARM :: forall io
                     . (MonadIO io)
                    => -- | @device@ is the logical device that owns the buffers and memory.
                       --
                       -- #VUID-vkBindTensorMemoryARM-device-parameter# @device@ /must/ be a valid
                       -- 'Vulkan.Core10.Handles.Device' handle
                       Device
                    -> -- | @pBindInfos@ is a pointer to an array of structures of type
                       -- 'BindTensorMemoryInfoARM', describing tensors and memory to bind.
                       --
                       -- #VUID-vkBindTensorMemoryARM-pBindInfos-parameter# @pBindInfos@ /must/ be
                       -- a valid pointer to an array of @bindInfoCount@ valid
                       -- 'BindTensorMemoryInfoARM' structures
                       ("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 ()

-- | vkGetDeviceTensorMemoryRequirementsARM - Returns the memory requirements
-- for specified tensor creation infos
--
-- == Valid Usage
--
-- -   #VUID-vkGetDeviceTensorMemoryRequirementsARM-tensors-09831# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-tensors tensors>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetDeviceTensorMemoryRequirementsARM-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetDeviceTensorMemoryRequirementsARM-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'DeviceTensorMemoryRequirementsARM' structure
--
-- -   #VUID-vkGetDeviceTensorMemoryRequirementsARM-pMemoryRequirements-parameter#
--     @pMemoryRequirements@ /must/ be a valid pointer to a
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
--     structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceTensorMemoryRequirementsARM',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2'
getDeviceTensorMemoryRequirementsARM :: forall a io
                                      . ( Extendss MemoryRequirements2 a
                                        , PokeChain a
                                        , PeekChain a
                                        , MonadIO io )
                                     => -- | @device@ is the logical device intended to own the tensor.
                                        Device
                                     -> -- | @pInfo@ is a pointer to a 'DeviceTensorMemoryRequirementsARM' structure
                                        -- containing parameters required for the memory requirements query.
                                        ("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 ()

-- | vkCmdCopyTensorARM - Copy data between tensors
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyTensorARM-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyTensorARM-pCopyTensorInfo-parameter#
--     @pCopyTensorInfo@ /must/ be a valid pointer to a valid
--     'CopyTensorInfoARM' structure
--
-- -   #VUID-vkCmdCopyTensorARM-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdCopyTensorARM-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT',
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_TRANSFER_BIT' operations
--
-- -   #VUID-vkCmdCopyTensorARM-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- -   #VUID-vkCmdCopyTensorARM-suspended# This command /must/ not be
--     called between suspended render pass instances
--
-- -   #VUID-vkCmdCopyTensorARM-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             | VK_QUEUE_TRANSFER_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdCopyTensorARM is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyTensorInfoARM'
cmdCopyTensorARM :: forall io
                  . (MonadIO io)
                 => -- | @commandBuffer@ is the command buffer into which the command will be
                    -- recorded.
                    CommandBuffer
                 -> -- | @pCopyTensorInfo@ is a pointer to 'CopyTensorInfoARM' structure
                    -- describing the copy parameters.
                    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

-- | vkGetTensorOpaqueCaptureDescriptorDataARM - Get tensor opaque capture
-- descriptor data
--
-- == Valid Usage
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-descriptorBufferCaptureReplay-09702#
--     The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-descriptorBuffer descriptorBufferCaptureReplay>
--     and
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-descriptorBufferTensorDescriptors descriptorBufferTensorDescriptors>
--     features /must/ be enabled
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-pData-09703# @pData@
--     /must/ point to a buffer that is at least
--     'PhysicalDeviceDescriptorBufferTensorPropertiesARM'::@tensorCaptureReplayDescriptorDataSize@
--     bytes in size
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-device-09704# If
--     @device@ was created with multiple physical devices, then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'TensorCaptureDescriptorDataInfoARM' structure
--
-- -   #VUID-vkGetTensorOpaqueCaptureDescriptorDataARM-pData-parameter#
--     @pData@ /must/ be a pointer value
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Handles.Device', 'TensorCaptureDescriptorDataInfoARM'
getTensorOpaqueCaptureDescriptorDataARM :: forall io
                                         . (MonadIO io)
                                        => -- | @device@ is the logical device that gets the data.
                                           Device
                                        -> -- | @pInfo@ is a pointer to a 'TensorCaptureDescriptorDataInfoARM' structure
                                           -- specifying the tensor.
                                           TensorCaptureDescriptorDataInfoARM
                                        -> -- | @pData@ is a pointer to a user-allocated buffer where the data will be
                                           -- written.
                                           ("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

-- | vkGetTensorViewOpaqueCaptureDescriptorDataARM - Get tensor view opaque
-- capture descriptor data
--
-- == Valid Usage
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-descriptorBufferCaptureReplay-09706#
--     The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-descriptorBuffer descriptorBufferCaptureReplay>
--     and
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-descriptorBufferTensorDescriptors descriptorBufferTensorDescriptors>
--     features /must/ be enabled
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-pData-09707#
--     @pData@ /must/ point to a buffer that is at least
--     'PhysicalDeviceDescriptorBufferTensorPropertiesARM'::@tensorViewCaptureReplayDescriptorDataSize@
--     bytes in size
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-device-09708# If
--     @device@ was created with multiple physical devices, then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-bufferDeviceAddressMultiDevice bufferDeviceAddressMultiDevice>
--     feature /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-pInfo-parameter#
--     @pInfo@ /must/ be a valid pointer to a valid
--     'TensorViewCaptureDescriptorDataInfoARM' structure
--
-- -   #VUID-vkGetTensorViewOpaqueCaptureDescriptorDataARM-pData-parameter#
--     @pData@ /must/ be a pointer value
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Handles.Device', 'TensorViewCaptureDescriptorDataInfoARM'
getTensorViewOpaqueCaptureDescriptorDataARM :: forall io
                                             . (MonadIO io)
                                            => -- | @device@ is the logical device that gets the data.
                                               Device
                                            -> -- | @pInfo@ is a pointer to a 'TensorViewCaptureDescriptorDataInfoARM'
                                               -- structure specifying the tensor view.
                                               TensorViewCaptureDescriptorDataInfoARM
                                            -> -- | @pData@ is a pointer to a user-allocated buffer where the data will be
                                               -- written.
                                               ("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 ()

-- | vkGetPhysicalDeviceExternalTensorPropertiesARM - Function for querying
-- external tensor handle capabilities.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'ExternalTensorPropertiesARM', 'Vulkan.Core10.Handles.PhysicalDevice',
-- 'PhysicalDeviceExternalTensorInfoARM'
getPhysicalDeviceExternalTensorPropertiesARM :: forall io
                                              . (MonadIO io)
                                             => -- | @physicalDevice@ is the physical device from which to query the tensor
                                                -- capabilities.
                                                --
                                                -- #VUID-vkGetPhysicalDeviceExternalTensorPropertiesARM-physicalDevice-parameter#
                                                -- @physicalDevice@ /must/ be a valid
                                                -- 'Vulkan.Core10.Handles.PhysicalDevice' handle
                                                PhysicalDevice
                                             -> -- | @pExternalTensorInfo@ is a pointer to a
                                                -- 'PhysicalDeviceExternalTensorInfoARM' structure describing the
                                                -- parameters that would be consumed by 'createTensorARM'.
                                                --
                                                -- #VUID-vkGetPhysicalDeviceExternalTensorPropertiesARM-pExternalTensorInfo-parameter#
                                                -- @pExternalTensorInfo@ /must/ be a valid pointer to a valid
                                                -- 'PhysicalDeviceExternalTensorInfoARM' structure
                                                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)


-- | VkTensorDescriptionARM - Structure describing a tensor
--
-- = Description
--
-- When describing a tensor created with 'TENSOR_TILING_OPTIMAL_ARM',
-- @pStrides@ must be equal to @NULL@. When describing a tensor created
-- with 'TENSOR_TILING_LINEAR_ARM', @pStrides@ is either an array of size
-- @dimensionCount@ or @NULL@.
--
-- The formats that /must/ be supported for @format@ are documented in
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-formats-mandatory-features-tensor>.
--
-- Each element in the @pStrides@ array describes the offset in bytes
-- between increments of the given dimension. For example, @pStrides@[0]
-- describes the offset between element [x0,x1,x2,x3] and element
-- [x0+1,x1,x2,x3]. The @pStrides@ array /can/ be used to determine whether
-- a tensor is /packed/ or not. If @pStrides@[@dimensionCount@-1] is equal
-- to the size of a tensor element and for each dimension @n@ greater than
-- 0 and less than @dimensionCount@, @pStrides@[n-1] is equal to
-- @pStrides@[n] * @pDimensions@[n], then the tensor is a packed tensor. If
-- the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-tensorNonPacked tensorNonPacked>
-- feature is not enabled, the tensor /must/ be a packed tensor.
--
-- When a tensor is created with 'TENSOR_TILING_LINEAR_ARM' and @pStrides@
-- equal to @NULL@ the tensor strides are calculated by the vulkan
-- implementation such that the resulting tensor is a packed tensor.
--
-- Expressed as an addressing formula, the starting byte of an element in a
-- 4-dimensional, for example, linear tensor has address:
--
-- > // Assume (x0,x1,x2,x3) are in units of elements.
-- >
-- > address(x0,x1,x2,x3) = x0*pStrides[0] + x1*pStrides[1] + x2*pStrides[2] + x3*pStrides[3]
--
-- == Valid Usage
--
-- -   #VUID-VkTensorDescriptionARM-dimensionCount-09733# @dimensionCount@
--     /must/ be less than or equal to
--     'PhysicalDeviceTensorPropertiesARM'::@maxTensorDimensionCount@
--
-- -   #VUID-VkTensorDescriptionARM-pDimensions-09734# For each i where i ≤
--     dimensionCount-1, @pDimensions@[i] /must/ be greater than @0@
--
-- -   #VUID-VkTensorDescriptionARM-pDimensions-09883# For each i where i ≤
--     dimensionCount-1, @pDimensions@[i] /must/ be less than or equal to
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-maxPerDimensionTensorElements ::maxPerDimensionTensorElements>
--
-- -   #VUID-VkTensorDescriptionARM-format-09735# @format@ /must/ not be
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED' and /must/ be a
--     one-component 'Vulkan.Core10.Enums.Format.Format'
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-09736#
--     @pStrides@[@dimensionCount@-1] /must/ equal the size in bytes of a
--     tensor element
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-09737# For each i,
--     @pStrides@[i] /must/ be a multiple of the element size
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-09738# For each i,
--     @pStrides@[i] /must/ be greater than @0@ and less than or equal to
--     'PhysicalDeviceTensorPropertiesARM'::@maxTensorStride@
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-09884# @pStrides@[0] ×
--     @pDimensions@[0] /must/ be less than or equal to
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-maxTensorSize ::maxTensorSize>
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-09739# For each i greater than
--     0, @pStrides@[i-1] /must/ be greater than or equal to @pStrides@[i]
--     × @pDimensions@[i] so that no two elements of the tensor reference
--     the same memory address
--
-- -   #VUID-VkTensorDescriptionARM-None-09740# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-tensorNonPacked tensorNonPacked>
--     feature is not enabled, then the members of 'TensorDescriptionARM'
--     /must/ describe a packed tensor
--
-- -   #VUID-VkTensorDescriptionARM-tiling-09741# If @tiling@ is
--     'TENSOR_TILING_OPTIMAL_ARM' and @usage@ is
--     'TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM' then the size of the tensor
--     along its innermost dimension, i.e. @pDimensions@[@dimensionCount@ -
--     1], /must/ be less than or equal to @4@
--
-- -   #VUID-VkTensorDescriptionARM-tiling-09742# If @tiling@ is
--     'TENSOR_TILING_LINEAR_ARM' then
--     'TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM' /must/ not be set in @usage@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorDescriptionARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_DESCRIPTION_ARM'
--
-- -   #VUID-VkTensorDescriptionARM-tiling-parameter# @tiling@ /must/ be a
--     valid 'TensorTilingARM' value
--
-- -   #VUID-VkTensorDescriptionARM-format-parameter# @format@ /must/ be a
--     valid 'Vulkan.Core10.Enums.Format.Format' value
--
-- -   #VUID-VkTensorDescriptionARM-pDimensions-parameter# @pDimensions@
--     /must/ be a valid pointer to an array of @dimensionCount@ @int64_t@
--     values
--
-- -   #VUID-VkTensorDescriptionARM-pStrides-parameter# If @pStrides@ is
--     not @NULL@, @pStrides@ /must/ be a valid pointer to an array of
--     @dimensionCount@ @int64_t@ values
--
-- -   #VUID-VkTensorDescriptionARM-usage-parameter# @usage@ /must/ be a
--     valid combination of 'TensorUsageFlagBitsARM' values
--
-- -   #VUID-VkTensorDescriptionARM-usage-requiredbitmask# @usage@ /must/
--     not be @0@
--
-- -   #VUID-VkTensorDescriptionARM-dimensionCount-arraylength#
--     @dimensionCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'PhysicalDeviceExternalTensorInfoARM',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'TensorCreateInfoARM', 'TensorTilingARM', 'TensorUsageFlagsARM'
data TensorDescriptionARM = TensorDescriptionARM
  { -- | @tiling@ is a 'TensorTilingARM' value specifying the tiling of the
    -- tensor
    TensorDescriptionARM -> TensorTilingARM
tiling :: TensorTilingARM
  , -- | @format@ is a one component 'Vulkan.Core10.Enums.Format.Format'
    -- describing the format and type of the data elements that will be
    -- contained in the tensor.
    TensorDescriptionARM -> Format
format :: Format
  , -- | @pDimensions@ is a pointer to an array of integers of size
    -- @dimensionCount@ providing the number of data elements in each
    -- dimension.
    TensorDescriptionARM -> Vector Int64
dimensions :: Vector Int64
  , -- | @pStrides@ is either @NULL@ or is an array of size @dimensionCount@
    -- providing the strides in bytes for the tensor in each dimension.
    TensorDescriptionARM -> Vector Int64
strides :: Vector Int64
  , -- | @usage@ is a bitmask of 'TensorUsageFlagBitsARM' specifying the usage of
    -- the tensor.
    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


-- No documentation found for TopLevel "VkTensorCreateInfoARM"
data TensorCreateInfoARM (es :: [Type]) = TensorCreateInfoARM
  { -- No documentation found for Nested "VkTensorCreateInfoARM" "pNext"
    forall (es :: [*]). TensorCreateInfoARM es -> Chain es
next :: Chain es
  , -- No documentation found for Nested "VkTensorCreateInfoARM" "flags"
    forall (es :: [*]). TensorCreateInfoARM es -> TensorCreateFlagsARM
flags :: TensorCreateFlagsARM
  , -- No documentation found for Nested "VkTensorCreateInfoARM" "pDescription"
    forall (es :: [*]). TensorCreateInfoARM es -> TensorDescriptionARM
description :: TensorDescriptionARM
  , -- No documentation found for Nested "VkTensorCreateInfoARM" "sharingMode"
    forall (es :: [*]). TensorCreateInfoARM es -> SharingMode
sharingMode :: SharingMode
  , -- No documentation found for Nested "VkTensorCreateInfoARM" "pQueueFamilyIndices"
    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


-- | VkTensorViewCreateInfoARM - Structure specifying parameters of a newly
-- created tensor view
--
-- = Description
--
-- If @tensor@ was created with the 'TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM'
-- flag, @format@ /can/ be different from the tensor’s format, but if they
-- are not equal they /must/ be /compatible/. Tensor format compatibility
-- is defined in the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-compatibility-classes Format Compatibility Classes>
-- section. Views of compatible formats will have the same mapping between
-- element locations irrespective of the @format@, with only the
-- interpretation of the bit pattern changing.
--
-- Values intended to be used with one view format /may/ not be exactly
-- preserved when written or read through a different format. For example,
-- an integer value that happens to have the bit pattern of a
-- floating-point denorm or NaN /may/ be flushed or canonicalized when
-- written or read through a view with a floating-point format. Similarly,
-- a value written through a signed normalized format that has a bit
-- pattern exactly equal to -2b /may/ be changed to -2b + 1 as described in
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fundamentals-fixedfpconv Conversion from Normalized Fixed-Point to Floating-Point>.
--
-- == Valid Usage
--
-- -   #VUID-VkTensorViewCreateInfoARM-tensor-09743# If @tensor@ was not
--     created with 'TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM' flag, @format@
--     /must/ be identical to the @format@ used to create @tensor@
--
-- -   #VUID-VkTensorViewCreateInfoARM-tensor-09744# If @tensor@ was
--     created with 'TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM' flag, @format@
--     /must/ be compatible with the @format@ used to create @tensor@, as
--     defined in
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-compatibility-classes Format Compatibility Classes>
--
-- -   #VUID-VkTensorViewCreateInfoARM-flags-09745# If @flags@ includes
--     'TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM', the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-descriptorBufferCaptureReplay descriptorBufferCaptureReplay>
--     feature /must/ be enabled
--
-- -   #VUID-VkTensorViewCreateInfoARM-pNext-09746# If the @pNext@ chain
--     includes a
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
--     structure, @flags@ /must/ contain
--     'TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM'
--
-- -   #VUID-VkTensorViewCreateInfoARM-usage-09747# The @usage@ flags of
--     @tensor@ /must/ have at least one of the following bits set:
--
--     -   'TENSOR_USAGE_SHADER_BIT_ARM'
--
--     -   'TENSOR_USAGE_DATA_GRAPH_BIT_ARM'
--
-- -   #VUID-VkTensorViewCreateInfoARM-usage-09748# The tensor view’s
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-tensor-view-format-features format features>
--     /must/ contain the format feature flags required by the @usage@
--     flags of @tensor@ for @format@ as indicated in the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#format-feature-dependent-usage-flags>
--     section
--
-- -   #VUID-VkTensorViewCreateInfoARM-tensor-09749# If @tensor@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorViewCreateInfoARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_VIEW_CREATE_INFO_ARM'
--
-- -   #VUID-VkTensorViewCreateInfoARM-pNext-pNext# @pNext@ /must/ be
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
--
-- -   #VUID-VkTensorViewCreateInfoARM-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkTensorViewCreateInfoARM-flags-parameter# @flags@ /must/ be a
--     valid combination of 'TensorViewCreateFlagBitsARM' values
--
-- -   #VUID-VkTensorViewCreateInfoARM-tensor-parameter# @tensor@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-VkTensorViewCreateInfoARM-format-parameter# @format@ /must/ be
--     a valid 'Vulkan.Core10.Enums.Format.Format' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_heap VK_EXT_descriptor_heap>,
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Extensions.VK_EXT_descriptor_heap.ResourceDescriptorDataEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM', 'TensorViewCreateFlagsARM',
-- 'createTensorViewARM'
data TensorViewCreateInfoARM (es :: [Type]) = TensorViewCreateInfoARM
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). TensorViewCreateInfoARM es -> Chain es
next :: Chain es
  , -- | @flags@ is reserved for future use.
    forall (es :: [*]).
TensorViewCreateInfoARM es -> TensorViewCreateFlagsARM
flags :: TensorViewCreateFlagsARM
  , -- | @tensor@ is a 'Vulkan.Extensions.Handles.TensorARM' on which the view
    -- will be created.
    forall (es :: [*]). TensorViewCreateInfoARM es -> TensorARM
tensor :: TensorARM
  , -- | @format@ is a 'Vulkan.Core10.Enums.Format.Format' describing the format
    -- and type used to interpret elements in the tensor.
    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


-- | VkTensorMemoryRequirementsInfoARM - Structure specifying memory
-- requirements
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM', 'getTensorMemoryRequirementsARM'
data TensorMemoryRequirementsInfoARM = TensorMemoryRequirementsInfoARM
  { -- | @tensor@ is the tensor to query.
    --
    -- #VUID-VkTensorMemoryRequirementsInfoARM-tensor-parameter# @tensor@
    -- /must/ be a valid 'Vulkan.Extensions.Handles.TensorARM' handle
    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


-- | VkBindTensorMemoryInfoARM - Structure specifying how to bind a tensor to
-- memory
--
-- == Valid Usage
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09712# @tensor@ /must/ not
--     already be backed by a memory object
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memoryOffset-09713# @memoryOffset@
--     /must/ be less than the size of @memory@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-09714# @memory@ /must/ have
--     been allocated using one of the memory types allowed in the
--     @memoryTypeBits@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to 'getTensorMemoryRequirementsARM' with
--     @tensor@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memoryOffset-09715# @memoryOffset@
--     /must/ be an integer multiple of the @alignment@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to 'getTensorMemoryRequirementsARM' with
--     @tensor@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-size-09716# The @size@ member of the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements' structure
--     returned from a call to 'getTensorMemoryRequirementsARM' with
--     @tensor@ /must/ be less than or equal to the size of @memory@ minus
--     @memoryOffset@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09717# If @tensor@ requires a
--     dedicated allocation (as reported by
--     'getTensorMemoryRequirementsARM' in
--     'Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedRequirements'::@requiresDedicatedAllocation@
--     for @tensor@), @memory@ /must/ have been created with
--     'MemoryDedicatedAllocateInfoTensorARM'::@tensor@ equal to @tensor@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-09806# If the
--     'Vulkan.Core10.Memory.MemoryAllocateInfo' provided when @memory@ was
--     allocated included a 'MemoryDedicatedAllocateInfoTensorARM'
--     structure in its @pNext@ chain, and
--     'MemoryDedicatedAllocateInfoTensorARM'::@tensor@ was not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', then @tensor@ /must/ equal
--     'MemoryDedicatedAllocateInfoTensorARM'::@tensor@, and @memoryOffset@
--     /must/ be zero
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-09895# If the value of
--     'Vulkan.Core11.Promoted_From_VK_KHR_external_memory.ExportMemoryAllocateInfo'::@handleTypes@
--     used to allocate @memory@ is not @0@, it /must/ include at least one
--     of the handles set in
--     'ExternalMemoryTensorCreateInfoARM'::@handleTypes@ when @tensor@ was
--     created
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-09896# If @memory@ was
--     allocated by a memory import operation, that is not
--     'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ImportAndroidHardwareBufferInfoANDROID'
--     with a non-@NULL@ @buffer@ value, the external handle type of the
--     imported memory /must/ also have been set in
--     'ExternalMemoryTensorCreateInfoARM'::@handleTypes@ when @tensor@ was
--     created
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-09897# If @memory@ was
--     allocated with the
--     'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ImportAndroidHardwareBufferInfoANDROID'
--     memory import operation with a non-@NULL@ @buffer@ value,
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID'
--     /must/ also have been set in
--     'ExternalMemoryTensorCreateInfoARM'::@handleTypes@ when @tensor@ was
--     created
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09718# If @tensor@ was
--     created with the 'TENSOR_CREATE_PROTECTED_BIT_ARM' bit set, the
--     tensor /must/ be bound to a memory object allocated with a memory
--     type that reports
--     'Vulkan.Core10.Enums.MemoryPropertyFlagBits.MEMORY_PROPERTY_PROTECTED_BIT'
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09719# If @tensor@ was
--     created with the 'TENSOR_CREATE_PROTECTED_BIT_ARM' bit not set, the
--     tensor /must/ not be bound to a memory object allocated with a
--     memory type that reports
--     'Vulkan.Core10.Enums.MemoryPropertyFlagBits.MEMORY_PROPERTY_PROTECTED_BIT'
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09943# If @tensor@ was
--     created with the
--     'TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM' bit set,
--     @memory@ /must/ have been allocated with the
--     'Vulkan.Core11.Enums.MemoryAllocateFlagBits.MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT'
--     bit set
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-09944# If @tensor@ was
--     created with the
--     'TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM' bit set,
--     @memory@ /must/ have been allocated with the
--     'Vulkan.Core11.Enums.MemoryAllocateFlagBits.MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT'
--     bit set
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-11406# If @tensor@ was
--     created with the
--     'TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM' bit set,
--     @memory@ /must/ have been allocated with the
--     'Vulkan.Core11.Enums.MemoryAllocateFlagBits.MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT'
--     bit set
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-11407# If @tensor@ was
--     created with the
--     'TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM' bit set,
--     @memory@ /must/ have been allocated with the
--     'Vulkan.Core11.Enums.MemoryAllocateFlagBits.MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT'
--     bit set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBindTensorMemoryInfoARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BIND_TENSOR_MEMORY_INFO_ARM'
--
-- -   #VUID-VkBindTensorMemoryInfoARM-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkBindTensorMemoryInfoARM-tensor-parameter# @tensor@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-VkBindTensorMemoryInfoARM-memory-parameter# @memory@ /must/ be
--     a valid 'Vulkan.Core10.Handles.DeviceMemory' handle
--
-- -   #VUID-VkBindTensorMemoryInfoARM-commonparent# Both of @memory@, and
--     @tensor@ /must/ have been created, allocated, or retrieved from the
--     same 'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @tensor@ /must/ be externally synchronized
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Handles.DeviceMemory',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM', 'bindTensorMemoryARM'
data BindTensorMemoryInfoARM = BindTensorMemoryInfoARM
  { -- | @tensor@ is the tensor to be attached to memory.
    BindTensorMemoryInfoARM -> TensorARM
tensor :: TensorARM
  , -- | @memory@ is a 'Vulkan.Core10.Handles.DeviceMemory' object describing the
    -- device memory to attach.
    BindTensorMemoryInfoARM -> DeviceMemory
memory :: DeviceMemory
  , -- | @memoryOffset@ is the start offset of the region of @memory@ which is to
    -- be bound to the tensor. The number of bytes returned in the
    -- 'Vulkan.Core10.MemoryManagement.MemoryRequirements'::@size@ member in
    -- @memory@, starting from @memoryOffset@ bytes, will be bound to the
    -- specified tensor.
    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


-- | VkWriteDescriptorSetTensorARM - Structure specifying descriptor tensor
-- info
--
-- == Valid Usage
--
-- -   #VUID-VkWriteDescriptorSetTensorARM-nullDescriptor-09898# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     feature is not enabled, each element of @pTensorViews@ /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkWriteDescriptorSetTensorARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_TENSOR_ARM'
--
-- -   #VUID-VkWriteDescriptorSetTensorARM-pTensorViews-parameter#
--     @pTensorViews@ /must/ be a valid pointer to an array of
--     @tensorViewCount@ valid or 'Vulkan.Core10.APIConstants.NULL_HANDLE'
--     'Vulkan.Extensions.Handles.TensorViewARM' handles
--
-- -   #VUID-VkWriteDescriptorSetTensorARM-tensorViewCount-arraylength#
--     @tensorViewCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorViewARM'
data WriteDescriptorSetTensorARM = WriteDescriptorSetTensorARM
  { -- | @pTensorViews@ are the tensor views that will be used to update the
    -- descriptor set.
    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


-- | VkTensorFormatPropertiesARM - Structure specifying properties of a
-- format used to describe tensor elements
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlags2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data TensorFormatPropertiesARM = TensorFormatPropertiesARM
  { -- | @optimalTilingTensorFeatures@ is a bitmask of
    -- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlagBits2'
    -- specifying features supported by tensors created with a @tiling@
    -- parameter of 'TENSOR_TILING_OPTIMAL_ARM'.
    TensorFormatPropertiesARM -> FormatFeatureFlags2
optimalTilingTensorFeatures :: FormatFeatureFlags2
  , -- | @linearTilingTensorFeatures@ is a bitmask of
    -- 'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlagBits2'
    -- specifying features supported by tensors created with a @tiling@
    -- parameter of 'TENSOR_TILING_LINEAR_ARM'.
    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


-- | VkPhysicalDeviceTensorPropertiesARM - Structure describing the tensor
-- properties of a physical device
--
-- = Description
--
-- If the 'PhysicalDeviceTensorPropertiesARM' structure is included in the
-- @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceTensorPropertiesARM = PhysicalDeviceTensorPropertiesARM
  { -- | #limits-maxTensorDimensionCount# @maxTensorDimensionCount@ is the
    -- maximum number of dimensions that can be specified in the
    -- @dimensionCount@ member of 'TensorDescriptionARM'.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorDimensionCount :: Word32
  , -- | #limits-maxTensorElements# @maxTensorElements@ is the maximum number of
    -- data elements in a created tensor as specified in the
    -- 'TensorDescriptionARM' of 'TensorCreateInfoARM'. The number of data
    -- elements in a tensor is computed as the product of @pDimensions@[i] for
    -- all 0 ≤ i ≤ dimensionCount-1.
    PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorElements :: Word64
  , -- | #limits-maxPerDimensionTensorElements# @maxPerDimensionTensorElements@
    -- is the maximum number of data elements alongside any dimension of a
    -- tensor.
    PhysicalDeviceTensorPropertiesARM -> Word64
maxPerDimensionTensorElements :: Word64
  , -- | #limits-maxTensorStride# @maxTensorStride@ is the maximum value for a
    -- tensor stride that can be used in 'TensorDescriptionARM'::@pStrides@.
    PhysicalDeviceTensorPropertiesARM -> Int64
maxTensorStride :: Int64
  , -- | #limits-maxTensorSize# @maxTensorSize@ is the maximum size, in bytes, of
    -- a tensor.
    PhysicalDeviceTensorPropertiesARM -> Word64
maxTensorSize :: Word64
  , -- | #limits-maxTensorShaderAccessArrayLength#
    -- @maxTensorShaderAccessArrayLength@ is the maximum number of elements in
    -- an array returned by @OpTensoReadARM@ or consumed by @OpTensorWriteARM@.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorShaderAccessArrayLength :: Word32
  , -- | #limits-maxTensorShaderAccessSize# @maxTensorShaderAccessSize@ is the
    -- maximum size in bytes of the data that can be read from a tensor with
    -- @OpTensorReadARM@ or written to a tensor with @OpTensorWriteARM@.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxTensorShaderAccessSize :: Word32
  , -- | #limits-maxDescriptorSetStorageTensors# @maxDescriptorSetStorageTensors@
    -- is the maximum number of tensors that /can/ be included in descriptor
    -- bindings in a pipeline layout across all pipeline shader stages and
    -- descriptor set numbers. Descriptors with a type of
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM' count
    -- against this limit.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetStorageTensors :: Word32
  , -- | #limits-maxPerStageDescriptorSetStorageTensors#
    -- @maxPerStageDescriptorSetStorageTensors@ is the maximum number of
    -- tensors that /can/ be accessible to a single shader stage in a pipeline
    -- layout. Descriptors with a type of
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM' count
    -- against this limit. A descriptor is accessible to a pipeline shader
    -- stage when the @stageFlags@ member of the
    -- 'Vulkan.Core10.DescriptorSet.DescriptorSetLayoutBinding' structure has
    -- the bit for that shader stage set.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorSetStorageTensors :: Word32
  , -- | #limits-maxDescriptorSetUpdateAfterBindStorageTensors#
    -- @maxDescriptorSetUpdateAfterBindStorageTensors@ is similar to
    -- @maxDescriptorSetStorageTensors@ but counts descriptors from descriptor
    -- sets created with or without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxDescriptorSetUpdateAfterBindStorageTensors :: Word32
  , -- | #limits-maxPerStageDescriptorUpdateAfterBindStorageTensors#
    -- @maxPerStageDescriptorUpdateAfterBindStorageTensors@ is similar to
    -- @maxPerStageDescriptorSetStorageTensors@ but counts descriptors from
    -- descriptor sets created with or without the
    -- 'Vulkan.Core10.Enums.DescriptorSetLayoutCreateFlagBits.DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT'
    -- bit set.
    PhysicalDeviceTensorPropertiesARM -> Word32
maxPerStageDescriptorUpdateAfterBindStorageTensors :: Word32
  , -- | #limits-shaderStorageTensorArrayNonUniformIndexingNative#
    -- @shaderStorageTensorArrayNonUniformIndexingNative@ is a boolean value
    -- indicating whether storage tensor descriptors natively support
    -- nonuniform indexing. If this is 'Vulkan.Core10.FundamentalTypes.FALSE',
    -- then a single dynamic instance of an instruction that nonuniformly
    -- indexes an array of storage buffers may execute multiple times in order
    -- to access all the descriptors.
    PhysicalDeviceTensorPropertiesARM -> Bool
shaderStorageTensorArrayNonUniformIndexingNative :: Bool
  , -- | #limits-shaderTensorSupportedStages# @shaderTensorSupportedStages@ is a
    -- bitfield of
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.ShaderStageFlagBits' describing
    -- the shader stages that /can/ access tensor resources.
    -- @shaderTensorSupportedStages@ will have the
    -- 'Vulkan.Core10.Enums.ShaderStageFlagBits.SHADER_STAGE_COMPUTE_BIT' bit
    -- set if any of the physical device’s queues support
    -- 'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT'.
    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


-- | VkTensorMemoryBarrierARM - Structure specifying a tensor memory barrier
--
-- = Description
--
-- The first
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-scopes synchronization scope>
-- and
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-access-scopes access scope>
-- described by this structure include only operations and memory accesses
-- specified by @srcStageMask@ and @srcAccessMask@.
--
-- The second
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-scopes synchronization scope>
-- and
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-access-scopes access scope>
-- described by this structure include only operations and memory accesses
-- specified by @dstStageMask@ and @dstAccessMask@.
--
-- Both
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-access-scopes access scopes>
-- are limited to only memory accesses to @tensor@.
--
-- If @tensor@ was created with
-- 'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_EXCLUSIVE', and
-- @srcQueueFamilyIndex@ is not equal to @dstQueueFamilyIndex@, this memory
-- barrier defines a
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers queue family transfer operation>.
-- When executed on a queue in the family identified by
-- @srcQueueFamilyIndex@, this barrier defines a
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers-release queue family release operation>
-- for the specified tensor, and the second synchronization and access
-- scopes do not synchronize operations on that queue. When executed on a
-- queue in the family identified by @dstQueueFamilyIndex@, this barrier
-- defines a
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers-acquire queue family acquire operation>
-- for the specified tensor, and the first synchronization and access
-- scopes do not synchronize operations on that queue.
--
-- A
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers queue family transfer operation>
-- is also defined if the values are not equal, and either is one of the
-- special queue family values reserved for external memory ownership
-- transfers, as described in
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers>.
-- A
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers-release queue family release operation>
-- is defined when @dstQueueFamilyIndex@ is one of those values, and a
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers-acquire queue family acquire operation>
-- is defined when @srcQueueFamilyIndex@ is one of those values.
--
-- == Valid Usage
--
-- -   #VUID-VkTensorMemoryBarrierARM-tensor-09755# If @tensor@ was created
--     with a sharing mode of
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_CONCURRENT',
--     @srcQueueFamilyIndex@ and @dstQueueFamilyIndex@ /must/ both be
--     'Vulkan.Core10.APIConstants.QUEUE_FAMILY_IGNORED'
--
-- -   #VUID-VkTensorMemoryBarrierARM-tensor-09756# If @tensor@ was created
--     with a sharing mode of
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_EXCLUSIVE',
--     @srcQueueFamilyIndex@ and @dstQueueFamilyIndex@ /must/ both be
--     either 'Vulkan.Core10.APIConstants.QUEUE_FAMILY_IGNORED', or a valid
--     queue family (see
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#devsandqueues-queueprops>)
--
-- -   #VUID-VkTensorMemoryBarrierARM-tensor-09757# If @tensor@ was created
--     with a sharing mode of
--     'Vulkan.Core10.Enums.SharingMode.SHARING_MODE_EXCLUSIVE', and
--     @srcQueueFamilyIndex@ and @dstQueueFamilyIndex@ are not
--     'Vulkan.Core10.APIConstants.QUEUE_FAMILY_IGNORED', at least one of
--     them /must/ be the same as the family of the queue that will execute
--     this barrier
--
-- -   #VUID-VkTensorMemoryBarrierARM-tensor-09758# If @tensor@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorMemoryBarrierARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_MEMORY_BARRIER_ARM'
--
-- -   #VUID-VkTensorMemoryBarrierARM-srcStageMask-parameter#
--     @srcStageMask@ /must/ be a valid combination of
--     'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlagBits2'
--     values
--
-- -   #VUID-VkTensorMemoryBarrierARM-srcAccessMask-parameter#
--     @srcAccessMask@ /must/ be a valid combination of
--     'Vulkan.Core13.Enums.AccessFlags2.AccessFlagBits2' values
--
-- -   #VUID-VkTensorMemoryBarrierARM-dstStageMask-parameter#
--     @dstStageMask@ /must/ be a valid combination of
--     'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlagBits2'
--     values
--
-- -   #VUID-VkTensorMemoryBarrierARM-dstAccessMask-parameter#
--     @dstAccessMask@ /must/ be a valid combination of
--     'Vulkan.Core13.Enums.AccessFlags2.AccessFlagBits2' values
--
-- -   #VUID-VkTensorMemoryBarrierARM-tensor-parameter# @tensor@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core13.Enums.AccessFlags2.AccessFlags2',
-- 'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlags2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM', 'TensorDependencyInfoARM'
data TensorMemoryBarrierARM = TensorMemoryBarrierARM
  { -- | @srcStageMask@ is a
    -- 'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlags2' mask of
    -- pipeline stages to be included in the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-scopes first synchronization scope>.
    TensorMemoryBarrierARM -> PipelineStageFlags2
srcStageMask :: PipelineStageFlags2
  , -- | @srcAccessMask@ is a 'Vulkan.Core13.Enums.AccessFlags2.AccessFlags2'
    -- mask of access flags to be included in the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-access-scopes first access scope>.
    TensorMemoryBarrierARM -> AccessFlags2
srcAccessMask :: AccessFlags2
  , -- | @dstStageMask@ is a
    -- 'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlags2' mask of
    -- pipeline stages to be included in the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-scopes second synchronization scope>.
    TensorMemoryBarrierARM -> PipelineStageFlags2
dstStageMask :: PipelineStageFlags2
  , -- | @dstAccessMask@ is a 'Vulkan.Core13.Enums.AccessFlags2.AccessFlags2'
    -- mask of access flags to be included in the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-dependencies-access-scopes second access scope>.
    TensorMemoryBarrierARM -> AccessFlags2
dstAccessMask :: AccessFlags2
  , -- | @srcQueueFamilyIndex@ is the source queue family for a
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers queue family ownership transfer>.
    TensorMemoryBarrierARM -> Word32
srcQueueFamilyIndex :: Word32
  , -- | @dstQueueFamilyIndex@ is the destination queue family for a
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-queue-transfers queue family ownership transfer>.
    TensorMemoryBarrierARM -> Word32
dstQueueFamilyIndex :: Word32
  , -- | @tensor@ is a handle to the tensor whose backing memory is affected by
    -- the barrier.
    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


-- | VkTensorDependencyInfoARM - Structure specifying tensor dependency
-- information for a synchronization command
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'TensorMemoryBarrierARM'
data TensorDependencyInfoARM = TensorDependencyInfoARM
  { -- | @tensorMemoryBarrierCount@ is the length of the @pTensorMemoryBarriers@
    -- array.
    TensorDependencyInfoARM -> Word32
tensorMemoryBarrierCount :: Word32
  , -- | @pTensorMemoryBarriers@ is a pointer to an array of
    -- 'TensorMemoryBarrierARM' structures defining memory dependencies between
    -- tensors.
    --
    -- #VUID-VkTensorDependencyInfoARM-pTensorMemoryBarriers-parameter#
    -- @pTensorMemoryBarriers@ /must/ be a valid pointer to a valid
    -- 'TensorMemoryBarrierARM' structure
    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


-- | VkPhysicalDeviceTensorFeaturesARM - Structure describing tensor features
-- that can be supported by an implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceTensorFeaturesARM' structure describe
-- the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceTensorFeaturesARM' structure is included in the
-- @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceTensorFeaturesARM', it /must/ add an instance of the
-- structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceTensorFeaturesARM = PhysicalDeviceTensorFeaturesARM
  { -- | #features-tensorNonPacked# @tensorNonPacked@ indicates whether the
    -- implementation supports the creation of tensors that are not packed
    -- tensors.
    PhysicalDeviceTensorFeaturesARM -> Bool
tensorNonPacked :: Bool
  , -- | #features-shaderTensorAccess# @shaderTensorAccess@ indicates whether
    -- shader modules /can/ declare the @TensorsARM@ capability.
    PhysicalDeviceTensorFeaturesARM -> Bool
shaderTensorAccess :: Bool
  , -- No documentation found for Nested "VkPhysicalDeviceTensorFeaturesARM" "shaderStorageTensorArrayDynamicIndexing"
    PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayDynamicIndexing :: Bool
  , -- | #features-shaderStorageTensorArrayNonUniformIndexing#
    -- @shaderStorageTensorArrayNonUniformIndexing@ indicates whether arrays of
    -- storage tensors /can/ be indexed by non-uniform integer expressions in
    -- shader code. If this feature is not enabled, resources with a descriptor
    -- type of 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
    -- /must/ not be indexed by non-uniform integer expressions when aggregated
    -- into arrays in shader code. This also indicates whether shader modules
    -- /can/ declare the @StorageTensorArrayNonUniformIndexingARM@ capability.
    PhysicalDeviceTensorFeaturesARM -> Bool
shaderStorageTensorArrayNonUniformIndexing :: Bool
  , -- | #features-descriptorBindingStorageTensorUpdateAfterBind#
    -- @descriptorBindingStorageTensorUpdateAfterBind@ indicates whether the
    -- implementation supports updating storage tensor descriptors after a set
    -- is bound. If this feature is not enabled,
    -- 'Vulkan.Core12.Enums.DescriptorBindingFlagBits.DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT'
    -- /must/ not be used with
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'.
    PhysicalDeviceTensorFeaturesARM -> Bool
descriptorBindingStorageTensorUpdateAfterBind :: Bool
  , -- | #features-tensors# @tensors@ indicates whether the implementation
    -- supports tensor resources.
    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


-- | VkDeviceTensorMemoryRequirementsARM - (None)
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'TensorCreateInfoARM', 'getDeviceTensorMemoryRequirementsARM'
data DeviceTensorMemoryRequirementsARM = DeviceTensorMemoryRequirementsARM
  { -- | @pCreateInfo@ is a pointer to a 'TensorCreateInfoARM' structure
    -- containing parameters affecting the creation of the tensor to query.
    --
    -- #VUID-VkDeviceTensorMemoryRequirementsARM-pCreateInfo-parameter#
    -- @pCreateInfo@ /must/ be a valid pointer to a valid 'TensorCreateInfoARM'
    -- structure
    ("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)


-- | VkCopyTensorInfoARM - Structure specifying an tensor copy operation
--
-- = Description
--
-- Each region in @pRegions@ describes a region to be copied from the
-- source tensor to a corresponding region of the destination tensor.
-- @srcTensor@ and @dstTensor@ /can/ be the same tensor or alias the same
-- memory.
--
-- The formats of @srcTensor@ and @dstTensor@ /must/ be compatible. Formats
-- are compatible if they share the same class, as shown in the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-compatibility Compatible Formats>
-- table.
--
-- 'cmdCopyTensorARM' allows copying between /size-compatible/ internal
-- formats.
--
-- == Valid Usage
--
-- -   #VUID-VkCopyTensorInfoARM-dimensionCount-09684# @srcTensor@ and
--     @dstTensor@ /must/ have been created with equal values for
--     'TensorDescriptionARM'::@dimensionCount@
--
-- -   #VUID-VkCopyTensorInfoARM-pDimensions-09685# For each of the
--     elements of 'TensorDescriptionARM'::@pDimensions@, @srcTensor@ and
--     @dstTensor@ /must/ be the same size
--
-- -   #VUID-VkCopyTensorInfoARM-regionCount-09686# @regionCount@ must be
--     equal to 1
--
-- -   #VUID-VkCopyTensorInfoARM-pRegions-09687# Each element of @pRegions@
--     /must/ be a 'TensorCopyARM' structure whose @pSrcOffset@ is @NULL@
--     or has all its elements equal to @0@
--
-- -   #VUID-VkCopyTensorInfoARM-pRegions-09688# Each element of @pRegions@
--     /must/ be a 'TensorCopyARM' structure whose @pDstOffset@ is @NULL@
--     or has all its elements equal to @0@
--
-- -   #VUID-VkCopyTensorInfoARM-pRegions-09689# Each element of @pRegions@
--     /must/ be a 'TensorCopyARM' structure whose @pExtent@ is @NULL@ or
--     equal to the 'TensorDescriptionARM'::@pDimensions@ array specified
--     when @srcTensor@ and @dstTensor@ were created
--
-- -   #VUID-VkCopyTensorInfoARM-pRegions-09954# Each element of @pRegions@
--     /must/ be a 'TensorCopyARM' structure whose @dimensionCount@, if it
--     is not equal to 0, is equal to the largest of the
--     'TensorDescriptionARM'::@dimensionCount@ of @srcTensor@ or
--     @dstTensor@
--
-- -   #VUID-VkCopyTensorInfoARM-srcTensor-09690# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-tensor-view-format-features format features>
--     of @srcTensor@ /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_TRANSFER_SRC_BIT'
--
-- -   #VUID-VkCopyTensorInfoARM-srcTensor-09691# @srcTensor@ /must/ have
--     been created with the 'TENSOR_USAGE_TRANSFER_SRC_BIT_ARM' usage flag
--     set
--
-- -   #VUID-VkCopyTensorInfoARM-dstTensor-09692# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-tensor-view-format-features format features>
--     of @dstTensor@ /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_TRANSFER_DST_BIT'
--
-- -   #VUID-VkCopyTensorInfoARM-dstTensor-09693# @dstTensor@ /must/ have
--     been created with the 'TENSOR_USAGE_TRANSFER_DST_BIT_ARM' usage flag
--     set
--
-- -   #VUID-VkCopyTensorInfoARM-srcTensor-09694# If @srcTensor@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyTensorInfoARM-dstTensor-09695# If @dstTensor@ is
--     non-sparse then it /must/ be bound completely and contiguously to a
--     single 'Vulkan.Core10.Handles.DeviceMemory' object
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyTensorInfoARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_TENSOR_INFO_ARM'
--
-- -   #VUID-VkCopyTensorInfoARM-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCopyTensorInfoARM-srcTensor-parameter# @srcTensor@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-VkCopyTensorInfoARM-dstTensor-parameter# @dstTensor@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.TensorARM' handle
--
-- -   #VUID-VkCopyTensorInfoARM-pRegions-parameter# @pRegions@ /must/ be a
--     valid pointer to an array of @regionCount@ valid 'TensorCopyARM'
--     structures
--
-- -   #VUID-VkCopyTensorInfoARM-regionCount-arraylength# @regionCount@
--     /must/ be greater than @0@
--
-- -   #VUID-VkCopyTensorInfoARM-commonparent# Both of @dstTensor@, and
--     @srcTensor@ /must/ have been created, allocated, or retrieved from
--     the same 'Vulkan.Core10.Handles.Device'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM', 'TensorCopyARM',
-- 'cmdCopyTensorARM'
data CopyTensorInfoARM = CopyTensorInfoARM
  { -- | @srcTensor@ is the source tensor.
    CopyTensorInfoARM -> TensorARM
srcTensor :: TensorARM
  , -- | @dstTensor@ is the destination tensor.
    CopyTensorInfoARM -> TensorARM
dstTensor :: TensorARM
  , -- | @pRegions@ is a pointer to an array of 'TensorCopyARM' structures
    -- specifying the regions to copy.
    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


-- | VkTensorCopyARM - Structure specifying an tensor copy region
--
-- == Valid Usage
--
-- -   #VUID-VkTensorCopyARM-dimensionCount-09955# @dimensionCount@ /must/
--     be greater than 0 if @pSrcOffset@, @pDstOffset@, or @pExtent@ is not
--     @NULL@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorCopyARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_COPY_ARM'
--
-- -   #VUID-VkTensorCopyARM-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkTensorCopyARM-pSrcOffset-parameter# If @dimensionCount@ is
--     not @0@, and @pSrcOffset@ is not @NULL@, @pSrcOffset@ /must/ be a
--     valid pointer to an array of @dimensionCount@ @uint64_t@ values
--
-- -   #VUID-VkTensorCopyARM-pDstOffset-parameter# If @dimensionCount@ is
--     not @0@, and @pDstOffset@ is not @NULL@, @pDstOffset@ /must/ be a
--     valid pointer to an array of @dimensionCount@ @uint64_t@ values
--
-- -   #VUID-VkTensorCopyARM-pExtent-parameter# If @dimensionCount@ is not
--     @0@, and @pExtent@ is not @NULL@, @pExtent@ /must/ be a valid
--     pointer to an array of @dimensionCount@ @uint64_t@ values
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'CopyTensorInfoARM', 'Vulkan.Core10.Enums.StructureType.StructureType'
data TensorCopyARM = TensorCopyARM
  { -- | @dimensionCount@ is the number of elements in the @pSrcOffset@,
    -- @pDstOffset@ and @pExtent@ arrays.
    TensorCopyARM -> Word32
dimensionCount :: Word32
  , -- | @pSrcOffset@ is @NULL@ or an array of size @dimensionCount@ providing an
    -- offset into the source tensor. When @pSrcOffset@ is @NULL@, the offset
    -- into the source tensor is @0@ in all dimensions.
    TensorCopyARM -> Vector Word64
srcOffset :: Vector Word64
  , -- | @pDstOffset@ is @NULL@ or an array of size @dimensionCount@ providing an
    -- offset into the destination tensor. When @pDstOffset@ is @NULL@, the
    -- offset into the destination tensor is @0@ in all dimensions.
    TensorCopyARM -> Vector Word64
dstOffset :: Vector Word64
  , -- | @pExtent@ is @NULL@ or an array of size @dimensionCount@ providing the
    -- number of elements to copy in each dimension. When @pExtent@ is @NULL@,
    -- the number of elements to copy is taken as the total number of elements
    -- in each dimension of the source tensor.
    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


-- | VkMemoryDedicatedAllocateInfoTensorARM - Specify a dedicated memory
-- allocation tensor resource
--
-- == Valid Usage
--
-- -   #VUID-VkMemoryDedicatedAllocateInfoTensorARM-allocationSize-09710#
--     'Vulkan.Core10.Memory.MemoryAllocateInfo'::@allocationSize@ /must/
--     equal the
--     'Vulkan.Core10.MemoryManagement.MemoryRequirements'::@size@ of the
--     tensor
--
-- -   #VUID-VkMemoryDedicatedAllocateInfoTensorARM-tensor-09859# If
--     'Vulkan.Core10.Memory.MemoryAllocateInfo' defines a memory import
--     operation with handle type
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT',
--     the memory being imported /must/ also be a dedicated tensor
--     allocation and @tensor@ /must/ be identical to the tensor associated
--     with the imported memory
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkMemoryDedicatedAllocateInfoTensorARM-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_TENSOR_ARM'
--
-- -   #VUID-VkMemoryDedicatedAllocateInfoTensorARM-tensor-parameter#
--     @tensor@ /must/ be a valid 'Vulkan.Extensions.Handles.TensorARM'
--     handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM'
data MemoryDedicatedAllocateInfoTensorARM = MemoryDedicatedAllocateInfoTensorARM
  { -- | @tensor@ is a handle of a tensor which this memory will be bound to.
    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


-- | VkPhysicalDeviceDescriptorBufferTensorPropertiesARM - Structure
-- describing descriptor buffer tensor properties supported by an
-- implementation
--
-- = Description
--
-- If the 'PhysicalDeviceDescriptorBufferTensorPropertiesARM' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDescriptorBufferTensorPropertiesARM = PhysicalDeviceDescriptorBufferTensorPropertiesARM
  { -- | @tensorCaptureReplayDescriptorDataSize@ indicates the maximum size in
    -- bytes of the opaque data used for capture and replay with tensors.
    PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorCaptureReplayDescriptorDataSize :: Word64
  , -- | @tensorViewCaptureReplayDescriptorDataSize@ indicates the maximum size
    -- in bytes of the opaque data used for capture and replay with tensor
    -- views.
    PhysicalDeviceDescriptorBufferTensorPropertiesARM -> Word64
tensorViewCaptureReplayDescriptorDataSize :: Word64
  , -- | @tensorDescriptorSize@ indicates the size in bytes of a
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
    -- descriptor.
    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


-- | VkPhysicalDeviceDescriptorBufferTensorFeaturesARM - Structure describing
-- the descriptor buffer tensor features that can be supported by an
-- implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceDescriptorBufferTensorFeaturesARM' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceDescriptorBufferTensorFeaturesARM', it /must/ add an
-- instance of the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceDescriptorBufferTensorFeaturesARM = PhysicalDeviceDescriptorBufferTensorFeaturesARM
  { -- | #features-descriptorBufferTensorDescriptors#
    -- @descriptorBufferTensorDescriptors@ indicates that the implementation
    -- supports putthing shader-accessible tensor descriptors directly in
    -- memory.
    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


-- | VkTensorCaptureDescriptorDataInfoARM - Structure specifying a tensor for
-- descriptor capture
--
-- == Valid Usage
--
-- -   #VUID-VkTensorCaptureDescriptorDataInfoARM-tensor-09705# If @tensor@
--     is not 'Vulkan.Core10.APIConstants.NULL_HANDLE' then @tensor@ /must/
--     have been created with
--     'TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM' set in
--     'TensorCreateInfoARM'::@flags@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorCaptureDescriptorDataInfoARM-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_CAPTURE_DESCRIPTOR_DATA_INFO_ARM'
--
-- -   #VUID-VkTensorCaptureDescriptorDataInfoARM-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkTensorCaptureDescriptorDataInfoARM-tensor-parameter#
--     @tensor@ /must/ be a valid 'Vulkan.Extensions.Handles.TensorARM'
--     handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM',
-- 'getTensorOpaqueCaptureDescriptorDataARM'
data TensorCaptureDescriptorDataInfoARM = TensorCaptureDescriptorDataInfoARM
  { -- | @tensor@ is the 'Vulkan.Extensions.Handles.TensorARM' handle of the
    -- tensor to get opaque capture data for.
    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


-- | VkTensorViewCaptureDescriptorDataInfoARM - Structure specifying a tensor
-- view for descriptor capture
--
-- == Valid Usage
--
-- -   #VUID-VkTensorViewCaptureDescriptorDataInfoARM-tensorView-09709# If
--     @tensorView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE' then
--     @tensorView@ /must/ have been created with
--     'TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM' set in
--     'TensorViewCreateInfoARM'::@flags@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkTensorViewCaptureDescriptorDataInfoARM-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_TENSOR_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_ARM'
--
-- -   #VUID-VkTensorViewCaptureDescriptorDataInfoARM-pNext-pNext# @pNext@
--     /must/ be @NULL@
--
-- -   #VUID-VkTensorViewCaptureDescriptorDataInfoARM-tensorView-parameter#
--     @tensorView@ /must/ be a valid
--     'Vulkan.Extensions.Handles.TensorViewARM' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorViewARM',
-- 'getTensorViewOpaqueCaptureDescriptorDataARM'
data TensorViewCaptureDescriptorDataInfoARM = TensorViewCaptureDescriptorDataInfoARM
  { -- | @tensorView@ is the 'Vulkan.Extensions.Handles.TensorViewARM' handle of
    -- the tensor view to get opaque capture data for.
    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


-- | VkDescriptorGetTensorInfoARM - Structure specifying parameters to get
-- descriptor data for tensor views
--
-- == Valid Usage
--
-- -   #VUID-VkDescriptorGetTensorInfoARM-nullDescriptor-09899# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-nullDescriptor nullDescriptor>
--     feature is not enabled, @tensorView@ /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDescriptorGetTensorInfoARM-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DESCRIPTOR_GET_TENSOR_INFO_ARM'
--
-- -   #VUID-VkDescriptorGetTensorInfoARM-tensorView-parameter# If
--     @tensorView@ is not 'Vulkan.Core10.APIConstants.NULL_HANDLE',
--     @tensorView@ /must/ be a valid
--     'Vulkan.Extensions.Handles.TensorViewARM' handle
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_descriptor_buffer VK_EXT_descriptor_buffer>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorViewARM'
data DescriptorGetTensorInfoARM = DescriptorGetTensorInfoARM
  { -- | @tensorView@ is a 'Vulkan.Extensions.Handles.TensorViewARM' handle
    -- specifying the parameters of a
    -- 'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
    -- descriptor.
    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


-- | VkFrameBoundaryTensorsARM - Add tensor frame boundary information to
-- queue submissions
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_frame_boundary VK_EXT_frame_boundary>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Extensions.Handles.TensorARM'
data FrameBoundaryTensorsARM = FrameBoundaryTensorsARM
  { -- | @pTensors@ is a pointer to an array of
    -- 'Vulkan.Extensions.Handles.TensorARM' objects with tensorCount entries.
    --
    -- #VUID-VkFrameBoundaryTensorsARM-pTensors-parameter# @pTensors@ /must/ be
    -- a valid pointer to an array of @tensorCount@ valid
    -- 'Vulkan.Extensions.Handles.TensorARM' handles
    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


-- | VkPhysicalDeviceExternalTensorInfoARM - Structure specifying tensor
-- creation parameters.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'TensorCreateFlagsARM', 'TensorDescriptionARM',
-- 'getPhysicalDeviceExternalTensorPropertiesARM'
data PhysicalDeviceExternalTensorInfoARM = PhysicalDeviceExternalTensorInfoARM
  { -- | @flags@ is a bitmask of 'TensorCreateFlagBitsARM' describing additional
    -- parameters of the tensor, corresponding to
    -- 'TensorCreateInfoARM'::@flags@.
    --
    -- #VUID-VkPhysicalDeviceExternalTensorInfoARM-flags-parameter# @flags@
    -- /must/ be a valid combination of 'TensorCreateFlagBitsARM' values
    PhysicalDeviceExternalTensorInfoARM -> TensorCreateFlagsARM
flags :: TensorCreateFlagsARM
  , -- | @pDescription@ is a 'TensorDescriptionARM' structure describing the
    -- tensor, corresponding to 'TensorCreateInfoARM'::@pDescription@.
    --
    -- #VUID-VkPhysicalDeviceExternalTensorInfoARM-pDescription-parameter#
    -- @pDescription@ /must/ be a valid pointer to a valid
    -- 'TensorDescriptionARM' structure
    PhysicalDeviceExternalTensorInfoARM -> TensorDescriptionARM
description :: TensorDescriptionARM
  , -- | @handleType@ is a
    -- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits'
    -- value specifying the external memory handle type for which capabilities
    -- will be returned.
    --
    -- #VUID-VkPhysicalDeviceExternalTensorInfoARM-handleType-parameter#
    -- @handleType@ /must/ be a valid
    -- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits'
    -- value
    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


-- | VkExternalTensorPropertiesARM - Structure specifying supported external
-- handle capabilities for a tensor
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalMemoryProperties',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPhysicalDeviceExternalTensorPropertiesARM'
data ExternalTensorPropertiesARM = ExternalTensorPropertiesARM
  { -- | @externalMemoryProperties@ is a
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalMemoryProperties'
    -- structure specifying various capabilities of the external handle type
    -- when used with the specified tensor creation parameters.
    --
    -- #VUID-VkExternalTensorPropertiesARM-externalMemoryProperties-parameter#
    -- @externalMemoryProperties@ /must/ be a valid
    -- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalMemoryProperties'
    -- structure
    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


-- | VkExternalMemoryTensorCreateInfoARM - Specify that a tensor may be
-- backed by external memory
--
-- = Members
--
-- A 'ExternalMemoryTensorCreateInfoARM' structure with a non-zero
-- @handleTypes@ field must be included in the creation parameters for a
-- tensor that will be bound to memory that is either exported or imported.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ExternalMemoryTensorCreateInfoARM = ExternalMemoryTensorCreateInfoARM
  { -- | @handleTypes@ is zero or a bitmask of
    -- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits'
    -- specifying one or more external memory handle types.
    --
    -- #VUID-VkExternalMemoryTensorCreateInfoARM-handleTypes-parameter#
    -- @handleTypes@ /must/ be a valid combination of
    -- 'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.ExternalMemoryHandleTypeFlagBits'
    -- values
    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

-- | VkTensorCreateFlagBitsARM - Bitmask specifying additional parameters of
-- a tensor
--
-- = Description
--
-- -   'TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM' specifies that the tensor
--     /can/ be used to create a 'Vulkan.Extensions.Handles.TensorViewARM'
--     with a different format from the tensor.
--
-- -   'TENSOR_CREATE_PROTECTED_BIT_ARM' specifies that the tensor is a
--     protected tensor.
--
-- -   'TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM' specifies
--     that the tensor /can/ be used with descriptor buffers when capturing
--     and replaying (e.g. for trace capture and replay), see
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
--     for more detail.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'TensorCreateFlagsARM'
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)

-- No documentation found for Nested "VkTensorCreateFlagBitsARM" "VK_TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM"
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

-- No documentation found for Nested "VkTensorCreateFlagBitsARM" "VK_TENSOR_CREATE_PROTECTED_BIT_ARM"
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

-- No documentation found for Nested "VkTensorCreateFlagBitsARM" "VK_TENSOR_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM"
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

-- No documentation found for Nested "VkTensorCreateFlagBitsARM" "VK_TENSOR_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_ARM"
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

-- | VkTensorUsageFlagBitsARM - Bitmask specifying allowed usage of a tensor
--
-- = Description
--
-- -   'TENSOR_USAGE_SHADER_BIT_ARM' specifies that the tensor /can/ be
--     used to create a 'Vulkan.Extensions.Handles.TensorViewARM' suitable
--     for occupying a 'Vulkan.Core10.Handles.DescriptorSet' slot of type
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
--     accessed by shader stages.
--
-- -   'TENSOR_USAGE_TRANSFER_SRC_BIT_ARM' specifies that the tensor /can/
--     be used as the source of a /transfer command/ (see the definition of
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-transfer >).
--
-- -   'TENSOR_USAGE_TRANSFER_DST_BIT_ARM' specifies that the tensor /can/
--     be used as the destination of a transfer command.
--
-- -   'TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM' specifies that the tensor
--     /can/ be bound to a range of memory aliased with an image created
--     with 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL'. See
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-memory-aliasing>
--     for a complete set of rules for tensor\/image aliasing.
--
-- -   'TENSOR_USAGE_DATA_GRAPH_BIT_ARM' specifies that the tensor /can/ be
--     used to create a 'Vulkan.Extensions.Handles.TensorViewARM' suitable
--     for occupying a 'Vulkan.Core10.Handles.DescriptorSet' slot of type
--     'Vulkan.Core10.Enums.DescriptorType.DESCRIPTOR_TYPE_TENSOR_ARM'
--     accessed by
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#graphs-pipelines data graph pipelines>.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'TensorUsageFlagsARM'
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)

-- No documentation found for Nested "VkTensorUsageFlagBitsARM" "VK_TENSOR_USAGE_SHADER_BIT_ARM"
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

-- No documentation found for Nested "VkTensorUsageFlagBitsARM" "VK_TENSOR_USAGE_TRANSFER_SRC_BIT_ARM"
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

-- No documentation found for Nested "VkTensorUsageFlagBitsARM" "VK_TENSOR_USAGE_TRANSFER_DST_BIT_ARM"
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

-- No documentation found for Nested "VkTensorUsageFlagBitsARM" "VK_TENSOR_USAGE_IMAGE_ALIASING_BIT_ARM"
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

-- No documentation found for Nested "VkTensorUsageFlagBitsARM" "VK_TENSOR_USAGE_DATA_GRAPH_BIT_ARM"
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

-- | VkTensorTilingARM - Specifies the tiling arrangement of data in an
-- tensor
--
-- = Description
--
-- -   'TENSOR_TILING_OPTIMAL_ARM' specifies optimal tiling (elements are
--     laid out in an implementation-dependent arrangement, for more
--     efficient memory access).
--
-- -   'TENSOR_TILING_LINEAR_ARM' specifies linear tiling (elements are
--     laid out linearly and the offset between each element is determined
--     by the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#resources-tensor-description-strides strides>
--     of the tensor).
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'TensorDescriptionARM'
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)

-- No documentation found for Nested "VkTensorTilingARM" "VK_TENSOR_TILING_OPTIMAL_ARM"
pattern $mTENSOR_TILING_OPTIMAL_ARM :: forall {r}. TensorTilingARM -> ((# #) -> r) -> ((# #) -> r) -> r
$bTENSOR_TILING_OPTIMAL_ARM :: TensorTilingARM
TENSOR_TILING_OPTIMAL_ARM = TensorTilingARM 0

-- No documentation found for Nested "VkTensorTilingARM" "VK_TENSOR_TILING_LINEAR_ARM"
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

-- | VkTensorViewCreateFlagBitsARM - Bitmask specifying additional parameters
-- of an tensor view
--
-- = Description
--
-- -   'TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM'
--     specifies that the tensor view /can/ be used with descriptor buffers
--     when capturing and replaying (e.g. for trace capture and replay),
--     see
--     'Vulkan.Extensions.VK_EXT_descriptor_buffer.OpaqueCaptureDescriptorDataCreateInfoEXT'
--     for more detail.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_ARM_tensors VK_ARM_tensors>,
-- 'TensorViewCreateFlagsARM'
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)

-- No documentation found for Nested "VkTensorViewCreateFlagBitsARM" "VK_TENSOR_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_ARM"
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

-- No documentation found for TopLevel "VK_ARM_TENSORS_SPEC_VERSION"
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"

-- No documentation found for TopLevel "VK_ARM_TENSORS_EXTENSION_NAME"
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"