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 // CMake-generated file to define export related preprocessor macros
28 #include "clsparse_export.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
36 #if( BUILD_CLVERSION < 200 )
37 #include "clSPARSE-1x.h"
38 #else
39 #error clSPARSE does not yet implement OpenCL 2.0 interfaces
40 #include "clSPARSE-2x.h"
41 #endif
42 
45  typedef enum clsparseStatus_
46  {
49  clsparseSuccess = CL_SUCCESS,
50  clsparseInvalidValue = CL_INVALID_VALUE,
51  clsparseInvalidCommandQueue = CL_INVALID_COMMAND_QUEUE,
52  clsparseInvalidContext = CL_INVALID_CONTEXT,
53  clsparseInvalidMemObject = CL_INVALID_MEM_OBJECT,
54  clsparseInvalidDevice = CL_INVALID_DEVICE,
55  clsparseInvalidEventWaitList = CL_INVALID_EVENT_WAIT_LIST,
56  clsparseInvalidEvent = CL_INVALID_EVENT,
57  clsparseOutOfResources = CL_OUT_OF_RESOURCES,
58  clsparseOutOfHostMemory = CL_OUT_OF_HOST_MEMORY,
59  clsparseInvalidOperation = CL_INVALID_OPERATION,
60  clsparseCompilerNotAvailable = CL_COMPILER_NOT_AVAILABLE,
61  clsparseBuildProgramFailure = CL_BUILD_PROGRAM_FAILURE,
62  clsparseInvalidKernelArgs = CL_INVALID_KERNEL_ARGS,
82  clsparseInvalidSolverControlObject = -2048,
83  clsparseInvalidSystemSize,
84  clsparseIterationsExceeded,
85  clsparseToleranceNotReached,
86  clsparseSolverError,
89 
90 
108  CLSPARSE_EXPORT clsparseStatus
109  clsparseSetup( void );
110 
119  CLSPARSE_EXPORT clsparseStatus
120  clsparseTeardown( void );
121 
134  CLSPARSE_EXPORT clsparseStatus
135  clsparseGetVersion( cl_uint* major, cl_uint* minor, cl_uint* patch, cl_uint* tweak );
155  CLSPARSE_EXPORT clsparseStatus
157 
168  CLSPARSE_EXPORT clsparseStatus
170 
181  CLSPARSE_EXPORT clsparseStatus
183 
194  CLSPARSE_EXPORT clsparseStatus
196 
207  CLSPARSE_EXPORT clsparseStatus
208  cldenseInitMatrix( cldenseMatrix* denseMatx );
223  typedef struct _clsparseControl* clsparseControl;
224 
228  typedef struct _clsparseCreateResult
229  {
231  clsparseControl control;
233 
243  CLSPARSE_EXPORT clsparseCreateResult
244  clsparseCreateControl( cl_command_queue queue );
245 
256  CLSPARSE_EXPORT clsparseStatus
257  clsparseEnableAsync( clsparseControl control, cl_bool async );
258 
270  CLSPARSE_EXPORT clsparseStatus
271  clsparseEnableExtendedPrecision( clsparseControl control, cl_bool extPrecision );
272 
276  typedef struct _clsparseEventResult
277  {
279  cl_event event;
281 
291  CLSPARSE_EXPORT clsparseEventResult
292  clsparseGetEvent( clsparseControl control );
293 
303  CLSPARSE_EXPORT clsparseStatus
304  clsparseReleaseControl( clsparseControl control );
321  typedef enum _print_mode
322  {
323  QUIET = 0,
324  NORMAL,
325  VERBOSE
326  } PRINT_MODE;
327 
333  typedef enum _precond
334  {
335  NOPRECOND = 0,
336  DIAGONAL
337  } PRECONDITIONER;
338 
345  typedef struct _solverControl* clSParseSolverControl;
346 
350  typedef struct _clsparseCreateSolverResult
351  {
353  clSParseSolverControl control;
355 
369  CLSPARSE_EXPORT clsparseCreateSolverResult
370  clsparseCreateSolverControl( PRECONDITIONER precond, cl_int maxIters,
371  cl_double relTol, cl_double absTol );
372 
382  CLSPARSE_EXPORT clsparseStatus
383  clsparseReleaseSolverControl( clSParseSolverControl solverControl );
384 
398  CLSPARSE_EXPORT clsparseStatus
399  clsparseSetSolverParams( clSParseSolverControl solverControl,
400  PRECONDITIONER precond,
401  cl_int maxIters, cl_double relTol, cl_double absTol );
402 
413  CLSPARSE_EXPORT clsparseStatus
414  clsparseSolverPrintMode( clSParseSolverControl solverControl, PRINT_MODE mode );
415 
429  CLSPARSE_EXPORT clsparseStatus
431  clSParseSolverControl solverControl, clsparseControl control );
432 
446  CLSPARSE_EXPORT clsparseStatus
448  clSParseSolverControl solverControl, clsparseControl control );
449 
463  CLSPARSE_EXPORT clsparseStatus
465  clSParseSolverControl solverControl, clsparseControl control );
466 
480  CLSPARSE_EXPORT clsparseStatus
482  clSParseSolverControl solverControl, clsparseControl control );
508  CLSPARSE_EXPORT clsparseStatus
509  clsparseHeaderfromFile( clsparseIdx_t* nnz, clsparseIdx_t* row, clsparseIdx_t* col, const char* filePath);
510 
533  CLSPARSE_EXPORT clsparseStatus
534  clsparseSCooMatrixfromFile( clsparseCooMatrix* cooMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
535 
559  CLSPARSE_EXPORT clsparseStatus
560  clsparseDCooMatrixfromFile( clsparseCooMatrix* cooMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
561 
584  CLSPARSE_EXPORT clsparseStatus
585  clsparseSCsrMatrixfromFile( clsparseCsrMatrix* csrMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
586 
610  CLSPARSE_EXPORT clsparseStatus
611  clsparseDCsrMatrixfromFile( clsparseCsrMatrix* csrMatx, const char* filePath, clsparseControl control, cl_bool read_explicit_zeroes );
612 
617  typedef struct _clsparseMetaSizeResult
618  {
622 
633  CLSPARSE_EXPORT clsparseMetaSizeResult
634  clsparseCsrMetaSize( clsparseCsrMatrix* csrMatx, clsparseControl control );
635 
648  CLSPARSE_EXPORT clsparseStatus
649  clsparseCsrMetaCreate( clsparseCsrMatrix* csrMatx, clsparseControl control );
650 
658  CLSPARSE_EXPORT clsparseStatus
660 
694  CLSPARSE_EXPORT clsparseStatus
696  const clsparseScalar* alpha,
697  const cldenseVector* y,
698  const clsparseControl control );
699 
710  CLSPARSE_EXPORT clsparseStatus
712  const clsparseScalar* alpha,
713  const cldenseVector* y,
714  const clsparseControl control );
715 
727  CLSPARSE_EXPORT clsparseStatus
729  const clsparseScalar* alpha, const cldenseVector* x,
730  const cldenseVector* y,
731  const clsparseControl control );
732 
744  CLSPARSE_EXPORT clsparseStatus
746  const clsparseScalar* alpha, const cldenseVector* x,
747  const cldenseVector* y,
748  const clsparseControl control );
749 
762  CLSPARSE_EXPORT clsparseStatus
764  const clsparseScalar* alpha, const cldenseVector* x,
765  const clsparseScalar* beta,
766  const cldenseVector* y,
767  const clsparseControl control );
768 
781  CLSPARSE_EXPORT clsparseStatus
783  const clsparseScalar* alpha, const cldenseVector* x,
784  const clsparseScalar* beta,
785  const cldenseVector* y,
786  const clsparseControl control );
787 
797  CLSPARSE_EXPORT clsparseStatus
799  const cldenseVector* x,
800  const clsparseControl control );
801 
811  CLSPARSE_EXPORT clsparseStatus
813  const cldenseVector* x,
814  const clsparseControl control );
815 
825  CLSPARSE_EXPORT clsparseStatus
827  const cldenseVector* x,
828  const clsparseControl control );
829 
838  CLSPARSE_EXPORT clsparseStatus
840  const cldenseVector* x,
841  const clsparseControl control );
842 
851  CLSPARSE_EXPORT clsparseStatus
853  const cldenseVector* x,
854  const clsparseControl control );
855 
864  CLSPARSE_EXPORT clsparseStatus
866  const cldenseVector* x,
867  const clsparseControl control );
868 
877  CLSPARSE_EXPORT clsparseStatus
879  const cldenseVector* x,
880  const clsparseControl control );
881 
891  CLSPARSE_EXPORT clsparseStatus
893  const cldenseVector* x,
894  const cldenseVector* y,
895  const clsparseControl control );
896 
906  CLSPARSE_EXPORT clsparseStatus
908  const cldenseVector* x,
909  const cldenseVector* y,
910  const clsparseControl control );
911 
912  /* element-wise operations for dense vectors +, -, *, / */
913 
923  CLSPARSE_EXPORT clsparseStatus
925  const cldenseVector* x,
926  const cldenseVector* y,
927  const clsparseControl control );
928 
938  CLSPARSE_EXPORT clsparseStatus
940  const cldenseVector* x,
941  const cldenseVector* y,
942  const clsparseControl control );
943 
953  CLSPARSE_EXPORT clsparseStatus
955  const cldenseVector* x,
956  const cldenseVector* y,
957  const clsparseControl control );
958 
968  CLSPARSE_EXPORT clsparseStatus
970  const cldenseVector* x,
971  const cldenseVector* y,
972  const clsparseControl control );
973 
983  CLSPARSE_EXPORT clsparseStatus
985  const cldenseVector* x,
986  const cldenseVector* y,
987  const clsparseControl control );
988 
998  CLSPARSE_EXPORT clsparseStatus
1000  const cldenseVector* x,
1001  const cldenseVector* y,
1002  const clsparseControl control );
1003 
1013  CLSPARSE_EXPORT clsparseStatus
1015  const cldenseVector* x,
1016  const cldenseVector* y,
1017  const clsparseControl control );
1018 
1028  CLSPARSE_EXPORT clsparseStatus
1030  const cldenseVector* x,
1031  const cldenseVector* y,
1032  const clsparseControl control );
1062  CLSPARSE_EXPORT clsparseStatus
1063  clsparseScsrmv( const clsparseScalar* alpha,
1064  const clsparseCsrMatrix* matx,
1065  const cldenseVector* x,
1066  const clsparseScalar* beta,
1067  cldenseVector* y,
1068  const clsparseControl control );
1069 
1085  CLSPARSE_EXPORT clsparseStatus
1086  clsparseDcsrmv( const clsparseScalar* alpha,
1087  const clsparseCsrMatrix* matx,
1088  const cldenseVector* x,
1089  const clsparseScalar* beta,
1090  cldenseVector* y,
1091  const clsparseControl control );
1092 
1093 
1106  CLSPARSE_EXPORT clsparseStatus
1107  clsparseScoomv( const clsparseScalar* alpha,
1108  const clsparseCooMatrix* matx,
1109  const cldenseVector* x,
1110  const clsparseScalar* beta,
1111  cldenseVector* y,
1112  const clsparseControl control );
1113 
1126  CLSPARSE_EXPORT clsparseStatus
1127  clsparseDcoomv( const clsparseScalar* alpha,
1128  const clsparseCooMatrix* matx,
1129  const cldenseVector* x,
1130  const clsparseScalar* beta,
1131  cldenseVector* y,
1132  const clsparseControl control );
1159  CLSPARSE_EXPORT clsparseStatus
1160  clsparseScsrmm( const clsparseScalar* alpha,
1161  const clsparseCsrMatrix* sparseMatA,
1162  const cldenseMatrix* denseMatB,
1163  const clsparseScalar* beta,
1164  cldenseMatrix* denseMatC,
1165  const clsparseControl control );
1166 
1181  CLSPARSE_EXPORT clsparseStatus
1182  clsparseDcsrmm( const clsparseScalar* alpha,
1183  const clsparseCsrMatrix* sparseMatA,
1184  const cldenseMatrix* denseMatB,
1185  const clsparseScalar* beta,
1186  cldenseMatrix* denseMatC,
1187  const clsparseControl control );
1188 
1199  CLSPARSE_EXPORT clsparseStatus
1200  clsparseScsrSpGemm( const clsparseCsrMatrix* sparseMatA,
1201  const clsparseCsrMatrix* sparseMatB,
1202  clsparseCsrMatrix* sparseMatC,
1203  const clsparseControl control );
1225  CLSPARSE_EXPORT clsparseStatus
1226  clsparseScsr2coo( const clsparseCsrMatrix* csr,
1227  clsparseCooMatrix* coo,
1228  const clsparseControl control );
1229 
1239  CLSPARSE_EXPORT clsparseStatus
1240  clsparseDcsr2coo( const clsparseCsrMatrix* csr,
1241  clsparseCooMatrix* coo,
1242  const clsparseControl control );
1243 
1253  CLSPARSE_EXPORT clsparseStatus
1254  clsparseScoo2csr( const clsparseCooMatrix* coo,
1255  clsparseCsrMatrix* csr,
1256  const clsparseControl control );
1257 
1267  CLSPARSE_EXPORT clsparseStatus
1268  clsparseDcoo2csr( const clsparseCooMatrix* coo,
1269  clsparseCsrMatrix* csr,
1270  const clsparseControl control );
1271 
1281  CLSPARSE_EXPORT clsparseStatus
1283  cldenseMatrix* A,
1284  const clsparseControl control );
1285 
1295  CLSPARSE_EXPORT clsparseStatus
1297  cldenseMatrix* A,
1298  clsparseControl control );
1299 
1309  CLSPARSE_EXPORT clsparseStatus
1311  clsparseCsrMatrix* csr,
1312  const clsparseControl control );
1313 
1323  CLSPARSE_EXPORT clsparseStatus
1325  const clsparseControl control );
1328 #ifdef __cplusplus
1329 } // extern C
1330 #endif
1331 
1332 #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:278
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:333
PRINT_MODE
Enumeration to control the verbosity of the sparse iterative solver routines. VERBOSE will print help...
Definition: clSPARSE.h:321
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:350
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's. This file is kept as a strictly 'C' ...
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:617
clsparseStatus status
Definition: clSPARSE.h:230
CLSPARSE_EXPORT clsparseStatus clsparseInitScalar(clsparseScalar *scalar)
Initialize a scalar structure to be used in the clsparse library.
Definition: clSPARSE.h:67
cl_event event
Definition: clSPARSE.h:279
CLSPARSE_EXPORT clsparseStatus clsparseCsrMetaDelete(clsparseCsrMatrix *csrMatx)
Delete meta data associated with a CSR encoded matrix.
clsparseStatus status
Definition: clSPARSE.h:352
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:353
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:69
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:74
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:76
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:77
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:75
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:345
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:620
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's. This file is kept as a strictly 'C' ...
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:73
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:228
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:71
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:276
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:72
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:619
Definition: clSPARSE.h:68
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:70
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:45
Structure to encapsulate scalar data to clSPARSE API.
Definition: clSPARSE-1x.h:31
clsparseControl control
Definition: clSPARSE.h:231
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:223