Recent change 3a6a663a15 has some logic issues.
First, the grain size was clamped to be never lower than 256, which
doesn't make sense since the size of the array is never greater than
the number of threads. The numbers used in the division were also large
enough that multithreading wouldn't be used in many realistic cases
anyway. There's no need to cap the grain size at 1024, and also
`safe_divide` doesn't make sense in this scenario.
Pull Request: https://projects.blender.org/blender/blender/pulls/144872