Metal Performance Shaders
This section lists the package's public functionality that corresponds to the Metal Performance Shaders functions. For more information about these functions, or to see which functions have yet to be implemented in this package, please consult the Metal Performance Shaders Documentation.
Matrices and Vectors
Metal.MPS.MPSMatrix — Type
MPSMatrix(mat::MtlMatrix)Metal matrix representation used in Performance Shaders.
Note that this results in a transposed view of the input, as Metal stores matrices row-major instead of column-major.
MPSMatrix(vec::MtlVector)Metal matrix representation used in Performance Shaders.
Note that this results in a transposed view of the input, as Metal stores matrices row-major instead of column-major.
MPSMatrix(arr::MtlArray{T,3})Metal batched matrix representation used in Performance Shaders.
Note that this results in a transposed view of the input, as Metal stores matrices row-major instead of column-major.
Metal.MPS.MPSVector — Type
MPSVector(arr::MtlVector)Metal vector representation used in Performance Shaders.
Matrix Arithmetic Operators
Metal.MPS.matmul! — Function
matmul!(c::MtlMatrix, a::MtlMatrix, b::MtlMatrix, alpha=1, beta=0,
transpose_left=false, transpose_right=false)A MPSMatrixMultiplication kernel that computes: c = alpha * a * b + beta * c
This function should not typically be used. Rather, use the normal LinearAlgebra interface with any MtlArray and it should be accelerated using Metal Performance Shaders.
Metal.MPS.matvecmul! — Function
matvecmul!(c::MtlVector, a::MtlMatrix, b::MtlVector, alpha=1, beta=0, transpose=false)A MPSMatrixVectorMultiplication kernel thay computes: c = alpha * op(a) * b + beta * c
This function should not typically be used. Rather, use the normal LinearAlgebra interface with any MtlArray and it should be accelerated using Metal Performance Shaders.
Metal.MPS.topk — Function
MPS.topk(A::MtlMatrix{T}, k) where {T<:MtlFloat}Compute the top k values and their corresponding indices column-wise in a matrix A. Return the indices in I and the values in V.
k cannot be greater than 16.
Uses MPSMatrixFindTopK.
See also: topk!.
Metal.MPS.topk! — Function
MPS.topk!(A::MtlMatrix{T}, I::MtlMatrix{Int32}, V::MtlMatrix{T}, k)
where {T<:MtlFloat}Compute the top k values and their corresponding indices column-wise in a matrix A. Return the indices in I and the values in V.
k cannot be greater than 16.
Uses MPSMatrixFindTopK.
See also: topk.