Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault while calling compile() for transposing CSR matrix #564

Open
ShidehHashemian opened this issue May 20, 2024 · 0 comments
Open

Segfault while calling compile() for transposing CSR matrix #564

ShidehHashemian opened this issue May 20, 2024 · 0 comments

Comments

@ShidehHashemian
Copy link

Hi,

I want to transpose a sparse matrix of CSR format, where the result's format is CSC. Here is the code snippet I wrote in cpp.

    int n = 4, m = 4;
    Tensor<float> A({n, m}, {Dense, Sparse});
    for (int i = 0; i < n; i++)
    {
        if (i + 1 < n)
            A.insert({i, i + 1}, (float)2.0);
        if (i - 1 >= 0)
            A.insert({i, i - 1}, (float)-2.0);
        A.insert({i, i}, (float)1.0);
    }
    A.pack();
    Tensor<float> B({n, m}, {Sparse , Dense});
    IndexVar i, j;
    B(i, j) = A(j, i);
    B.compile();

It fails on B.compile() returning Segfault. But the web tool can generate the code: link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant