some high-level functionality to generate the PTX