-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
Hi,
I want to compute the column summation of a sparse matrix in CSR format. Here is the code snippet I wrote in cpp.
int I = 5, J = 4;
taco::Format B_format({taco::Dense, taco::Sparse});
taco::Tensor<int> B({I, J}, B_format);
B.insert({0, 1}, 1);
B.insert({2, 0}, 2);
B.insert({2, 2}, 5);
B.insert({4, 2}, 3);
B.pack();
Format A_format({taco::Sparse});
taco::Tensor<int> A({J}, A_format);
taco::IndexVar i, j;
A(j) = B(i, j);
A.compile();
A.assemble();
A.compute();
taco::write("A_taco.mtx", A);
And here is how A_taco.mtx looks like:
1 1
0 2
2 5
2 3
My operating system is Ubuntu 22.04 LTS.
I have built the version of TACO on the master branch as instructed. I didn't change the default compiler and optimization flags.
I would be grateful if you could help me with this problem.
Metadata
Metadata
Assignees
Labels
No labels