diff --git a/include/clad/Differentiator/Differentiator.h b/include/clad/Differentiator/Differentiator.h index b6f4e8474..a686e35ef 100644 --- a/include/clad/Differentiator/Differentiator.h +++ b/include/clad/Differentiator/Differentiator.h @@ -28,16 +28,15 @@ template struct ValueAndAdjoint { /// \returns the size of a c-style string inline CUDA_HOST_DEVICE unsigned int GetLength(const char* code) { - unsigned int count; const char* code_copy = code; #ifdef __CUDACC__ - count = 0; + unsigned int count = 0; while (*code_copy != '\0') { count++; code_copy++; } #else - count = strlen(code_copy); + unsigned int count = strlen(code_copy); #endif return count; }