Tensor.combine_with: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/tensor.bend as Tensor Lines 375-390 of stelliferous@0.0.2.0/tensor.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/tensor.bend&start_line=375&end_line=390 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/tensor_shape.bend as Shapes import stelliferous@0.0.2.0/tensor_view.bend as Views import stelliferous@0.0.2.0/tensor_band.bend as Bands # operation(left element, right element), retaining band layout when either # operand is banded. Alignment is done once, before any parallel leaf work. # operations counts the operation's scalar work for the band schedule. def combine_with(~Element: Data,~kernel: @+count: Nat -> @+right_view: Views.View -> @+offset: U32 -> Storage.Buffer -> Storage.Buffer -> Storage.Buffer & Storage.Buffer,name: String,operations: F32,left: Tensor,right: Tensor) -> Tensor: match left right: case Tensor{left,left_shape,left_fill,left_status,left_workers} Tensor{right,right_shape,right_fill,right_status,right_workers}: combine_status_with(~Element,~kernel,name,first_failure(left_status,right_status),left,left_shape,left_fill,right,right_shape,U32.max(left_workers,right_workers)) case Banded{left,geometry,+left_shape,left_fill,left_status,left_workers} Tensor{right,+right_shape,right_fill,+right_status,+right_workers}: combine_bands_plan_with(~Element,~kernel,name,operations,first_failure(left_status,right_status),Shapes.same_extents(left_shape,right_shape),geometry, left_shape,right_shape,left_fill,U32.max(left_workers,right_workers),Tensor{right,right_shape,right_fill,right_status,right_workers},Bands.plan(~Element,left)) case Banded{left,geometry,+left_shape,left_fill,left_status,left_workers} Banded{right,right_geometry,+right_shape,right_fill,+right_status,+right_workers}: combine_pair_plans_with(~Element,~kernel,name,operations,first_failure(left_status,right_status),Shapes.same_extents(left_shape,right_shape),geometry,right_geometry, left_shape,right_shape,left_fill,right_fill,U32.max(left_workers,right_workers),Bands.plan(~Element,left),Bands.plan(~Element,right)) case Tensor{left,+left_shape,left_fill,left_status,left_workers} Banded{right,geometry,+right_shape,right_fill,right_status,right_workers}: combine_right_plan_with(~Element,~kernel,name,operations,first_failure(left_status,right_status),Shapes.same_extents(left_shape,right_shape),geometry, left_shape,right_shape,left_fill,right_fill,U32.max(left_workers,right_workers),left,Bands.plan(~Element,right)) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.max https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=Tensor https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_bands_plan_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_pair_plans_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_right_plan_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=combine_status_with https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor.bend&name=first_failure https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_band.bend&name=plan https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_shape.bend&name=same_extents https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/tensor_view.bend&name=View