▲ | maccard 11 hours ago | |||||||||||||||||||||||||
I think you’re fixating on the very specific example. Imagine if instead of 2 + 2 it was multiplying arrays of large matrices. The compiler or runtime would be smart enough to figure out if it’s worth dispatching the parallelism or not for you. Basically auto vectorisation but for parallelism | ||||||||||||||||||||||||||
▲ | lazide 10 hours ago | parent [-] | |||||||||||||||||||||||||
Notably - in most cases, there is no way the compiler can know which of these scenarios are going to happen at compile time. At runtime, the CPU can figure it out though, eh? | ||||||||||||||||||||||||||
|