after 6 hours, I found out that you should set memory back to 0 with cudamemset before testing, otherwise old results are kept in memory, and cuda keeps allocating the same memory segment to your kernels.

With this, even with an empty kernel, if it is doing the same computation as the previous kernel, and you comment out everything it does, the gmp test will still pass, because all values are still in memory.