OpenCLTemplate.LinearAlgebra.SparseLinalg Class Reference

OpenCL linear algebra functions. More...

List of all members.

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.

Detailed Description

OpenCL linear algebra functions.


Constructor & Destructor Documentation

OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg (  ) 

Constructor.

OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg (  ) 

Constructor.

OpenCLTemplate.LinearAlgebra.SparseLinalg.SparseLinalg (  ) 

Constructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
M Sparse matrix
x Vector to be multiplied

Member Data Documentation

Total number of workers.

Width to be used in float4's.

Maximum number of iterations.

Initial guess/answer holder.

Generated on Sun Dec 4 17:27:04 2011 for OpenCLTemplate by  doxygen 1.6.3