Here, you seam to set this pragme on each level of loop. In the case of an 10 dimensions tensor, the pragma would appear 10 times. I think nested pragma is not always well supported by compilers. Do you have information about this? It not, I would parallelize just the outer loop for safety for now. But yes, if the outer dimensions is less then the number of cores, we will loose some paralelisation.