@@ -918,12 +918,12 @@ instance Zero CudaFunctionCreateInfoNV where
918
918
-- valid 'Vulkan.Extensions.Handles.CudaFunctionNV' handle
919
919
--
920
920
-- - #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
923
923
--
924
924
-- - #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
927
927
--
928
928
-- = See Also
929
929
--
@@ -955,13 +955,9 @@ data CudaLaunchInfoNV = CudaLaunchInfoNV
955
955
, -- | @sharedMemBytes@ is the dynamic shared-memory size per thread block in
956
956
-- bytes.
957
957
sharedMemBytes :: Word32
958
- , -- | @paramCount@ is the length of the @pParams@ table.
959
- paramCount :: Word64
960
958
, -- | @pParams@ is a pointer to an array of @paramCount@ pointers,
961
959
-- corresponding to the arguments of @function@.
962
960
params :: Vector (Ptr () )
963
- , -- | @extraCount@ is reserved for future use.
964
- extraCount :: Word64
965
961
, -- | @pExtras@ is reserved for future use.
966
962
extras :: Vector (Ptr () )
967
963
}
@@ -984,25 +980,11 @@ instance ToCStruct CudaLaunchInfoNV where
984
980
lift $ poke ((p `plusPtr` 40 :: Ptr Word32 )) (blockDimY)
985
981
lift $ poke ((p `plusPtr` 44 :: Ptr Word32 )) (blockDimZ)
986
982
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 ))
995
984
pPParams' <- ContT $ allocaBytes @ (Ptr () ) ((Data.Vector. length (params)) * 8 )
996
985
lift $ Data.Vector. imapM_ (\ i e -> poke (pPParams' `plusPtr` (8 * (i)) :: Ptr (Ptr () )) (e)) (params)
997
986
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 ))
1006
988
pPExtras' <- ContT $ allocaBytes @ (Ptr () ) ((Data.Vector. length (extras)) * 8 )
1007
989
lift $ Data.Vector. imapM_ (\ i e -> poke (pPExtras' `plusPtr` (8 * (i)) :: Ptr (Ptr () )) (e)) (extras)
1008
990
lift $ poke ((p `plusPtr` 80 :: Ptr (Ptr (Ptr () )))) (pPExtras')
@@ -1033,13 +1015,11 @@ instance FromCStruct CudaLaunchInfoNV where
1033
1015
blockDimZ <- peek @ Word32 ((p `plusPtr` 44 :: Ptr Word32 ))
1034
1016
sharedMemBytes <- peek @ Word32 ((p `plusPtr` 48 :: Ptr Word32 ))
1035
1017
paramCount <- peek @ CSize ((p `plusPtr` 56 :: Ptr CSize ))
1036
- let paramCount' = coerce @ CSize @ Word64 paramCount
1037
1018
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 () ))))
1039
1020
extraCount <- peek @ CSize ((p `plusPtr` 72 :: Ptr CSize ))
1040
- let extraCount' = coerce @ CSize @ Word64 extraCount
1041
1021
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 () ))))
1043
1023
pure $ CudaLaunchInfoNV
1044
1024
function
1045
1025
gridDimX
@@ -1049,9 +1029,7 @@ instance FromCStruct CudaLaunchInfoNV where
1049
1029
blockDimY
1050
1030
blockDimZ
1051
1031
sharedMemBytes
1052
- paramCount'
1053
1032
pParams'
1054
- extraCount'
1055
1033
pExtras'
1056
1034
1057
1035
instance Zero CudaLaunchInfoNV where
@@ -1064,9 +1042,7 @@ instance Zero CudaLaunchInfoNV where
1064
1042
zero
1065
1043
zero
1066
1044
zero
1067
- zero
1068
1045
mempty
1069
- zero
1070
1046
mempty
1071
1047
1072
1048
0 commit comments