Yes, the program will round up to the next power of two if it isn't.
The reason for limiting it to powers of two, is for ease of implementation and efficiency of code.
There's a crap-load of binary divide-and-conquering in virtually all the algorithms that are used. Stuff like that just don't work well with non-power of two threads...
I've also found that the penalty of running extra threads is relatively small. Assuming that most computers now (and future) will have either a power-of-two # of cores or a "clean multiple" of one, this restriction is worth the ease of implementation.




Reply With Quote


Bookmarks