error taking max height in cuda version