/// <summary> /// </summary> public SparseVector(long aSize, long aNnz, CudaDeviceVariable <indexT> indices, CudaDeviceVariable <dataT> values, IndexBase aIdxBase) { size = aSize; nnz = aNnz; idxBase = aIdxBase; descr = new cusparseSpVecDescr(); typeIndices = IndexTypeTranslator.GetType(typeof(indexT)); typeData = CudaDataTypeTranslator.GetType(typeof(dataT)); res = CudaSparseNativeMethods.cusparseCreateSpVec(ref descr, size, nnz, indices.DevicePointer, values.DevicePointer, typeIndices, idxBase, typeData); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusparseCreateSpVec", res)); if (res != cusparseStatus.Success) { throw new CudaSparseException(res); } }