Out of the oven now! What happened: "rotate" is an existing function that rotates bits in elements of a vector There were also some syntax errors I got tired of \ for continuation There's a hack using a macro to quote things, but it's easier to just use a different file I used .c extension, since OpenCL basically lets you use c You can get the build log Not that hard really, just have to actually do it Note: Some failures don't leave anything in the log at all! Points that miss the original, and rotating 90 degrees It can be helpful to put a dot for the rotation axis, in figuring out what's going wrong Obviously, rotation doesn't always include this Major blur effect: Comes down to rounding, fix that and it'll rotate ok even with just our simple sampling method Oddly enough, the only thing not wrong was the math! Next: Similarity at a particular rotation We'll need a separate kernel to reduce the results This sort of depends on the correct pole location Very simple similarity: Sum of differences Doesn't take image features into account at all For exact alignment of very similar images, it can work