gp function to complement gpu