Skip to content

Commit 147eb2d

Browse files
committed
regenerate
1 parent bd82b52 commit 147eb2d

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

src/Vulkan/Extensions/VK_NV_cuda_kernel_launch.hs

+8-32
Original file line numberDiff line numberDiff line change
@@ -918,12 +918,12 @@ instance Zero CudaFunctionCreateInfoNV where
918918
-- valid 'Vulkan.Extensions.Handles.CudaFunctionNV' handle
919919
--
920920
-- - #VUID-VkCudaLaunchInfoNV-pParams-parameter# If @paramCount@ is not
921-
-- @0@, and @pParams@ is not @NULL@, @pParams@ /must/ be a valid
922-
-- pointer to an array of @paramCount@ bytes
921+
-- @0@, @pParams@ /must/ be a valid pointer to an array of @paramCount@
922+
-- bytes
923923
--
924924
-- - #VUID-VkCudaLaunchInfoNV-pExtras-parameter# If @extraCount@ is not
925-
-- @0@, and @pExtras@ is not @NULL@, @pExtras@ /must/ be a valid
926-
-- pointer to an array of @extraCount@ bytes
925+
-- @0@, @pExtras@ /must/ be a valid pointer to an array of @extraCount@
926+
-- bytes
927927
--
928928
-- = See Also
929929
--
@@ -955,13 +955,9 @@ data CudaLaunchInfoNV = CudaLaunchInfoNV
955955
, -- | @sharedMemBytes@ is the dynamic shared-memory size per thread block in
956956
-- bytes.
957957
sharedMemBytes :: Word32
958-
, -- | @paramCount@ is the length of the @pParams@ table.
959-
paramCount :: Word64
960958
, -- | @pParams@ is a pointer to an array of @paramCount@ pointers,
961959
-- corresponding to the arguments of @function@.
962960
params :: Vector (Ptr ())
963-
, -- | @extraCount@ is reserved for future use.
964-
extraCount :: Word64
965961
, -- | @pExtras@ is reserved for future use.
966962
extras :: Vector (Ptr ())
967963
}
@@ -984,25 +980,11 @@ instance ToCStruct CudaLaunchInfoNV where
984980
lift $ poke ((p `plusPtr` 40 :: Ptr Word32)) (blockDimY)
985981
lift $ poke ((p `plusPtr` 44 :: Ptr Word32)) (blockDimZ)
986982
lift $ poke ((p `plusPtr` 48 :: Ptr Word32)) (sharedMemBytes)
987-
let pParamsLength = Data.Vector.length $ (params)
988-
paramCount'' <- lift $ if (paramCount) == 0
989-
then pure $ fromIntegral pParamsLength
990-
else do
991-
unless (fromIntegral pParamsLength == (paramCount) || pParamsLength == 0) $
992-
throwIO $ IOError Nothing InvalidArgument "" "pParams must be empty or have 'paramCount' elements" Nothing Nothing
993-
pure (paramCount)
994-
lift $ poke ((p `plusPtr` 56 :: Ptr CSize)) (paramCount'')
983+
lift $ poke ((p `plusPtr` 56 :: Ptr CSize)) ((fromIntegral (Data.Vector.length $ (params)) :: CSize))
995984
pPParams' <- ContT $ allocaBytes @(Ptr ()) ((Data.Vector.length (params)) * 8)
996985
lift $ Data.Vector.imapM_ (\i e -> poke (pPParams' `plusPtr` (8 * (i)) :: Ptr (Ptr ())) (e)) (params)
997986
lift $ poke ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ())))) (pPParams')
998-
let pExtrasLength = Data.Vector.length $ (extras)
999-
extraCount'' <- lift $ if (extraCount) == 0
1000-
then pure $ fromIntegral pExtrasLength
1001-
else do
1002-
unless (fromIntegral pExtrasLength == (extraCount) || pExtrasLength == 0) $
1003-
throwIO $ IOError Nothing InvalidArgument "" "pExtras must be empty or have 'extraCount' elements" Nothing Nothing
1004-
pure (extraCount)
1005-
lift $ poke ((p `plusPtr` 72 :: Ptr CSize)) (extraCount'')
987+
lift $ poke ((p `plusPtr` 72 :: Ptr CSize)) ((fromIntegral (Data.Vector.length $ (extras)) :: CSize))
1006988
pPExtras' <- ContT $ allocaBytes @(Ptr ()) ((Data.Vector.length (extras)) * 8)
1007989
lift $ Data.Vector.imapM_ (\i e -> poke (pPExtras' `plusPtr` (8 * (i)) :: Ptr (Ptr ())) (e)) (extras)
1008990
lift $ poke ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ())))) (pPExtras')
@@ -1033,13 +1015,11 @@ instance FromCStruct CudaLaunchInfoNV where
10331015
blockDimZ <- peek @Word32 ((p `plusPtr` 44 :: Ptr Word32))
10341016
sharedMemBytes <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
10351017
paramCount <- peek @CSize ((p `plusPtr` 56 :: Ptr CSize))
1036-
let paramCount' = coerce @CSize @Word64 paramCount
10371018
pParams <- peek @(Ptr (Ptr ())) ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ()))))
1038-
pParams' <- generateM (fromIntegral paramCount') (\i -> peek @(Ptr ()) ((pParams `advancePtrBytes` (8 * (i)) :: Ptr (Ptr ()))))
1019+
pParams' <- generateM (fromIntegral (coerce @CSize @Word64 paramCount)) (\i -> peek @(Ptr ()) ((pParams `advancePtrBytes` (8 * (i)) :: Ptr (Ptr ()))))
10391020
extraCount <- peek @CSize ((p `plusPtr` 72 :: Ptr CSize))
1040-
let extraCount' = coerce @CSize @Word64 extraCount
10411021
pExtras <- peek @(Ptr (Ptr ())) ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ()))))
1042-
pExtras' <- generateM (fromIntegral extraCount') (\i -> peek @(Ptr ()) ((pExtras `advancePtrBytes` (8 * (i)) :: Ptr (Ptr ()))))
1022+
pExtras' <- generateM (fromIntegral (coerce @CSize @Word64 extraCount)) (\i -> peek @(Ptr ()) ((pExtras `advancePtrBytes` (8 * (i)) :: Ptr (Ptr ()))))
10431023
pure $ CudaLaunchInfoNV
10441024
function
10451025
gridDimX
@@ -1049,9 +1029,7 @@ instance FromCStruct CudaLaunchInfoNV where
10491029
blockDimY
10501030
blockDimZ
10511031
sharedMemBytes
1052-
paramCount'
10531032
pParams'
1054-
extraCount'
10551033
pExtras'
10561034

10571035
instance Zero CudaLaunchInfoNV where
@@ -1064,9 +1042,7 @@ instance Zero CudaLaunchInfoNV where
10641042
zero
10651043
zero
10661044
zero
1067-
zero
10681045
mempty
1069-
zero
10701046
mempty
10711047

10721048

0 commit comments

Comments
 (0)