Skip to content

Computing wrong result for Column Summation #568

@ShidehHashemian

Description

@ShidehHashemian

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions