clSPARSE  v0.10.0.0
a software library containing Sparse functions written in OpenCL
clSPARSE.h
Go to the documentation of this file.
1 /* ************************************************************************
2  * Copyright 2015 Advanced Micro Devices, Inc.
3  * Copyright 2015 Vratis, Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ************************************************************************ */
17 
23 #pragma once
24 #ifndef _CL_SPARSE_H_
25 #define _CL_SPARSE_H_
26 
27 #ifdef __ALTIVEC__
28 #include <altivec.h>
29 #undef bool
30 #undef vector
31 #endif
32 
33 // CMake-generated file to define export related preprocessor macros
34 #include "clsparse_export.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
42 #if( BUILD_CLVERSION < 200 )
43 #include "clSPARSE-1x.h"
44 #else
45 #error clSPARSE does not yet implement OpenCL 2.0 interfaces
46 #include "clSPARSE-2x.h"
47 #endif
48 
51  typedef enum clsparseStatus_
52  {
55  clsparseSuccess = CL_SUCCESS,
56  clsparseInvalidValue = CL_INVALID_VALUE,
57  clsparseInvalidCommandQueue = CL_INVALID_COMMAND_QUEUE,
58  clsparseInvalidContext = CL_INVALID_CONTEXT,
59  clsparseInvalidMemObject = CL_INVALID_MEM_OBJECT,
60  clsparseInvalidDevice = CL_INVALID_DEVICE,
61  clsparseInvalidEventWaitList = CL_INVALID_EVENT_WAIT_LIST,
62  clsparseInvalidEvent = CL_INVALID_EVENT,
63  clsparseOutOfResources = CL_OUT_OF_RESOURCES,
64  clsparseOutOfHostMemory = CL_OUT_OF_HOST_MEMORY,
65  clsparseInvalidOperation = CL_INVALID_OPERATION,
66  clsparseCompilerNotAvailable = CL_COMPILER_NOT_AVAILABLE,
67  clsparseBuildProgramFailure = CL_BUILD_PROGRAM_FAILURE,
68  clsparseInvalidKernelArgs = CL_INVALID_KERNEL_ARGS,
88  clsparseInvalidSolverControlObject = -2048,
89  clsparseInvalidSystemSize,
90  clsparseIterationsExceeded,
91  clsparseToleranceNotReached,
92  clsparseSolverError,
95 
96 
114  CLSPARSE_EXPORT clsparseStatus
115  clsparseSetup( void );
116 
125  CLSPARSE_EXPORT clsparseStatus
126  clsparseTeardown( void );
127 
140  CLSPARSE_EXPORT clsparseStatus
141  clsparseGetVersion( cl_uint* major, cl_uint* minor, cl_uint* patch, cl_uint* tweak );
161  CLSPARSE_EXPORT clsparseStatus
163 
174  CLSPARSE_EXPORT clsparseStatus
176 
187  CLSPARSE_EXPORT clsparseStatus
189 
200  CLSPARSE_EXPORT clsparseStatus
202 
213  CLSPARSE_EXPORT clsparseStatus
214  cldenseInitMatrix( cldenseMatrix* denseMatx );
229  typedef struct _clsparseControl* clsparseControl;
230 
234  typedef struct _clsparseCreateResult
235  {
236  clsparseStatus status;
237  clsparseControl control;
239 
249  CLSPARSE_EXPORT clsparseCreateResult
250  clsparseCreateControl( cl_command_queue queue );
251 
262  CLSPARSE_EXPORT clsparseStatus
263  clsparseEnableAsync( clsparseControl control, cl_bool async );
264 
276  CLSPARSE_EXPORT clsparseStatus
277  clsparseEnableExtendedPrecision( clsparseControl control, cl_bool extPrecision );
278 
282  typedef struct _clsparseEventResult
283  {
284  clsparseStatus status;
285  cl_event event;
287 
297  CLSPARSE_EXPORT clsparseEventResult
298  clsparseGetEvent( clsparseControl control );
299 
309  CLSPARSE_EXPORT clsparseStatus
310  clsparseReleaseControl( clsparseControl control );
327  typedef enum _print_mode
328  {
329  QUIET = 0,
330  NORMAL,
331  VERBOSE
332  } PRINT_MODE;
333 
339  typedef enum _precond
340  {
341  NOPRECOND = 0,
342  DIAGONAL
343  } PRECONDITIONER;
344 
351  typedef struct _solverControl* clSParseSolverControl;
352 
356  typedef struct _clsparseCreateSolverResult
357  {
358  clsparseStatus status;
359  clSParseSolverControl control;
361 
375  CLSPARSE_EXPORT clsparseCreateSolverResult
376  clsparseCreateSolverControl( PRECONDITIONER precond, cl_int maxIters,
377  cl_double relTol, cl_double absTol );
378 
388  CLSPARSE_EXPORT clsparseStatus
389  clsparseReleaseSolverControl( clSParseSolverControl solverControl );
390 
404  CLSPARSE_EXPORT clsparseStatus
405  clsparseSetSolverParams( clSParseSolverControl solverControl,
406  PRECONDITIONER precond,
407  cl_int maxIters, cl_double relTol, cl_double absTol );
408 
419  CLSPARSE_EXPORT clsparseStatus
420  clsparseSolverPrintMode( clSParseSolverControl solverControl, PRINT_MODE mode );
421 
435  CLSPARSE_EXPORT clsparseStatus
437  clSParseSolverControl solverControl, clsparseControl control );
438 
452  CLSPARSE_EXPORT clsparseStatus
454  clSParseSolverControl solverControl, clsparseControl control );
455 
469  CLSPARSE_EXPORT clsparseStatus
471  clSParseSolverControl solverControl, clsparseControl control );
472 
486  CLSPARSE_EXPORT clsparseStatus
488  clSParseSolverControl solverControl, clsparseControl control );
514  CLSPARSE_EXPORT clsparseStatus
515  clsparseHeaderfromFile( clsparseIdx_t* nnz, clsparseIdx_t* row, clsparseIdx_t* col, const char* filePath);
516 
539  CLSPARSE_EXPORT clsparseStatus
540  clsparseSCooMatrixfromFile( clsparseCooMatrix* cooMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
541 
565  CLSPARSE_EXPORT clsparseStatus
566  clsparseDCooMatrixfromFile( clsparseCooMatrix* cooMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
567 
590  CLSPARSE_EXPORT clsparseStatus
591  clsparseSCsrMatrixfromFile( clsparseCsrMatrix* csrMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
592 
616  CLSPARSE_EXPORT clsparseStatus
617  clsparseDCsrMatrixfromFile( clsparseCsrMatrix* csrMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
618 
623  typedef struct _clsparseMetaSizeResult
624  {
625  clsparseStatus status;
628 
639  CLSPARSE_EXPORT clsparseMetaSizeResult
640  clsparseCsrMetaSize( clsparseCsrMatrix* csrMatx, clsparseControl control );
641 
654  CLSPARSE_EXPORT clsparseStatus
655  clsparseCsrMetaCreate( clsparseCsrMatrix* csrMatx, clsparseControl control );
656 
664  CLSPARSE_EXPORT clsparseStatus
666 
700  CLSPARSE_EXPORT clsparseStatus
702  const clsparseScalar* alpha,
703  const cldenseVector* y,
704  const clsparseControl control );
705 
716  CLSPARSE_EXPORT clsparseStatus
718  const clsparseScalar* alpha,
719  const cldenseVector* y,
720  const clsparseControl control );
721 
733  CLSPARSE_EXPORT clsparseStatus
735  const clsparseScalar* alpha, const cldenseVector* x,
736  const cldenseVector* y,
737  const clsparseControl control );
738 
750  CLSPARSE_EXPORT clsparseStatus
752  const clsparseScalar* alpha, const cldenseVector* x,
753  const cldenseVector* y,
754  const clsparseControl control );
755 
768  CLSPARSE_EXPORT clsparseStatus
770  const clsparseScalar* alpha, const cldenseVector* x,
771  const clsparseScalar* beta,
772  const cldenseVector* y,
773  const clsparseControl control );
774 
787  CLSPARSE_EXPORT clsparseStatus
789  const clsparseScalar* alpha, const cldenseVector* x,
790  const clsparseScalar* beta,
791  const cldenseVector* y,
792  const clsparseControl control );
793 
803  CLSPARSE_EXPORT clsparseStatus
805  const cldenseVector* x,
806  const clsparseControl control );
807 
817  CLSPARSE_EXPORT clsparseStatus
819  const cldenseVector* x,
820  const clsparseControl control );
821 
831  CLSPARSE_EXPORT clsparseStatus
833  const cldenseVector* x,
834  const clsparseControl control );
835 
844  CLSPARSE_EXPORT clsparseStatus
846  const cldenseVector* x,
847  const clsparseControl control );
848 
857  CLSPARSE_EXPORT clsparseStatus
859  const cldenseVector* x,
860  const clsparseControl control );
861 
870  CLSPARSE_EXPORT clsparseStatus
872  const cldenseVector* x,
873  const clsparseControl control );
874 
883  CLSPARSE_EXPORT clsparseStatus
885  const cldenseVector* x,
886  const clsparseControl control );
887 
897  CLSPARSE_EXPORT clsparseStatus
899  const cldenseVector* x,
900  const cldenseVector* y,
901  const clsparseControl control );
902 
912  CLSPARSE_EXPORT clsparseStatus
914  const cldenseVector* x,
915  const cldenseVector* y,
916  const clsparseControl control );
917 
918  /* element-wise operations for dense vectors +, -, *, / */
919 
929  CLSPARSE_EXPORT clsparseStatus
931  const cldenseVector* x,
932  const cldenseVector* y,
933  const clsparseControl control );
934 
944  CLSPARSE_EXPORT clsparseStatus
946  const cldenseVector* x,
947  const cldenseVector* y,
948  const clsparseControl control );
949 
959  CLSPARSE_EXPORT clsparseStatus
961  const cldenseVector* x,
962  const cldenseVector* y,
963  const clsparseControl control );
964 
974  CLSPARSE_EXPORT clsparseStatus
976  const cldenseVector* x,
977  const cldenseVector* y,
978  const clsparseControl control );
979 
989  CLSPARSE_EXPORT clsparseStatus
991  const cldenseVector* x,
992  const cldenseVector* y,
993  const clsparseControl control );
994 
1004  CLSPARSE_EXPORT clsparseStatus
1006  const cldenseVector* x,
1007  const cldenseVector* y,
1008  const clsparseControl control );
1009 
1019  CLSPARSE_EXPORT clsparseStatus
1021  const cldenseVector* x,
1022  const cldenseVector* y,
1023  const clsparseControl control );
1024 
1034  CLSPARSE_EXPORT clsparseStatus
1036  const cldenseVector* x,
1037  const cldenseVector* y,
1038  const clsparseControl control );
1068  CLSPARSE_EXPORT clsparseStatus
1069  clsparseScsrmv( const clsparseScalar* alpha,
1070  const clsparseCsrMatrix* matx,
1071  const cldenseVector* x,
1072  const clsparseScalar* beta,
1073  cldenseVector* y,
1074  const clsparseControl control );
1075 
1091  CLSPARSE_EXPORT clsparseStatus
1092  clsparseDcsrmv( const clsparseScalar* alpha,
1093  const clsparseCsrMatrix* matx,
1094  const cldenseVector* x,
1095  const clsparseScalar* beta,
1096  cldenseVector* y,
1097  const clsparseControl control );
1098 
1099 
1112  CLSPARSE_EXPORT clsparseStatus
1113  clsparseScoomv( const clsparseScalar* alpha,
1114  const clsparseCooMatrix* matx,
1115  const cldenseVector* x,
1116  const clsparseScalar* beta,
1117  cldenseVector* y,
1118  const clsparseControl control );
1119 
1132  CLSPARSE_EXPORT clsparseStatus
1133  clsparseDcoomv( const clsparseScalar* alpha,
1134  const clsparseCooMatrix* matx,
1135  const cldenseVector* x,
1136  const clsparseScalar* beta,
1137  cldenseVector* y,
1138  const clsparseControl control );
1165  CLSPARSE_EXPORT clsparseStatus
1166  clsparseScsrmm( const clsparseScalar* alpha,
1167  const clsparseCsrMatrix* sparseMatA,
1168  const cldenseMatrix* denseMatB,
1169  const clsparseScalar* beta,
1170  cldenseMatrix* denseMatC,
1171  const clsparseControl control );
1172 
1187  CLSPARSE_EXPORT clsparseStatus
1188  clsparseDcsrmm( const clsparseScalar* alpha,
1189  const clsparseCsrMatrix* sparseMatA,
1190  const cldenseMatrix* denseMatB,
1191  const clsparseScalar* beta,
1192  cldenseMatrix* denseMatC,
1193  const clsparseControl control );
1194 
1205  CLSPARSE_EXPORT clsparseStatus
1206  clsparseScsrSpGemm( const clsparseCsrMatrix* sparseMatA,
1207  const clsparseCsrMatrix* sparseMatB,
1208  clsparseCsrMatrix* sparseMatC,
1209  const clsparseControl control );
1231  CLSPARSE_EXPORT clsparseStatus
1232  clsparseScsr2coo( const clsparseCsrMatrix* csr,
1233  clsparseCooMatrix* coo,
1234  const clsparseControl control );
1235 
1245  CLSPARSE_EXPORT clsparseStatus
1246  clsparseDcsr2coo( const clsparseCsrMatrix* csr,
1247  clsparseCooMatrix* coo,
1248  const clsparseControl control );
1249 
1259  CLSPARSE_EXPORT clsparseStatus
1260  clsparseScoo2csr( const clsparseCooMatrix* coo,
1261  clsparseCsrMatrix* csr,
1262  const clsparseControl control );
1263 
1273  CLSPARSE_EXPORT clsparseStatus
1274  clsparseDcoo2csr( const clsparseCooMatrix* coo,
1275  clsparseCsrMatrix* csr,
1276  const clsparseControl control );
1277 
1287  CLSPARSE_EXPORT clsparseStatus
1289  cldenseMatrix* A,
1290  const clsparseControl control );
1291 
1301  CLSPARSE_EXPORT clsparseStatus
1303  cldenseMatrix* A,
1304  clsparseControl control );
1305 
1315  CLSPARSE_EXPORT clsparseStatus
1317  clsparseCsrMatrix* csr,
1318  const clsparseControl control );
1319 
1329  CLSPARSE_EXPORT clsparseStatus
1331  const clsparseControl control );
1334 #ifdef __cplusplus
1335 } // extern C
1336 #endif
1337 
1338 #endif // _CL_SPARSE_H_
CLSPARSE_EXPORT clsparseStatus cldenseDnrm2(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Calculate the double precision L2 norm of a dense vector.
clsparseStatus status
Definition: clSPARSE.h:284
CLSPARSE_EXPORT clsparseStatus cldenseSscale(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *y, const clsparseControl control)
Single precision scale dense vector by a scalar.
CLSPARSE_EXPORT clsparseStatus clsparseReleaseControl(clsparseControl control)
Sets internal control fields to 0 or Null and frees allocated structures.
PRECONDITIONER
Enumeration to select the preconditioning algorithm used to precondition the sparse data before the i...
Definition: clSPARSE.h:339
PRINT_MODE
Enumeration to control the verbosity of the sparse iterative solver routines. VERBOSE will print help...
Definition: clSPARSE.h:327
CLSPARSE_EXPORT clsparseStatus cldenseIreduce(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Reduce integer elements of a dense vector into a scalar value.
A structure returned by value from the clsparseCreateSolverControl function. This serves as result/st...
Definition: clSPARSE.h:356
CLSPARSE_EXPORT clsparseStatus cldenseSmul(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise single precision multiplication of two dense vectors.
CLSPARSE_EXPORT clsparseStatus cldenseDdot(clsparseScalar *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Calculates the double precision dot-product of a dense vector.
clSPARSE-1x.h defines public types specific to OpenCL 1.x API&#39;s. This file is kept as a strictly &#39;C&#39; ...
CLSPARSE_EXPORT clsparseCreateResult clsparseCreateControl(cl_command_queue queue)
Setup the clsparse control object from external OpenCL queue.
A structure returned by value from the clsparseCsrMetaSize function. This serves as a result/status p...
Definition: clSPARSE.h:623
clsparseStatus status
Definition: clSPARSE.h:236
CLSPARSE_EXPORT clsparseStatus clsparseInitScalar(clsparseScalar *scalar)
Initialize a scalar structure to be used in the clsparse library.
Definition: clSPARSE.h:73
cl_event event
Definition: clSPARSE.h:285
CLSPARSE_EXPORT clsparseStatus clsparseCsrMetaDelete(clsparseCsrMatrix *csrMatx)
Delete meta data associated with a CSR encoded matrix.
clsparseStatus status
Definition: clSPARSE.h:358
CLSPARSE_EXPORT clsparseStatus clsparseSCooMatrixfromFile(clsparseCooMatrix *cooMatx, const char *filePath, clsparseControl control, cl_bool read_explicit_zeroes)
Read sparse matrix data from file in single precision COO format.
CLSPARSE_EXPORT clsparseStatus cldenseDsub(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise double precision subtraction of two dense vectors.
CLSPARSE_EXPORT clsparseEventResult clsparseGetEvent(clsparseControl control)
Return an event from the last kernel execution.
CLSPARSE_EXPORT clsparseStatus cldenseSdot(clsparseScalar *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Calculates the single precision dot-product of a dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseScsrcg(cldenseVector *x, const clsparseCsrMatrix *A, const cldenseVector *b, clSParseSolverControl solverControl, clsparseControl control)
Execute a single precision Conjugate Gradients solver.
clSParseSolverControl control
Definition: clSPARSE.h:359
CLSPARSE_EXPORT clsparseStatus clsparseScsrSpGemm(const clsparseCsrMatrix *sparseMatA, const clsparseCsrMatrix *sparseMatB, clsparseCsrMatrix *sparseMatC, const clsparseControl control)
Single Precision CSR Sparse Matrix times Sparse Matrix.
Definition: clSPARSE.h:75
CLSPARSE_EXPORT clsparseStatus cldenseSsub(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise single precision subtraction of two dense vectors.
Definition: clSPARSE.h:80
CLSPARSE_EXPORT clsparseStatus cldenseDnrm1(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Calculate the double precision L1 norm of a dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseCsrMetaCreate(clsparseCsrMatrix *csrMatx, clsparseControl control)
Allocate memory and calculate the meta-data for csr-adaptive SpM-dV algorithm.
CLSPARSE_EXPORT clsparseStatus cldenseSaxpy(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Single precision scale dense vector and add dense vector.
CLSPARSE_EXPORT clsparseStatus cldenseDaxpy(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Double precision scale dense vector and add dense vector.
Definition: clSPARSE.h:82
CLSPARSE_EXPORT clsparseMetaSizeResult clsparseCsrMetaSize(clsparseCsrMatrix *csrMatx, clsparseControl control)
Calculate the amount of device memory required to hold meta-data for csr-adaptive SpM-dV algorithm...
CLSPARSE_EXPORT clsparseStatus cldenseInitMatrix(cldenseMatrix *denseMatx)
Initialize a dense matrix structure to be used in the clsparse library.
Definition: clSPARSE.h:83
CLSPARSE_EXPORT clsparseStatus cldenseSnrm2(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Calculate the single precision L2 norm of a dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseScoo2csr(const clsparseCooMatrix *coo, clsparseCsrMatrix *csr, const clsparseControl control)
Convert a single precision COO encoded sparse matrix into a CSR encoded sparse matrix.
Definition: clSPARSE.h:81
CLSPARSE_EXPORT clsparseStatus clsparseHeaderfromFile(clsparseIdx_t *nnz, clsparseIdx_t *row, clsparseIdx_t *col, const char *filePath)
Read the sparse matrix header from file.
Structure to encapsulate sparse matrix data encoded in CSR form to clSPARSE API.
Definition: clSPARSE-1x.h:60
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2coo(const clsparseCsrMatrix *csr, clsparseCooMatrix *coo, const clsparseControl control)
Convert a double precision CSR encoded sparse matrix into a COO encoded sparse matrix.
CLSPARSE_EXPORT clsparseStatus clsparseDCsrMatrixfromFile(clsparseCsrMatrix *csrMatx, const char *filePath, clsparseControl control, cl_bool read_explicit_zeroes)
Read sparse matrix data from file in double precision CSR format.
CLSPARSE_EXPORT clsparseStatus clsparseScsrmm(const clsparseScalar *alpha, const clsparseCsrMatrix *sparseMatA, const cldenseMatrix *denseMatB, const clsparseScalar *beta, cldenseMatrix *denseMatC, const clsparseControl control)
Single precision CSR sparse matrix times dense matrix.
struct _solverControl * clSParseSolverControl
clSParseSolverControl keeps state relevant for OpenCL operations like kernel execution, memory allocation and synchronization behavior, specifically for sparse iterative solvers
Definition: clSPARSE.h:351
CLSPARSE_EXPORT clsparseStatus clsparseSetup(void)
Initialize the clsparse library.
CLSPARSE_EXPORT clsparseStatus cldenseDdiv(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise double precision division of two dense vectors.
CLSPARSE_EXPORT clsparseStatus clsparseScsr2dense(const clsparseCsrMatrix *csr, cldenseMatrix *A, const clsparseControl control)
Convert a single precision CSR encoded sparse matrix into a dense matrix.
clsparseIdx_t metaSize
Definition: clSPARSE.h:626
CLSPARSE_EXPORT clsparseStatus clsparseTeardown(void)
Finalize the usage of the clsparse library Frees all state allocated by the clsparse runtime and othe...
clSPARSE-2x.h defines public types specific to OpenCL 2.x API&#39;s. This file is kept as a strictly &#39;C&#39; ...
CLSPARSE_EXPORT clsparseStatus clsparseDcsrcg(cldenseVector *x, const clsparseCsrMatrix *A, const cldenseVector *b, clSParseSolverControl solverControl, clsparseControl control)
Execute a double precision Conjugate Gradients solver.
CLSPARSE_EXPORT clsparseCreateSolverResult clsparseCreateSolverControl(PRECONDITIONER precond, cl_int maxIters, cl_double relTol, cl_double absTol)
Create a clSParseSolverControl object to control clsparse iterative solver operations.
CLSPARSE_EXPORT clsparseStatus clsparseDcoo2csr(const clsparseCooMatrix *coo, clsparseCsrMatrix *csr, const clsparseControl control)
Convert a double precision COO encoded sparse matrix into a CSR encoded sparse matrix.
CLSPARSE_EXPORT clsparseStatus cldenseSreduce(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Reduce single precision elements of a dense vector into a scalar value.
CLSPARSE_EXPORT clsparseStatus clsparseDcsr2dense(const clsparseCsrMatrix *csr, cldenseMatrix *A, clsparseControl control)
Convert a double precision CSR encoded sparse matrix into a dense matrix.
CLSPARSE_EXPORT clsparseStatus clsparseGetVersion(cl_uint *major, cl_uint *minor, cl_uint *patch, cl_uint *tweak)
Query for the runtime clsparse library version info.
CLSPARSE_EXPORT clsparseStatus clsparseEnableAsync(clsparseControl control, cl_bool async)
Enable/Disable asynchronous behavior for clSPARSE.
CLSPARSE_EXPORT clsparseStatus clsparseSCsrMatrixfromFile(clsparseCsrMatrix *csrMatx, const char *filePath, clsparseControl control, cl_bool read_explicit_zeroes)
Read sparse matrix data from file in single precision CSR format.
Definition: clSPARSE.h:79
Structure to encapsulate dense matrix data to clSPARSE API.
Definition: clSPARSE-1x.h:127
CLSPARSE_EXPORT clsparseStatus clsparseSetSolverParams(clSParseSolverControl solverControl, PRECONDITIONER precond, cl_int maxIters, cl_double relTol, cl_double absTol)
Set clSParseSolverControl state.
A structure returned by value from the clsparseCreateControl function. This serves as result/status p...
Definition: clSPARSE.h:234
CLSPARSE_EXPORT clsparseStatus clsparseScsr2coo(const clsparseCsrMatrix *csr, clsparseCooMatrix *coo, const clsparseControl control)
Convert a single precision CSR encoded sparse matrix into a COO encoded sparse matrix.
CLSPARSE_EXPORT clsparseStatus clsparseDcsrmm(const clsparseScalar *alpha, const clsparseCsrMatrix *sparseMatA, const cldenseMatrix *denseMatB, const clsparseScalar *beta, cldenseMatrix *denseMatC, const clsparseControl control)
Double precision CSR sparse matrix times dense matrix.
CLSPARSE_EXPORT clsparseStatus cldenseDscale(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *y, const clsparseControl control)
Double precision scale dense vector by a scalar.
CLSPARSE_EXPORT clsparseStatus cldenseSdiv(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise single precision division of two dense vectors.
CLSPARSE_EXPORT clsparseStatus cldenseDadd(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise double precision addition of two dense vectors.
Definition: clSPARSE.h:77
CLSPARSE_EXPORT clsparseStatus cldenseSnrm1(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Calculate the single precision L1 norm of a dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseEnableExtendedPrecision(clsparseControl control, cl_bool extPrecision)
Enable/Disable the use of compensated summation.
cl_uint clsparseIdx_t
An abstraction for the size of indices supported by the library. Clients should use this index type w...
Definition: clSPARSE-xx.h:49
CLSPARSE_EXPORT clsparseStatus clsparseInitVector(cldenseVector *vec)
Initialize a dense vector structure to be used in the clsparse library.
CLSPARSE_EXPORT clsparseStatus clsparseDcsrbicgStab(cldenseVector *x, const clsparseCsrMatrix *A, const cldenseVector *b, clSParseSolverControl solverControl, clsparseControl control)
Execute a double precision Bi-Conjugate Gradients Stabilized solver.
Structure to encapsulate sparse matrix data encoded in COO form to clSPARSE API.
Definition: clSPARSE-1x.h:97
A structure returned by value from the clsparseGetEvent function. This serves as result/status pair f...
Definition: clSPARSE.h:282
CLSPARSE_EXPORT clsparseStatus clsparseInitCsrMatrix(clsparseCsrMatrix *csrMatx)
Initialize a sparse matrix CSR structure to be used in the clsparse library.
CLSPARSE_EXPORT clsparseStatus clsparseDCooMatrixfromFile(clsparseCooMatrix *cooMatx, const char *filePath, clsparseControl control, cl_bool read_explicit_zeroes)
Read sparse matrix data from file in double precision COO format.
Definition: clSPARSE.h:78
CLSPARSE_EXPORT clsparseStatus cldenseDmul(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise double precision multiplication of two dense vectors.
clsparseStatus status
Definition: clSPARSE.h:625
Definition: clSPARSE.h:74
CLSPARSE_EXPORT clsparseStatus clsparseScsrmv(const clsparseScalar *alpha, const clsparseCsrMatrix *matx, const cldenseVector *x, const clsparseScalar *beta, cldenseVector *y, const clsparseControl control)
Single precision CSR sparse matrix times dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseScsrbicgStab(cldenseVector *x, const clsparseCsrMatrix *A, const cldenseVector *b, clSParseSolverControl solverControl, clsparseControl control)
Execute a single precision Bi-Conjugate Gradients Stabilized solver.
CLSPARSE_EXPORT clsparseStatus clsparseScoomv(const clsparseScalar *alpha, const clsparseCooMatrix *matx, const cldenseVector *x, const clsparseScalar *beta, cldenseVector *y, const clsparseControl control)
Single precision COO sparse matrix times dense vector.
Definition: clSPARSE.h:76
CLSPARSE_EXPORT clsparseStatus clsparseSdense2csr(const cldenseMatrix *A, clsparseCsrMatrix *csr, const clsparseControl control)
Convert a single precision dense matrix into a CSR encoded sparse matrix.
CLSPARSE_EXPORT clsparseStatus clsparseDcoomv(const clsparseScalar *alpha, const clsparseCooMatrix *matx, const cldenseVector *x, const clsparseScalar *beta, cldenseVector *y, const clsparseControl control)
Double precision COO sparse matrix times dense vector.
CLSPARSE_EXPORT clsparseStatus clsparseSolverPrintMode(clSParseSolverControl solverControl, PRINT_MODE mode)
Set the verbosity level of the clSParseSolverControl object.
CLSPARSE_EXPORT clsparseStatus cldenseDaxpby(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *x, const clsparseScalar *beta, const cldenseVector *y, const clsparseControl control)
Double precision scale dense vector and add scaled dense vector.
CLSPARSE_EXPORT clsparseStatus cldenseSaxpby(cldenseVector *r, const clsparseScalar *alpha, const cldenseVector *x, const clsparseScalar *beta, const cldenseVector *y, const clsparseControl control)
Single precision scale dense vector and add scaled dense vector.
CLSPARSE_EXPORT clsparseStatus cldenseDreduce(clsparseScalar *s, const cldenseVector *x, const clsparseControl control)
Reduce double precision elements of a dense vector into a scalar value.
CLSPARSE_EXPORT clsparseStatus clsparseInitCooMatrix(clsparseCooMatrix *cooMatx)
Initialize a sparse matrix COO structure to be used in the clsparse library.
CLSPARSE_EXPORT clsparseStatus clsparseReleaseSolverControl(clSParseSolverControl solverControl)
Release a clSParseSolverControl object created with clsparseCreateSolverControl.
CLSPARSE_EXPORT clsparseStatus cldenseSadd(cldenseVector *r, const cldenseVector *x, const cldenseVector *y, const clsparseControl control)
Element-wise single precision addition of two dense vectors.
Structure to encapsulate dense vector data to clSPARSE API.
Definition: clSPARSE-1x.h:43
clsparseStatus
Building for OpenCL version is a compile time decision.
Definition: clSPARSE.h:51
Structure to encapsulate scalar data to clSPARSE API.
Definition: clSPARSE-1x.h:31
clsparseControl control
Definition: clSPARSE.h:237
CLSPARSE_EXPORT clsparseStatus clsparseDdense2csr(const cldenseMatrix *A, clsparseCsrMatrix *csr, const clsparseControl control)
Convert a double precision dense matrix into a CSR encoded sparse matrix.
CLSPARSE_EXPORT clsparseStatus clsparseDcsrmv(const clsparseScalar *alpha, const clsparseCsrMatrix *matx, const cldenseVector *x, const clsparseScalar *beta, cldenseVector *y, const clsparseControl control)
Double precision CSR sparse matrix times dense vector.
struct _clsparseControl * clsparseControl
clsparseControl keeps OpenCL state like kernel execution, memory allocation and synchronization behav...
Definition: clSPARSE.h:229