/// <summary> /// When the matrix descriptor is created, its fields are initialized to: /// CUSPARSE_MATRIXYPE_GENERAL /// CUSPARSE_INDEX_BASE_ZERO /// All other fields are uninitialized /// </summary> public CudaSparseMatrixDescriptor() { _descr = new cusparseMatDescr(); res = CudaSparseNativeMethods.cusparseCreateMatDescr(ref _descr); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusparseCreateMatDescr", res)); if (res != cusparseStatus.Success) { throw new CudaSparseException(res); } }
/// <summary> /// Creates a new CudaSparseMatrixDescriptor /// </summary> public CudaSparseMatrixDescriptor(cusparseMatrixType matrixType, cusparseFillMode fillMode, cusparseDiagType diagType, IndexBase indexBase) { _descr = new cusparseMatDescr(); res = CudaSparseNativeMethods.cusparseCreateMatDescr(ref _descr); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusparseCreateMatDescr", res)); if (res != cusparseStatus.Success) { throw new CudaSparseException(res); } SetMatType(matrixType); SetMatFillMode(fillMode); SetMatDiagType(diagType); SetMatIndexBase(indexBase); }