Instance Method

initWithDevice:

Initializes a new kernel object.

Declaration

- (instancetype)initWithDevice:(id<MTLDevice>)device;

Parameters

device

The Metal device on which the kernel will be used.

Return Value

An initialized kernel object.

Discussion

This method fails if the device is not supported. Query the MPSSupportsMTLDevice function to determine whether the device is supported.

See Also

Methods

- copyWithZone:device:

Makes a copy of this kernel object for a new device.