-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,7 @@ include("decomposition.jl") | |
# matrix copy | ||
include("copy.jl") | ||
|
||
# solver | ||
include("solve.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
export MPSMatrixSolveLU | ||
|
||
@objcwrapper immutable=false MPSMatrixSolveLU <: MPSMatrixBinaryKernel | ||
|
||
function MPSMatrixSolveLU(device, transpose, order, numberOfRightHandSides) | ||
kernel = @objc [MPSMatrixSolveLU alloc]::id{MPSMatrixSolveLU} | ||
obj = MPSMatrixSolveLU(kernel) | ||
finalizer(release, obj) | ||
@objc [obj::id{MPSMatrixSolveLU} initWithDevice:device::id{MTLDevice} | ||
transpose:transpose::Bool | ||
order:order::NSUInteger | ||
numberOfRightHandSides:numberOfRightHandSides::NSUInteger]::id{MPSMatrixSolveLU} | ||
return obj | ||
end | ||
|
||
function encode!(cmdbuf::MTLCommandBuffer, kernel::MPSMatrixSolveLU, sourceMatrix, rightHandSideMatrix, pivotIndices, solutionMatrix) | ||
@objc [kernel::id{MPSMatrixSolveLU} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer} | ||
sourceMatrix:sourceMatrix::id{MPSMatrix} | ||
rightHandSideMatrix:rightHandSideMatrix::id{MPSMatrix} | ||
pivotIndices:pivotIndices::id{MPSMatrix} | ||
solutionMatrix:solutionMatrix::id{MPSMatrix}]::Nothing | ||
end | ||
|
||
|
||
export MPSMatrixSolveTriangular | ||
|
||
@objcwrapper immutable=false MPSMatrixSolveTriangular <: MPSMatrixBinaryKernel | ||
|
||
function MPSMatrixSolveTriangular(device, right, upper, transpose, unit, order, numberOfRightHandSides, alpha) | ||
kernel = @objc [MPSMatrixSolveTriangular alloc]::id{MPSMatrixSolveTriangular} | ||
obj = MPSMatrixSolveTriangular(kernel) | ||
finalizer(release, obj) | ||
@objc [obj::id{MPSMatrixSolveTriangular} initWithDevice:device::id{MTLDevice} | ||
right:right::Bool | ||
upper:upper::Bool | ||
transpose:transpose::Bool | ||
unit:unit::Bool | ||
order:order::NSUInteger | ||
numberOfRightHandSides:numberOfRightHandSides::NSUInteger | ||
alpha:alpha::Cdouble]::id{MPSMatrixSolveTriangular} | ||
return obj | ||
end | ||
|
||
function encode!(cmdbuf::MTLCommandBuffer, kernel::MPSMatrixSolveTriangular, sourceMatrix, rightHandSideMatrix, solutionMatrix) | ||
@objc [kernel::id{MPSMatrixSolveTriangular} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer} | ||
sourceMatrix:sourceMatrix::id{MPSMatrix} | ||
rightHandSideMatrix:rightHandSideMatrix::id{MPSMatrix} | ||
solutionMatrix:solutionMatrix::id{MPSMatrix}]::Nothing | ||
end | ||
|
||
|
||
export MPSMatrixSolveCholesky | ||
|
||
@objcwrapper immutable=false MPSMatrixSolveCholesky <: MPSMatrixBinaryKernel | ||
|
||
function MPSMatrixSolveCholesky(device, upper, order, numberOfRightHandSides) | ||
kernel = @objc [MPSMatrixSolveCholesky alloc]::id{MPSMatrixSolveCholesky} | ||
obj = MPSMatrixSolveCholesky(kernel) | ||
finalizer(release, obj) | ||
@objc [obj::id{MPSMatrixSolveCholesky} initWithDevice:device::id{MTLDevice} | ||
upper:upper::Bool | ||
order:order::NSUInteger | ||
numberOfRightHandSides:numberOfRightHandSides::NSUInteger]::id{MPSMatrixSolveCholesky} | ||
return obj | ||
end | ||
|
||
function encode!(cmdbuf::MTLCommandBuffer, kernel::MPSMatrixSolveCholesky, sourceMatrix, rightHandSideMatrix, solutionMatrix) | ||
@objc [kernel::id{MPSMatrixSolveCholesky} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer} | ||
sourceMatrix:sourceMatrix::id{MPSMatrix} | ||
rightHandSideMatrix:rightHandSideMatrix::id{MPSMatrix} | ||
solutionMatrix:solutionMatrix::id{MPSMatrix}]::Nothing | ||
end |