how to add a plugin layer which can use CUDA operations in c++ and python?

There is no official doc that introduces the way to add a custom layer which can do CUDA operations directly. Whether should I write .cu files or something else?