Skip to content

Commit

Permalink
README and SpGEMM example update
Browse files Browse the repository at this point in the history
  • Loading branch information
fbusato committed Feb 1, 2022
1 parent 73635a6 commit 1adfd9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cuSPARSE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This folder demonstrates cuSPARSE Generic APIs usage.
- [Conversion](#conversion)
- [Legacy APIs](#legacy-apis)
- [Optimizations](#optimizations)
- [Sparse Iterative Methods](#sparse-iterative-methods)

---

Expand Down Expand Up @@ -137,3 +138,8 @@ This folder demonstrates cuSPARSE Generic APIs usage.

The sample demonstrates how to optimize *sparse vector - dense vector scaling and sum* (`cusparseAxpby`) by exploiting NVIDIA Ampere architecture *Hardware Memory Compression*

##### Sparse Iterative Methods

* [Preconditioned BiCGStab](bicgstab/)

The sample describes how to use the cuSPARSE and cuBLAS libraries to implement the Incomplete-LU preconditioned iterative *Biconjugate Gradient Stabilized Method (BiCGStab)*
6 changes: 5 additions & 1 deletion cuSPARSE/spgemm/spgemm_example.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1993-2021 NVIDIA Corporation. All rights reserved.
* Copyright 1993-2022 NVIDIA Corporation. All rights reserved.
*
* NOTICE TO LICENSEE:
*
Expand Down Expand Up @@ -195,6 +195,10 @@ int main(void) {
// allocate matrix C
CHECK_CUDA( cudaMalloc((void**) &dC_columns, C_nnz1 * sizeof(int)) )
CHECK_CUDA( cudaMalloc((void**) &dC_values, C_nnz1 * sizeof(float)) )

// NOTE: if 'beta' != 0, the values of C must be update after the allocation
// of dC_values, and before the call of cusparseSpGEMM_copy

// update matC with the new pointers
CHECK_CUSPARSE(
cusparseCsrSetPointers(matC, dC_csrOffsets, dC_columns, dC_values) )
Expand Down

0 comments on commit 1adfd9b

Please sign in to comment.