One Logo Pool Ball
CoreML · IOS API REFERENCE

MLComputePolicy

struct · iOS 18.0+ · SDK 27.1

struct MLComputePolicy

The compute policy determining what compute device, or compute devices, to execute ML workloads on.

Members (5)

get · iOS 18.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of the compute policy.

get · iOS 18.0+

customMirror

TypeScript
get customMirror(): SDKHandle
Swift declaration
var customMirror: Mirror { get }

The custom mirror for `MLComputePolicy`.

get · iOS 18.0+

cpuOnly

TypeScript
static get cpuOnly(): MLComputePolicy
Swift declaration
static var cpuOnly: MLComputePolicy { get }

Execute ML workloads using the CPU.

get · iOS 18.0+

cpuAndGPU

TypeScript
static get cpuAndGPU(): MLComputePolicy
Swift declaration
static var cpuAndGPU: MLComputePolicy { get }

Execute ML workloads using the GPU if available, otherwise falling back to the CPU.

init · iOS 18.0+

init

TypeScript
static init(computeUnits: MLComputeUnits): MLComputePolicy
Swift declaration
init(_ computeUnits: MLComputeUnits)

Creates a new compute policy using the given compute units.

Skipped declarations

No declarations were skipped in this snapshot.

All CoreML types →