Where ^ = XOR, >> and << are right shift and left shift. I’m unable to do it myself because my GPU doesnt support atomic functions. Can anyone transform this to CUDA code? I shall send my full project back to them. Hoping for favorable replies.
Thanks in advance!
As a check : Initially if state = 7D h, state = 2B h, state = 30 h, state = 67 h
After one round of for loop it should give state = D0 h, state = 1C h, state = 9F h, state = 52 h
The above code is small part of ADVANCED ENCRYPTION STANDARD. Apart from this I’ve completed full coding. If anyone is interested in helping me out for this part, let me know. I’m ready to share my project.
You can create mutexes and atomic ops in shared memory, even in G80, by using the write guarantees of CUDA (multiple writes guarantee that ONE write will succeed.) I posted the method and code here many months back.
However, global memory atomics are trickier, since there’s no blockwide synchronization except for ending the kernel and starting a new one.
You can sometimes assign unique global ranges to BLOCKS and then use blockwide atomics via shared memory at least.
In general, atomics tend to be used for data management, not computation… things like requesting and reporting job results to a queue where many threads may be trying to read or write. For your code snippet above it’s very unclear what you’re trying to do, or why you’d need atomics to do it though.
The above code is Mixing columns. Its a part of AES standard. I tried it in CPU and it works perfectly fine. I wanted to translate the same to GPU. So when I used inbuilt function for XOR, it gave me error telling that Tesla D870 doesnt support atomic XOR functions.
Now my question is, Is there any other way by which I can implement BITWISE XOR efficiently? Any idea/lead would help me a lot.