Is there a way to create a customized atomic operation in cuda?
I am asking because i got a problem that i need to check this kernel code:
if (img[index] != clone[index])
the main problem is that img, clone and cmp are device memories, HOWEVER, cmp is a SINGLE unity memory, so it can be seen as a shared memory, so, all threads have acesss to it, with the atomicExch i guarantee that once someone triggers it, no one will stop it, so far so good, the main problem is the if that can trigger race conditions… i would like to make the both the if and the atomicExch to be executed in a atomic way… anyone have any idea of how to do that? or if it is at least possible?