3 ms·
> We're adding a parallel keyword Why is there a need for a "parallel" keyword? Can't the compiler decide for you whether to parallelize a loop for you? If th
by Jyaif 5y ago
> We're adding a parallel keyword
Why is there a need for a "parallel" keyword? Can't the compiler decide for you whether to parallelize a loop for you?
If the decision to parallelize depends on the data, couldn't the compiler generate code for both implementations and select the right one at run time?
Or maybe the programmer could describe in code what they expect the data will look like, and the compiler will take a decision based on those annotations (and other signals, such as the HW the program has access to, what the programmer wants to optimize for (memory? latency?)).