How to cast UnsafeMutableRawPointer! to UnsafeMutablePointer<Float> in Swift 3.0 or newer?
Use assumingMemoryBound(to:)
:
Returns a typed pointer to the memory referenced by this pointer, assuming that the memory is already bound to the specified type.
In your case:
let leftOp = left.buffer.data.assumingMemoryBound(to: Float.self)
let rightOp = right.buffer.data.assumingMemoryBound(to: Float.self)
// ...
See UnsafeRawPointer Migration for more information.