Add class generation code
Properly handle restrict for Cuda compiler
Code now compiles to C++ except for missing lock/unlock