How do I sync threads that are in the same block but doing a different operation in cuda c/c++?
I am a 4th year university student who is working on a Parallel computing course project. I have made a very bad decision in selecting the right algorithm to show case the gpu performance compared with its sequential counterpart. The Bat optimization algorithm is what I chose and the parallelization is as follows:
Thread 0: responsible for calculating average and applying stopping criteria by updating flag.
All other threads: updating each property of each bat in a generation/iteration of bat population.
First look at the code: