             encoder.setBytes(&uz0, length: sizeofValue(uz0), atIndex: 5)
             encoder.setBytes(&inv, length: sizeofValue(inv), atIndex: 6)
 
-            let function = device.newDefaultLibrary()!.newFunctionWithName("maskImage")!
             let pipeline = try! device.newComputePipelineStateWithFunction(function)
             encoder.setComputePipelineState(pipeline)
             let threadExeWidth = pipeline.threadExecutionWidth

    
    var image:UIImage!
    var delegate:SNTrimControllerDelegate!

    private let borderView:UIView = {
        let borderView = UIView()

//
extension SNTrimController: SNTrimColorPickerDelegate {
    func updateMaskColor(color:UIColor?, fPlus:Bool) {
        guard let device = SNTrimController.device,
              let function = self.function else {
            print("SNTrim No Metal. User CPU")
            return updateMaskColorCPU(color, fPlus: fPlus)
        }
