From dacdbdfb172e8681b7d8bb52002d0925bfebaab3 Mon Sep 17 00:00:00 2001 From: p3afi4g2n <2990918050@qq.com> Date: Wed, 27 Nov 2024 22:44:03 +0800 Subject: [PATCH] ADD file via upload --- 6.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 6.cpp diff --git a/6.cpp b/6.cpp new file mode 100644 index 0000000..527b5c7 --- /dev/null +++ b/6.cpp @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include +#include +void sparse_matmul_coo(float **A_denseMatrix,float **B_denseMatrix,float **C_denseMatrix,int MAX){ + for(int i=0;iB_nonZeroCount)MAX=A_nonZeroCount; + else MAX=B_nonZeroCount; + + float C_values[MAX]; + int C_rowIndex[MAX]; + int C_colIndex[MAX]; + int C_nonZeroCount=0; + + int ROWS=MAX,COLS=MAX; + float **A_denseMatrix=new float*[MAX]; + float **B_denseMatrix=new float*[MAX]; + float **C_denseMatrix=new float*[MAX]; + for(int i=0;i