"...git@developer.sourcefind.cn:2222/OpenDAS/flashmla.git" did not exist on "c85c787e5c0a02dcca86f0f932dbfa39acfa8947"
Commit 17c06daa authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed some methods that should have been marked const

parent e7eb7852
...@@ -352,30 +352,30 @@ public: ...@@ -352,30 +352,30 @@ public:
/** /**
* Get whether double precision is being used. * Get whether double precision is being used.
*/ */
bool getUseDoublePrecision() { bool getUseDoublePrecision() const {
return useDoublePrecision; return useDoublePrecision;
} }
/** /**
* Get whether mixed precision is being used. * Get whether mixed precision is being used.
*/ */
bool getUseMixedPrecision() { bool getUseMixedPrecision() const {
return useMixedPrecision; return useMixedPrecision;
} }
/** /**
* Get whether the periodic box is triclinic. * Get whether the periodic box is triclinic.
*/ */
bool getBoxIsTriclinic() { bool getBoxIsTriclinic() const {
return boxIsTriclinic; return boxIsTriclinic;
} }
/** /**
* Convert a number to a string in a format suitable for including in a kernel. * Convert a number to a string in a format suitable for including in a kernel.
* This takes into account whether the context uses single or double precision. * This takes into account whether the context uses single or double precision.
*/ */
std::string doubleToString(double value); std::string doubleToString(double value) const;
/** /**
* Convert a number to a string in a format suitable for including in a kernel. * Convert a number to a string in a format suitable for including in a kernel.
*/ */
std::string intToString(int value); std::string intToString(int value) const;
/** /**
* Convert a CUDA result code to the corresponding string description. * Convert a CUDA result code to the corresponding string description.
*/ */
......
...@@ -594,7 +594,7 @@ void CudaContext::restoreDefaultStream() { ...@@ -594,7 +594,7 @@ void CudaContext::restoreDefaultStream() {
setCurrentStream(0); setCurrentStream(0);
} }
string CudaContext::doubleToString(double value) { string CudaContext::doubleToString(double value) const {
stringstream s; stringstream s;
s.precision(useDoublePrecision ? 16 : 8); s.precision(useDoublePrecision ? 16 : 8);
s << scientific << value; s << scientific << value;
...@@ -603,7 +603,7 @@ string CudaContext::doubleToString(double value) { ...@@ -603,7 +603,7 @@ string CudaContext::doubleToString(double value) {
return s.str(); return s.str();
} }
string CudaContext::intToString(int value) { string CudaContext::intToString(int value) const {
stringstream s; stringstream s;
s << value; s << value;
return s.str(); return s.str();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment