---
title: "encode(to:primarySourceArray:secondarySourceArray:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsndarraybinarykernel/encode(to:primarysourcearray:secondarysourcearray:)"
---

# encode(to:primarySourceArray:secondarySourceArray:)

## Declaration

```swift
func encode(to cmdBuf: any MTLCommandBuffer, primarySourceArray: MPSNDArray, secondarySourceArray: MPSNDArray) -> MPSNDArray
```
