IMHO you should leave out the "using" declarations, as they are bad form.
And it is always better to know for debugging, out of which namespace (or class) the functions are.
Secondly, while you are declaring the functions in lines 27f, you should also declare the variables, i.e. not just (int [], int), but (int data[], int size). This also just pro forma...
Additionally you should declare and initialise the boolean in line 84 at the beginning of the programm, --> globally, and THEN set the value to FALSE in the function.
In the while loop, in line 90, you are setting the bool sorted to TRUE
Pro forma I would also do that at the very end of the loop, just an aesthetic aspect.
For the for-loop in line 110, you should use another variable as the counter, too. Again, a thing that is just very optional, but helps to structure down your code.
This is no criticism at all, btw. The code itseld looks nice and dandy. Maybe you could have put the two function (printArray and bucketSort) in an additional header file, maybe even a class. But this, once again, are just proposals to make your code look a lot nicer ;)
Cheers
Mokka
P.S.: Use indents: Not just to strip down the code a bit, but also to structure variables etc.
From here on there will the small adjustments I did on your programThe indents are not printing correctly :/ Sorry
In the while loop, in line 90, you are setting the bool sorted to TRUE
Pro forma I would also do that at the very end of the loop, just an aesthetic aspect.
...That would break algorithm. It is a common pattern, btw.
For the for-loop in line 110, you should use another variable as the counter, too
I do not see any problems with variables (aside that they could be named better)
I would suggest to roll out your own integer pewer function: it would work better and faster than cmath one. Or even better, initialize powCounter to 1 and instead of incrementing it at the end, multiply it by 10. Ther replace whole static_cast<int>(pow(10, powCounter)) with just powCounter .
int bucket[10][::GLOBAL_SIZE]; arrays that large should not go on stack. You have just exhausted 40% of total stack size on my compiler settings.