Working gpu minmax