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

Can not generate omp parallel code for sparse tensors #561

Open
MaxwellF1 opened this issue Apr 14, 2024 · 1 comment
Open

Can not generate omp parallel code for sparse tensors #561

MaxwellF1 opened this issue Apr 14, 2024 · 1 comment

Comments

@MaxwellF1
Copy link

I'm using the taco C++ API (built with OpenMP ON) to compute the contraction between two sparse tensors using this code:

Format csf({Sparse, Sparse, Sparse, Sparse});
Tensor<double> X = read("x.tns", csf);
Tensor<double> Y = read("y.tns", csf);
Tensor<double> Z({X.getDimension(0),X.getDimension(1),Y.getDimension(0),Y.getDimension(1)}, csf);

IndexVar i, j, k, l, m, n;
Z(i,j,m,n) = X(i,j,k,l) * Y(m,n,k,l); 

Z.compile();
Z.printComputeIR(std::cout);
Z.assemble();
Z.compute();

And I found the printed code is not omp parallel in the loop. However, I test the spmv computation and it is generated with omp parallel.

@rohany
Copy link
Contributor

rohany commented May 6, 2024

There won't be any parallel loops generated by default with this setup as there is no outer dense loop to parallelize over. Perhaps if you made a different format {Dense, Sparse, Sparse, Sparse} you would see parallel loops generated.

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

2 participants