Yes, you can use arbitrary cuda code, check for example the Faster R-CNN code I sent you, they define CUDA kernels in there, and you can use thrust or any other CUDA library you want (because you can get pointers to the underlying cuda memory).
The add function is just an example, and is there mostly to illustrate how to use cffi with pytorch