fixing std::min and std::max and std::abs: using them in default will make nvcc unhappy.