 
 }
 
-unsigned exp10( unsigned n )
-{
-	unsigned y = 1;
-	for( unsigned i = 0; i < n; ++i ) y *= 10;
-	return y;
-}
-
-unsigned log2( unsigned n )
-{
-	unsigned y = 1;
-	for( unsigned i = 0; i < n; ++i ) y *= 2;
-	return y;
-}
-
+///
+/// \brief Performs a unit conversion and creates a pretty string.
+///
+/// If the provided value is an exact multiple of per_unit then no
+/// decimal places will be displayed, regardless of the value of digits.
+/// (e.g. digits=2 x=2000 per_unit=1000 unitSymbol="k" gives: 2k
+///       digits=2 x=2500 per_unit=1000 unitSymbol="k" gives: 2.50k)
+///
+/// If x < per_unit then the function returns false so that the
+/// user can retry with a smaller unit.
+///
+/// \param out stream to output formatted string to
+/// \param digits number of decimal places
+/// \param x the value to format
+/// \param per_unit the value per unit (e.g. 2^30=1Gb)
+/// \param unitSymbol the symbol for the unit (e.g. "Gb")
+/// \return true if the string was successfully created
+///
 bool try_creating_unit_string( std::ostream& out, unsigned digits, unsigned long x, unsigned long per_unit, const std::string& unitSymbol = std::string() )
 {
 	unsigned long units = x / per_unit;

output << "maxSurface2DLayered=" << deviceProperties.maxSurface2DLayered[0] << "," << deviceProperties.maxSurface2DLayered[1] << "," << deviceProperties.maxSurface2DLayered[2] << std::endl;
output << "maxSurfaceCubemap=" << deviceProperties.maxSurfaceCubemap << std::endl;
output << "maxSurfaceCubemapLayered=" << deviceProperties.maxSurfaceCubemapLayered[0] << "," << deviceProperties.maxSurfaceCubemapLayered[1] << std::endl;

#else
output << "Not using device, in ecuda host emulation mode." << std::endl;
#endif
*/


	return ss.str();
}


/*
UNREPORTED PROPERTIES:
output << "maxTexture1D=" << deviceProperties.maxTexture1D << std::endl;
output << "maxTexture1DLinear=" << deviceProperties.maxTexture1DLinear << std::endl;
output << "maxTexture2D=" << deviceProperties.maxTexture2D[0] << "," << deviceProperties.maxTexture2D[1] << std::endl;
