Source/Packages

Runtime.NativeDataParallelOwned

packages/execution/src/Runtime/NativeDataParallelOwned.alpha

2,874 lines126 declarations142.2 KiBSHA-256 de18258423c4

def · lines 1005–1057

dpoOffer

Full file
This owner's offer: its parameters (when partitioned, its own and +0 for the others) and its ownership words.
1005def dpoOffer =
1006  (lambda unrestricted c : Nat .
1007    (lambda unrestricted u : Nat .
1008      (lambda unrestricted system : (family DataParallelSystem c u) .
1009        (lambda unrestricted q : Nat .
1010          (lambda unrestricted p : Nat .
1011            (lambda unrestricted layout : (family NativeDataParallelOwnedLayout) .
1012              (lambda unrestricted role : Nat .
1013                (lambda unrestricted tail : (family NativePhysicalCommands) .
1014                  (let unrestricted k =
1015                    (dpK c u system)
1016                    in
1017                    (let unrestricted owners =
1018                      (dpOwners c u system)
1019                      in
1020                      (let unrestricted leaf =
1021                        (nativeCombineRegionEnd (dpoAssemblePlacement layout))
1022                        in
1023                        (dpoUnless
1024                          p
1025                          (dpCopy leaf (dpoParametersAt layout) (dpParameterBytes c u system))
1026                          (dpoWhen
1027                            p
1028                            (dpEach
1029                              k
1030                              (lambda unrestricted coordinate : Nat .
1031                                (lambda unrestricted rest : (family NativePhysicalCommands) .
1032                                  (nat-eliminate
1033                                    (lambda unrestricted held : Nat .
1034                                      (family NativePhysicalCommands))
1035                                    (nativeMemoryStoreWord64
1036                                      b"data-parallel-unowned-parameter"
1037                                      (nativePointwiseAt leaf coordinate)
1038                                      (nativeLaunchRecipeImmediate 0)
1039                                      rest)
1040                                    (lambda unrestricted previous : Nat .
1041                                      (lambda unrestricted ignored : (family NativePhysicalCommands) .
1042                                        (dpCopy
1043                                        (nativePointwiseAt leaf coordinate)
1044                                        (naturalAdd
1045                                        (dpoOwnedAt c u system q p layout)
1046                                        (dpoWordOffset k owners 0 coordinate))
1047                                        dpWord
1048                                        rest)))
1049                                    (dpoOwns owners role coordinate)))))
1050                            (dpEach
1051                              k
1052                              (lambda unrestricted coordinate : Nat .
1053                                (nativeMemoryStoreWord64
1054                                  b"data-parallel-ownership"
1055                                  (nativePointwiseAt leaf (naturalAdd k coordinate))
1056                                  (nativeLaunchRecipeImmediate (dpoOwns owners role coordinate))))
1057                              tail))))))))))))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.