AutoDock-GPU
AutoDock-GPU copied to clipboard
Issues in genetic algorithm if NWI<4
Found an issue in device/kernel4.cl:
The if statements starting on lines: 128, 136, and 163:
if (get_local_id(0) < 4)
if (get_local_id(0) < 2)
if (get_local_id(0) < 2)
These lines assign a parent candidate index, parent index, and a crossover index. No problem if NWI>=4, but if NWI = 2 then two parent candidate indices are uninitialized. If NWI = 1 then all three assignments are buggy.
In the Kokkos version, I replaced these if statements with loops so that all candidates etc are assigned even if there is only 1 thread.
Thank you, this is a bug in the develop branch. In the main branch NWI>=16. I like your solution and may adopt it here too. On the other hand, In order for the genetic algorithm to do a good job it may make sense to stick to the larger number of threads though...
Bug is fixed. There is still some weirdness with NUMWI=1 on CPU, GPU is fine...