Implemntation for building cuda code