     public static func allocate(capacity: Int) -> UnsafeMutableDevicePointer<Pointee> {
         var pointer: UnsafeMutableRawPointer?
         !!cudaMalloc(&pointer, capacity * MemoryLayout<Pointee>.stride)
-        return UnsafeMutableDevicePointer(pointer!)
+        return UnsafeMutableDevicePointer(pointer!.assumingMemoryBound(to: Pointee.self))
     }
 
     public func deallocate() {


    /// Convert from raw memory address on graphic device
    /// - parameter deviceAddress: address on graphic device
    public init(_ deviceAddress: UnsafeMutableRawPointer) {
        self.deviceAddress = UnsafePointer(deviceAddress.assumingMemoryBound(to: Pointee.self))
    }

    /// Convert from raw memory address on graphic device
    /// - parameter deviceAddress: address on graphic device
    public init(_ deviceAddress: UnsafeRawPointer) {
        self.deviceAddress = deviceAddress.assumingMemoryBound(to: Pointee.self)
    }

    /// Convert from mutable device pointer

    /// UnsafeMutableRawPointer, e.g.
    /// `init(assumingMemoryBoundFrom: UnsafeMutableRawPointer)`
    /// For now, let's leave it as is
    public init(_ deviceAddress: UnsafeMutablePointer<Pointee>) {
        self.deviceAddress = deviceAddress
    }

    /// Convert from other mutable device pointer
