You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> function f1()
@no_escape begin
y = @alloc(Int,10)
Threads.@threads for val in y
println(val)
end
end
end
ERROR: LoadError: The `return` keyword is not allowed to be used inside the `@no_escape` macro
I have to nest the for loop inside a function to trick it:
julia> function _f(y)
Threads.@threads for val in y
println(y)
end
end
_f (generic function with 1 method)
julia> function f2()
@no_escape begin
y = @alloc(Int,10)
_f(y)
end
end
f2 (generic function with 1 method)
The text was updated successfully, but these errors were encountered:
Any update on this @MasonProtter ? I've found that Polyester.@Batch can work inside of the @no_escape block, but that unfortunately it does not always thread the code as it should.
I have to nest the
for
loop inside a function to trick it:The text was updated successfully, but these errors were encountered: