setComputeDevice(_:for:)
Assigns a compute device for a compute stage.
Declaration
mutating func setComputeDevice(_ computeDevice: MLComputeDevice?, for computeStage: ComputeStage)Parameters
- computeDevice:
The compute device to assign to the compute stage.
- computeStage:
The compute stage.
Discussion
If the parameter computeDevice is `nil`, the framework removes any explicit compute device assignment and allows the framework to select the device.
Configure any compute device for a given compute stage. When performing a request, the system makes a validity check. Use supportedComputeStageDevices to get valid compute devices for a request’s compute stages.