Is it possible to somehow generate functions with a multithreaded for-loop with @threads macro (or any other construct with the same fuctionality)?
The straightforward way fails
julia> @generated function f(x::Integer)
quote
@threads for i = 1:x
println(i)
end
end
end
julia> f(5)
ERROR: generated function body is not pure. this likely means it contains a closure or comprehension.