-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathsolve.jl
77 lines (61 loc) · 4.08 KB
/
solve.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
export MPSMatrixSolveTriangular
# @objcwrapper immutable=false MPSMatrixSolveTriangular <: MPSMatrixUnaryKernel
function MPSMatrixSolveTriangular(device, right, upper, 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::Float64]::id{MPSMatrixSolveTriangular}
return obj
end
function encode!(cmdbuf::MTLCommandBuffer, kernel::MPSMatrixSolveTriangular, sourceMatrix, resultMatrix, pivotIndices, status)
@objc [kernel::id{MPSMatrixSolveTriangular} encodeToCommandBuffer:cmdbuf::id{MTLCommandBuffer}
sourceMatrix:sourceMatrix::id{MPSMatrix}
resultMatrix:resultMatrix::id{MPSMatrix}
pivotIndices:pivotIndices::id{MPSMatrix}
status:status::id{MPSMatrix}]::Nothing
end
export MPSMatrixSolveLU
# @objcwrapper immutable=false MPSMatrixSolveLU <: MPSMatrixUnaryKernel
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 MPSMatrixSolveCholesky
# @objcwrapper immutable=false MPSMatrixSolveCholesky <: MPSMatrixUnaryKernel
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}
pivotIndices:pivotIndices::id{MPSMatrix}
solutionMatrix:solutionMatrix::id{MPSMatrix}]::Nothing
end