Source/Packages

Runtime.NativeDataParallelOwned

packages/execution/src/Runtime/NativeDataParallelOwned.alpha

2,874 lines126 declarations142.2 KiBSHA-256 de18258423c4

def · lines 658–675

dpoGradientsEnd

Full file
Where storage after the reductions may begin (`base` when there are none).
658def dpoGradientsEnd =
659  (lambda unrestricted c : Nat .
660    (lambda unrestricted u : Nat .
661      (lambda unrestricted system : (family DataParallelSystem c u) .
662        (lambda unrestricted gradients : (family StdList (family NativeCombinePlacement)) .
663          (lambda unrestricted base : Nat .
664            (stdListFold
665              (family NativeCombinePlacement)
666              Nat
667              (lambda unrestricted placement : (family NativeCombinePlacement) .
668                (lambda unrestricted rest : Nat .
669                  (let unrestricted ending =
670                    (frameAlign
671                      (naturalAdd (nativeCombineRegionEnd placement) (dpoGradientBytes c u system)))
672                    in
673                    (naturalSelect (naturalLess rest ending) ending rest))))
674              base
675              gradients))))))

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.