WARNING: could not attach metadata for @simd loop


I was trying to use @simd and was bounced back by this error. I googled this error and it seemed it was discussed in the following thread. But it’s different from my case, as mine has nothing to do with Travis. Thanks!!



What code are you running? What julia version? On what system? Is it a binary build or a build compiled from source?


I’m running a module that I wrote. This module has a few dependencies. I’m using Julia v0.5 on Ubuntu. It’s a binary build, downloaded from Julia’s downloads page. Thanks!!


The warning should have been removed in 0.5. It was printed in a few cases when vectorization fails (and in my experience mostly when the loop increment/condition is not inlined). Even when the warning is gone, it might still mean that the vectorization does not work, and you need to provide much more detail if you want to know why.


Thanks a lot. Here is a MWE that failed with the above error on my machine. See if it throws an error on yours. Or the loop is not inlined?

n = 100
N = 2*n+1

coefF = rand(Complex{Float64}, N)
freqF = -n:n

@simd for k = 1:N
  coefF[k] *= freqF[k]


Don’t do it in the global scope.


Also, I don’t think Complex array can be vectorized but StructOfArrays should work.


Sorry. When I embed the above code snippet in a function, the error is gone. So, forget it.

However, the error was thrown even the loop+@simd were inside a function. But I can’t reproduce the error (non-global) with an MWE. Thanks anyway.