Encodes GPU commands to evaluate the custom layer.
- iOS 11.2+
- macOS 10.13.2+
- Mac Catalyst 13.0+Beta
- tvOS 11.2+
- watchOS 4.2+
- Core ML
The command buffer that defines the work performed on the GPU.
The array of textures representing the input to be evaluated.
The array of textures representing the outputs to be populated by evaluating the inputs.
Implement this method to use the GPU to evaluate your layer. Fill the command buffer with the necessary commands to evaluate the layer on the GPU. For performance reasons, cache any
MTLCompute objects that you create, to reuse on subsequent calls.
Core ML executes the command buffer, so this method shouldn't commit the buffer. It should only prepare the command buffer and return.
Implementing this method doesn't guarantee that the layer will be evaluated on the GPU; system conditions might constrain computation to the CPU. If this method is not provided,
evaluate(inputs: will be used.
For more information about using the GPU for general purpose programming, see Compute Processing.