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
— TypeMPSMatrix(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
— TypeMPSVector(arr::MtlVector)
Metal vector representation used in Performance Shaders.
Matrix Arithmetic Operators
Metal.MPS.matmul!
— FunctionmatMulMPS(a::MtlMatrix, b::MtlMatrix, c::MtlMatrix, alpha=1, beta=1,
transpose_left=false, transpose_right=false)
A MPSMatrixMultiplication
kernel thay computes: c = alpha * op(a) * beta * op(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!
— Functionmatvecmul!(c::MtlVector, a::MtlMatrix, b::MtlVector, alpha=1, beta=1, 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
— FunctionMPS.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!
.
This interface is experimental, and might change without warning.
Metal.MPS.topk!
— FunctionMPS.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
.
This interface is experimental, and might change without warning.