Skip to content

Commit c8d4a9e

Browse files
committed
remove SubArray constructor
1 parent d4a9ccb commit c8d4a9e

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

lib/mps/matrix.jl

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,32 +136,6 @@ function MPSMatrix(arr::MtlArray{T,3}) where T
136136
return obj
137137
end
138138

139-
140-
"""
141-
MPSMatrix(arr::MtlMatrix)
142-
143-
Metal matrix representation used in Performance Shaders.
144-
145-
Note that this results in a transposed view of the input,
146-
as Metal stores matrices row-major instead of column-major.
147-
"""
148-
function MPSMatrix(arr::SubArray{T,2,MtlArray{T,3}}) where T
149-
n_cols, n_rows = size(arr)
150-
row_bytes = sizeof(T)*n_cols
151-
index = parentindices(arr)[3]
152-
offset = row_bytes * n_cols * (index-1)
153-
desc = MPSMatrixDescriptor(n_rows, n_cols, row_bytes, T)
154-
mat = @objc [MPSMatrix alloc]::id{MPSMatrix}
155-
obj = MPSMatrix(mat)
156-
finalizer(release, obj)
157-
@objc [obj::id{MPSMatrix} initWithBuffer:parent(arr).buffer::id{MTLBuffer}
158-
offset:offset::NSUInteger
159-
descriptor:desc::id{MPSMatrixDescriptor}]::id{MPSMatrix}
160-
return obj
161-
end
162-
163-
### parentindices(A)
164-
165139
#
166140
# matrix multiplication
167141
#

0 commit comments

Comments
 (0)