<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSCNNBinaryKernel"
  },
  "title" : "MPSCNNBinaryKernel"
}
-->

# MPSCNNBinaryKernel

A convolution neural network kernel.

```
class MPSCNNBinaryKernel
```

## Topics

### Initializers

[`-  initWithCoder:device:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/init(coder:device:))

[`-  initWithDevice:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/init(device:))

### Instance Properties

[`clipRect`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/clipRect)

[`destinationFeatureChannelOffset`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/destinationFeatureChannelOffset)

[`destinationImageAllocator`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/destinationImageAllocator)

[`isBackwards`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/isBackwards)

[`padding`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/padding)

[`primaryEdgeMode`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryEdgeMode)

[`primaryOffset`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryOffset)

[`primaryStrideInPixelsX`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryStrideInPixelsX)

[`primaryStrideInPixelsY`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryStrideInPixelsY)

[`secondaryEdgeMode`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryEdgeMode)

[`secondaryOffset`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryOffset)

[`secondaryStrideInPixelsX`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryStrideInPixelsX)

[`secondaryStrideInPixelsY`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryStrideInPixelsY)

[`isStateModified`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/isStateModified)

[`primaryDilationRateX`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryDilationRateX)

[`primaryDilationRateY`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryDilationRateY)

[`primaryKernelHeight`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryKernelHeight)

[`primaryKernelWidth`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primaryKernelWidth)

[`primarySourceFeatureChannelMaxCount`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primarySourceFeatureChannelMaxCount)

[`primarySourceFeatureChannelOffset`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/primarySourceFeatureChannelOffset)

[`secondaryDilationRateX`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryDilationRateX)

[`secondaryDilationRateY`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryDilationRateY)

[`secondaryKernelHeight`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryKernelHeight)

[`secondaryKernelWidth`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondaryKernelWidth)

[`secondarySourceFeatureChannelMaxCount`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondarySourceFeatureChannelMaxCount)

[`secondarySourceFeatureChannelOffset`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/secondarySourceFeatureChannelOffset)

### Instance Methods

[`-  encodeToCommandBuffer:primaryImage:secondaryImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encode(commandBuffer:primaryImage:secondaryImage:))

[`-  encodeToCommandBuffer:primaryImage:secondaryImage:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encode(commandBuffer:primaryImage:secondaryImage:destinationImage:))

[`-  appendBatchBarrier`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/appendBatchBarrier())

[`-  batchEncodingStorageSizeForPrimaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/batchEncodingStorageSize(primaryImage:secondaryImage:sourceStates:destinationImage:))

[`-  destinationImageDescriptorForSourceImages:sourceStates:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/destinationImageDescriptor(forSourceImages:sourceStates:))

[`-  encodeToCommandBuffer:primaryImage:secondaryImage:destinationState:destinationStateIsTemporary:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encode(commandBuffer:primaryImage:secondaryImage:destinationState:destinationStateIsTemporary:))

[`-  encodeBatchToCommandBuffer:primaryImages:secondaryImages:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encodeBatch(commandBuffer:primaryImages:secondaryImages:))

[`-  encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationImages:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encodeBatch(commandBuffer:primaryImages:secondaryImages:destinationImages:))

[`-  encodeBatchToCommandBuffer:primaryImages:secondaryImages:destinationStates:destinationStateIsTemporary:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encodeBatch(commandBuffer:primaryImages:secondaryImages:destinationStates:destinationStateIsTemporary:))

[`-  encodingStorageSizeForPrimaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/encodingStorageSize(primaryImage:secondaryImage:sourceStates:destinationImage:))

[`-  isResultStateReusedAcrossBatch`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/isResultStateReusedAcrossBatch())

[`-  resultStateForPrimaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/resultState(primaryImage:secondaryImage:sourceStates:destinationImage:))

[`-  resultStateBatchForPrimaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/resultStateBatch(primaryImage:secondaryImage:sourceStates:destinationImage:))

[`-  temporaryResultStateForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/temporaryResultState(commandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:))

[`-  temporaryResultStateBatchForCommandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:`](/documentation/MetalPerformanceShaders/MPSCNNBinaryKernel/temporaryResultStateBatch(commandBuffer:primaryImage:secondaryImage:sourceStates:destinationImage:))

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherited By

[`MPSCNNGradientKernel`](/documentation/MetalPerformanceShaders/MPSCNNGradientKernel)

[`MPSNNGridSample`](/documentation/MetalPerformanceShaders/MPSNNGridSample)

[`MPSNNReduceBinary`](/documentation/MetalPerformanceShaders/MPSNNReduceBinary)

[`MPSNNLossGradient`](/documentation/MetalPerformanceShaders/MPSNNLossGradient)

[`MPSCNNArithmetic`](/documentation/MetalPerformanceShaders/MPSCNNArithmetic)

### Inherits From

[`MPSKernel`](/documentation/MetalPerformanceShaders/MPSKernel)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)