Protocol

MTLComputePipelineState

An object that contains a compiled compute pipeline.

Declaration

@protocol MTLComputePipelineState

Overview

A MTLComputePipelineState object is a lightweight object used to refer to a compiled compute program. A MTLComputePipelineState object is fully thread-safe and can be used by many MTLComputeCommandEncoder objects at once.

Creating compute pipeline state objects can be expensive, so you usually create these pipeline objects when your app is initialized and reuse them throughout its lifetime. You do not use standard allocation and initialization techniques to create a MTLComputePipelineState object. Instead, you create these objects by calling methods on a MTLDevice object. For a list of creation methods, see Creating a Compute Pipeline.

Topics

Querying Threadgroup Attributes

maxTotalThreadsPerThreadgroup

The maximum number of threads in a threadgroup that can be dispatched using the pipeline.

Required.

threadExecutionWidth

The number of threads that are executed simultaneously by the GPU.

Required.

staticThreadgroupMemoryLength

The length, in bytes, of threadgroup memory that is statically allocated.

Required.

Identifying Properties

device

The Metal device from which the pipeline state was created.

Required.

label

A string that identifies the compute pipeline state object.

Required.

Querying Imageblock Length

- imageblockMemoryLengthForDimensions:

Returns the imageblock memory length, in bytes, for the given imageblock dimensions.

Required.

Instance Properties

Relationships

Inherits From

See Also

Parallel Computation

Hello Compute

Demonstrates how to perform data-parallel computations using the GPU.

About Threads and Threadgroups

Learn how Metal organizes compute-processing workloads.

Calculating Threadgroup and Grid Sizes

Calculate the optimum sizes for threadgroups and grids when dispatching compute-processing workloads.

MTLComputePipelineDescriptor

An object used to customize how a new compute pipeline state object is compiled.

MTLComputeCommandEncoder

An object used to encode commands in a compute pass.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software