Is there a way to indicate local parallelism?

With a sorting network, I can sort 4 values using 5 comparisons in three sequential groups.
The first two comparisons are internally independent, so ok to do in parallel. And so for the next two.

Is there a way to let Julia know a local sequence that is not a loop need not be sequential?

You could write explicit SIMD code with SIMD.jl

1 Like

You could also look into using the @async and @sync macros. For example, you could write

@sync begin
    @async ...
    @async ...
end