Class MPSCNNKernel

All Implemented Interfaces:
NSCoding, NSObjectProtocol, NSSecureCoding, ObjCProtocol
Direct Known Subclasses:
MPSCNNBatchNormalization, MPSCNNBatchNormalizationStatistics, MPSCNNBinaryConvolution, MPSCNNConvolution, MPSCNNConvolutionTranspose, MPSCNNCrossChannelNormalization, MPSCNNDropout, MPSCNNGroupNormalization, MPSCNNInstanceNormalization, MPSCNNLocalContrastNormalization, MPSCNNLogSoftMax, MPSCNNLoss, MPSCNNNeuron, MPSCNNPooling, MPSCNNSoftMax, MPSCNNSpatialNormalization, MPSCNNUpsampling, MPSCNNYOLOLoss, MPSNNCropAndResizeBilinear, MPSNNForwardLoss, MPSNNGramMatrixCalculation, MPSNNInitialGradient, MPSNNPad, MPSNNReduceUnary, MPSNNReshape, MPSNNResizeBilinear, MPSNNSlice, MPSRNNImageInferenceLayer

public class MPSCNNKernel
extends MPSKernel
Since:
Available in iOS 10.0 and later.
  • Constructor Details

    • MPSCNNKernel

      public MPSCNNKernel()
    • MPSCNNKernel

      protected MPSCNNKernel​(NSObject.Handle h, long handle)
    • MPSCNNKernel

      protected MPSCNNKernel​(NSObject.SkipInit skipInit)
    • MPSCNNKernel

      public MPSCNNKernel​(MTLDevice device)
    • MPSCNNKernel

      public MPSCNNKernel​(NSCoder decoder, MTLDevice device)
      Since:
      Available in iOS 11.0 and later.
    • MPSCNNKernel

      public MPSCNNKernel​(NSCoder coder)
  • Method Details

    • getOffset

      public MPSOffset getOffset()
    • setOffset

      public void setOffset​(MPSOffset v)
    • getClipRect

      public MTLRegion getClipRect()
    • setClipRect

      public void setClipRect​(MTLRegion v)
    • getDestinationFeatureChannelOffset

      public long getDestinationFeatureChannelOffset()
    • setDestinationFeatureChannelOffset

      public void setDestinationFeatureChannelOffset​(long v)
    • getSourceFeatureChannelOffset

      public long getSourceFeatureChannelOffset()
    • setSourceFeatureChannelOffset

      public void setSourceFeatureChannelOffset​(long v)
    • getSourceFeatureChannelMaxCount

      public long getSourceFeatureChannelMaxCount()
    • setSourceFeatureChannelMaxCount

      public void setSourceFeatureChannelMaxCount​(long v)
    • getEdgeMode

      public MPSImageEdgeMode getEdgeMode()
    • setEdgeMode

      public void setEdgeMode​(MPSImageEdgeMode v)
    • getKernelWidth

      public long getKernelWidth()
    • getKernelHeight

      public long getKernelHeight()
    • getStrideInPixelsX

      public long getStrideInPixelsX()
    • getStrideInPixelsY

      public long getStrideInPixelsY()
    • getDilationRateX

      public long getDilationRateX()
    • getDilationRateY

      public long getDilationRateY()
    • isBackwards

      public boolean isBackwards()
      Since:
      Available in iOS 11.0 and later.
    • isStateModified

      public boolean isStateModified()
      Since:
      Available in iOS 11.3 and later.
    • getPadding

      public MPSNNPadding getPadding()
      Since:
      Available in iOS 11.0 and later.
    • setPadding

      public void setPadding​(MPSNNPadding v)
      Since:
      Available in iOS 11.0 and later.
    • getDestinationImageAllocator

      public MPSImageAllocator getDestinationImageAllocator()
      Since:
      Available in iOS 11.0 and later.
    • setDestinationImageAllocator

      public void setDestinationImageAllocator​(MPSImageAllocator v)
      Since:
      Available in iOS 11.0 and later.
    • supportsSecureCoding

      public static boolean supportsSecureCoding()
    • init

      protected long init​(MTLDevice device)
      Overrides:
      init in class MPSKernel
    • init

      protected long init​(NSCoder decoder, MTLDevice device)
      Overrides:
      init in class MPSKernel
      Since:
      Available in iOS 11.0 and later.
    • encode

      public void encode​(MTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSImage destinationImage)
    • encode

      public void encode​(MTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSState destinationState, MPSImage destinationImage)
      Since:
      Available in iOS 11.3 and later.
    • encodeBatch0

      public void encodeBatch0​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceImages, NSArray<MPSImage> destinationImages)
      Since:
      Available in iOS 11.3 and later.
    • encodeBatch0

      public void encodeBatch0​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceImages, NSArray<? extends MPSState> destinationStates, NSArray<MPSImage> destinationImages)
      Since:
      Available in iOS 11.3 and later.
    • encode

      public MPSImage encode​(MTLCommandBuffer commandBuffer, MPSImage sourceImage)
      Since:
      Available in iOS 11.0 and later.
    • encode

      public MPSImage encode​(MTLCommandBuffer commandBuffer, MPSImage sourceImage, MPSState.MPSStatePtr outState, boolean isTemporary)
      Since:
      Available in iOS 11.3 and later.
    • encodeBatch

      public NSArray<MPSImage> encodeBatch​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceImages)
      Since:
      Available in iOS 11.3 and later.
    • encodeBatch

      public NSArray<MPSImage> encodeBatch​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceImages, NSArray.NSArrayPtr<? extends MPSState> outStates, boolean isTemporary)
      Since:
      Available in iOS 11.3 and later.
    • getResultState

      public MPSState getResultState​(MPSImage sourceImage, NSArray<MPSState> sourceStates, MPSImage destinationImage)
      Since:
      Available in iOS 11.3 and later.
    • getResultStateBatch

      public NSArray<? extends MPSState> getResultStateBatch​(NSArray<MPSImage> sourceImage, NSArray<NSArray<? extends MPSState>> sourceStates, NSArray<MPSImage> destinationImage)
      Since:
      Available in iOS 11.3 and later.
    • getTemporaryResult

      public MPSState getTemporaryResult​(MTLCommandBuffer commandBuffer, MPSImage sourceImage, NSArray<MPSState> sourceStates, MPSImage destinationImage)
      Since:
      Available in iOS 11.3 and later.
    • getTemporaryResultStateBatch

      public NSArray<? extends MPSState> getTemporaryResultStateBatch​(MTLCommandBuffer commandBuffer, NSArray<MPSImage> sourceImage, NSArray<NSArray<? extends MPSState>> sourceStates, NSArray<MPSImage> destinationImage)
      Since:
      Available in iOS 11.3 and later.
    • isResultStateReusedAcrossBatch

      public boolean isResultStateReusedAcrossBatch()
      Since:
      Available in iOS 11.3 and later.
    • appendBatchBarrier

      public boolean appendBatchBarrier()
      Since:
      Available in iOS 11.3 and later.
    • getDestinationImageDescriptor

      public MPSImageDescriptor getDestinationImageDescriptor​(NSArray<MPSImage> sourceImages, NSArray<MPSState> sourceStates)
      Since:
      Available in iOS 11.0 and later.
    • getEncodingStorageSize

      public long getEncodingStorageSize​(MPSImage sourceImage, NSArray<MPSState> sourceStates, MPSImage destinationImage)
      Since:
      Available in iOS 13.0 and later.
    • getBatchEncodingStorageSize

      public long getBatchEncodingStorageSize​(NSArray<MPSImage> sourceImage, NSArray<NSArray<? extends MPSState>> sourceStates, NSArray<MPSImage> destinationImage)
      Since:
      Available in iOS 13.0 and later.