     }
 }
 
-private var _autoCIContext    = UIImage._AutomaticCIContext()
-private var _metalCIContext   = UIImage._MetalBasedCIContext()
-private var _openGLESCIContex = UIImage._OpenGLESBasedCIContext()
+private var _autoCIContext     = UIImage._AutomaticCIContext()
+private var _metalCIContext    = UIImage._MetalBasedCIContext()
+private var _openGLESCIContext = UIImage._OpenGLESBasedCIContext()
 
 /// Get the context of core image with the given render destination.
 private func _ciContext(of dest: UIImage.RenderDestination) -> CIContext! {

        case .metal:
            return _metalCIContext.context
        case .openGLES:
            return _openGLESCIContex.context
        }
    default: return nil
    }

    /// A type representing a core image context using the real-time rendering with Metal.
    fileprivate struct _MetalBasedCIContext {
        lazy var context: CIContext! = { () -> CIContext! in
            guard let device = MTLCreateSystemDefaultDevice() else { return _openGLESCIContext.context }
            return CIContext(mtlDevice: device)
        }()
    }
