Instance Property


The number of channels in the destination image to skip before writing output data.


@property(readwrite, nonatomic) NSUInteger destinationFeatureChannelOffset;


This is the starting offset in the destination image in the feature channel dimension at which destination output data is written. This allows you to pass a subset of all the channels in an image as the output of a kernel.

For example, suppose a destination image has 24 channels and a kernel outputs 8 channels. If we want channels 8 to 15 of this destination image to be used for the output, we can set the value of the destinationFeatureChannelOffset property to 8.

Note that this offset applies independently to each image when the MPSImage object is a container for multiple images and the MPSCNNKernel object is processing multiple images (i.e., clipRect.size.depth > 1).

The default value is 0. Any other value specified must be a multiple of 4. If the kernel outputs N channels, the destination image must have at least destinationFeatureChannelOffset + N channels. Using a destination image with an insufficient number of feature channels results in an error.

For example, if a convolution filter outputs 32 channels, and the destination image has 64 channels, then it is an error to set destinationFeatureChannelOffset > 32.