~/bend-docscommunity

storage_copy.bend source

storage_copy.bend on the hub · documented module

# Internal contiguous ranges. Callers establish bounds; the shared copy proof# and storage certificates cover the actual loop without a per-element check.import Baseimport ./storage_buffer.bend as Storageimport ./tensor_view.bend as Viewsimport ./tensor_access.bend as Accessimport ./tensor_operations.bend as Operationsimport ./proofs/tensor_access_certificate.bend as AccessCertificatedef range(~Element: Data,+count: U32,+source: U32,+destination: U32,input: Storage.Buffer<Element>,output: Storage.Buffer<Element>) ->  Storage.Buffer<Element> & Storage.Buffer<Element>:  Storage.Buffer{input,input_length,input_certificate} = input  Storage.Buffer{output,output_length,output_certificate} = output  +view = {Views.View{[Views.Axis{count,1}],source} : Views.View}  Operations.pair_buffers(~Element,input_length,output_length,    Access.copy_run(~Element,True{},U32.to_nat(count),view,destination,input,output),    AccessCertificate.copy(~Element,True{},U32.to_nat(count),view,destination,input,output,input_certificate,output_certificate))