vendor/scs/linsys/gpu/gpu.h in scs-0.2.2 vs vendor/scs/linsys/gpu/gpu.h in scs-0.2.3

- old
+ new

@@ -32,10 +32,11 @@ #define CUSPARSE(x) cusparseD##x #else #define CUBLAS(x) cublasS##x #define CUSPARSE(x) cusparseS##x #endif +#define CUSPARSE_GEN(x) cusparse##x #else #ifndef SFLOAT #define CUBLAS(x) \ CUDA_CHECK_ERR; \ cublasD##x @@ -48,12 +49,30 @@ cublasS##x #define CUSPARSE(x) \ CUDA_CHECK_ERR; \ cusparseS##x #endif +#define CUSPARSE_GEN(x) \ + CUDA_CHECK_ERR; \ + cusparse##x #endif +#ifndef SFLOAT +#define SCS_CUDA_FLOAT CUDA_R_64F +#else +#define SCS_CUDA_FLOAT CUDA_R_32F +#endif + +#ifndef DLONG +#define SCS_CUSPARSE_INDEX CUSPARSE_INDEX_32I +#else +#define SCS_CUSPARSE_INDEX CUSPARSE_INDEX_64I +#endif + +#define SCS_CSRMV_ALG CUSPARSE_CSRMV_ALG1 +#define SCS_CSR2CSC_ALG CUSPARSE_CSR2CSC_ALG1 + /* CUDA matrix routines only for CSR, not CSC matrices: CSC CSR GPU Mult A (m x n) A' (n x m) Ag accum_by_a_trans_gpu A'(n x m) A (m x n) Agt accum_by_a_gpu @@ -66,17 +85,19 @@ scs_int *i; /* A row index, size: NNZ A */ scs_int *p; /* A column pointer, size: n+1 */ scs_int m, n; /* m rows, n cols */ scs_int Annz; /* num non-zeros in A matrix */ /* CUDA */ - cusparseMatDescr_t descr; + cusparseSpMatDescr_t descr; } ScsGpuMatrix; -void SCS(_accum_by_atrans_gpu)(const ScsGpuMatrix *A, const scs_float *x, - scs_float *y, cusparseHandle_t cusparse_handle); +void SCS(_accum_by_atrans_gpu)(const ScsGpuMatrix *A, const cusparseDnVecDescr_t x, + cusparseDnVecDescr_t y, cusparseHandle_t cusparse_handle, + size_t *buffer_size, void **buffer); -void SCS(_accum_by_a_gpu)(const ScsGpuMatrix *A, const scs_float *x, - scs_float *y, cusparseHandle_t cusparse_handle); +void SCS(_accum_by_a_gpu)(const ScsGpuMatrix *A, const cusparseDnVecDescr_t x, + cusparseDnVecDescr_t y, cusparseHandle_t cusparse_handle, + size_t *buffer_size, void **buffer); void SCS(free_gpu_matrix)(ScsGpuMatrix *A); #ifdef __cplusplus }