Post

Replies

Boosts

Views

Activity

Reply to Help with the (Unsafe) pointer management
Done. matrixC is the object that comes from the output of MPSMatrixMultiplication. let doublePointer = UnsafeMutablePointer<UnsafeMutablePointer<Float>>.allocate(capacity: count)         for i in 0..<matrixC.rows {             doublePointer[i] = rawPointer.advanced(by: i*matrixC.columns).bindMemory(to: Float.self, capacity: matrixC.columns)         }         // print by iterating over 1st row         for i in 0..<10 {             print(doublePointer.pointee[i])         }                  // print by iterating over 1st column         for j in 0..<10 {             print(doublePointer[j].pointee)         }
Nov ’22
Reply to Help with the (Unsafe) pointer management
Done. matrixC is the object that comes from the output of MPSMatrixMultiplication. let doublePointer = UnsafeMutablePointer<UnsafeMutablePointer<Float>>.allocate(capacity: count)         for i in 0..<matrixC.rows {             doublePointer[i] = rawPointer.advanced(by: i*matrixC.columns).bindMemory(to: Float.self, capacity: matrixC.columns)         }         // print by iterating over 1st row         for i in 0..<10 {             print(doublePointer.pointee[i])         }                  // print by iterating over 1st column         for j in 0..<10 {             print(doublePointer[j].pointee)         }
Replies
Boosts
Views
Activity
Nov ’22
Reply to Design libraries for Matrix Multiplication
Closed, being the need to compute with 2 matrix of big datas, let's say 4096 x 4096. Replaced by this post: https://developer.apple.com/forums/thread/719958
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Nov ’22