OpenCL linear algebra functions. More...
Classes | |
| class | CLImgSparseMatrix |
| Builds a new OpenCL Image2D containig a sparse matrix. More... | |
| class | CLImgVector |
| Builds a new OpenCL Image2D containing vector data. More... | |
| class | CLLinalgSrc |
| OpenCL dot product source. | |
Public Member Functions | |
| SparseLinalg () | |
| Constructor. | |
| float | DotProduct (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called. | |
| float | DotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL. | |
| double | ExactDotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL, in double precision. | |
| void | Multiply (CLImgSparseMatrix M, CLImgVector x, CLImgVector y) |
| Computes M*x and stores the result in y. Does not automatically read result from device memory. | |
| double[] | ExactMultiply (CLImgSparseMatrix M, CLImgVector x) |
| Computes exact double-precision product of sparse matrix M and vector x. | |
| float[] | MultiplyNoCL (CLImgSparseMatrix M, CLImgVector x) |
| Computes product of sparse matrix M and vector x. | |
| float[] | LinSolveNoCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. | |
| float[] | LinSolveCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low. | |
| void | LinSolveCLStep (CLImgSparseMatrix M, CLImgVector b, float tol, ref CLImgVector x) |
| Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained. | |
| SparseLinalg () | |
| Constructor. | |
| float | DotProduct (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called. | |
| float | DotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL. | |
| double | ExactDotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL, in double precision. | |
| void | Multiply (CLImgSparseMatrix M, CLImgVector x, CLImgVector y) |
| Computes M*x and stores the result in y. Does not automatically read result from device memory. | |
| double[] | ExactMultiply (CLImgSparseMatrix M, CLImgVector x) |
| Computes exact double-precision product of sparse matrix M and vector x. | |
| float[] | MultiplyNoCL (CLImgSparseMatrix M, CLImgVector x) |
| Computes product of sparse matrix M and vector x. | |
| float[] | LinSolveNoCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. | |
| float[] | LinSolveCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low. | |
| void | LinSolveCLStep (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained. | |
| SparseLinalg () | |
| Constructor. | |
| float | DotProduct (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called. | |
| float | DotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL. | |
| double | ExactDotProductNoCL (CLImgVector v1, CLImgVector v2) |
| Computes dot product of 2 vectors without OpenCL, in double precision. | |
| void | Multiply (CLImgSparseMatrix M, CLImgVector x, CLImgVector y) |
| Computes M*x and stores the result in y. Does not automatically read result from device memory. | |
| double[] | ExactMultiply (CLImgSparseMatrix M, CLImgVector x) |
| Computes exact double-precision product of sparse matrix M and vector x. | |
| float[] | MultiplyNoCL (CLImgSparseMatrix M, CLImgVector x) |
| Computes product of sparse matrix M and vector x. | |
| float[] | LinSolveNoCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. | |
| float[] | LinSolveCL (CLImgSparseMatrix M, CLImgVector b, float tol) |
| Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low. | |
| void | LinSolveCLStep (CLImgSparseMatrix M, CLImgVector b, float tol, ref CLImgVector x) |
| Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained. | |
Public Attributes | |
| const int | IMGWIDTH = 4096 |
| Width to be used in float4's. | |
| const int | GLOBALWORKSIZE = 2048 |
| Total number of workers. | |
| CLImgVector | x |
| Initial guess/answer holder. | |
Static Public Attributes | |
| static int | MAXITER = 8 |
| Maximum number of iterations. | |
OpenCL linear algebra functions.
| OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg | ( | ) |
Constructor.
| OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg | ( | ) |
Constructor.
| OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg | ( | ) |
Constructor.
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProduct | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called.
| v1 | First vector | |
| v2 | Second vector |
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProduct | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called.
| v1 | First vector | |
| v2 | Second vector |
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProduct | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors using their OpenCL images. Assumes data has been inserted to VectorData and WriteToDevice() has been called.
| v1 | First vector | |
| v2 | Second vector |
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL.
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL.
| float OpenCLTemplate.LinearAlgebra.SparseLinalg.DotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL.
| double OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactDotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL, in double precision.
| double OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactDotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL, in double precision.
| double OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactDotProductNoCL | ( | CLImgVector | v1, | |
| CLImgVector | v2 | |||
| ) |
Computes dot product of 2 vectors without OpenCL, in double precision.
| double [] OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactMultiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes exact double-precision product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| double [] OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactMultiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes exact double-precision product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| double [] OpenCLTemplate.LinearAlgebra.SparseLinalg.ExactMultiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes exact double-precision product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Writes variables to Device memory. Improves solution if accuracy is low.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCLStep | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol, | |||
| ref CLImgVector | x | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance | |
| x | Initial guess |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCLStep | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveCLStep | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol, | |||
| ref CLImgVector | x | |||
| ) |
Solves linear system Mx = b using conjugate gradient method. Doesn't try to improve the solution obtained.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance | |
| x | Initial guess |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.LinSolveNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | b, | |||
| float | tol | |||
| ) |
Solves linear system Mx = b using conjugate gradient method.
| M | Matrix M | |
| b | Vector b | |
| tol | Error tolerance |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.Multiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x, | |||
| CLImgVector | y | |||
| ) |
Computes M*x and stores the result in y. Does not automatically read result from device memory.
| M | Sparse matrix | |
| x | Vector to be multiplied | |
| y | Result |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.Multiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x, | |||
| CLImgVector | y | |||
| ) |
Computes M*x and stores the result in y. Does not automatically read result from device memory.
| M | Sparse matrix | |
| x | Vector to be multiplied | |
| y | Result |
| void OpenCLTemplate.LinearAlgebra.SparseLinalg.Multiply | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x, | |||
| CLImgVector | y | |||
| ) |
Computes M*x and stores the result in y. Does not automatically read result from device memory.
| M | Sparse matrix | |
| x | Vector to be multiplied | |
| y | Result |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.MultiplyNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.MultiplyNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| float [] OpenCLTemplate.LinearAlgebra.SparseLinalg.MultiplyNoCL | ( | CLImgSparseMatrix | M, | |
| CLImgVector | x | |||
| ) |
Computes product of sparse matrix M and vector x.
| M | Sparse matrix | |
| x | Vector to be multiplied |
| const int OpenCLTemplate::LinearAlgebra.SparseLinalg::GLOBALWORKSIZE = 2048 |
Total number of workers.
| const int OpenCLTemplate::LinearAlgebra.SparseLinalg::IMGWIDTH = 4096 |
Width to be used in float4's.
static int OpenCLTemplate::LinearAlgebra.SparseLinalg::MAXITER = 8 [static] |
Maximum number of iterations.
Initial guess/answer holder.
1.6.3