WARNING: could not attach metadata for @simd loop


#1

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!!

https://groups.google.com/forum/#!topic/julia-dev/u6G7f9mxaHI


#2

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


#3

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!!


#4

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.


#5

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]
end

#6

Don’t do it in the global scope.


#7

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


#8

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.