def copy_planes

stelliferous@0.0.2.0 · kernel_window.bend:62

import stelliferous@0.0.2.0/kernel_window.bend as KernelWindow
import Base
import stelliferous@0.0.2.0/traversal_array.bend as Traversal

62# Channel c copies count values from c * source_stride + source_start to
63# c * target_stride. Each plane is one contiguous copy.
64def copy_planes(remaining: Nat,+channel: U32,+count: U32,+source_stride: U32,+source_start: U32,+target_stride: U32,
65  owners: Array<F32> & Array<F32>) -> Array<F32> & Array<F32>:
66  match remaining:
67    case 0n: owners
68    case 1n+rest:
69      (source,target) = owners
70      copy_planes(rest,(channel + 1 : U32),count,source_stride,source_start,target_stride,
71        Traversal.copy(~F32,U32.to_nat(count),(channel * source_stride + source_start : U32),(channel * target_stride : U32),source,target))

Uses (10)

Used by (0)

No other definition uses this definition.