From f19d9a30d36f253b4e7b6dcddc8d284b7928fadd Mon Sep 17 00:00:00 2001 From: Jeff Fifield Date: Wed, 23 Oct 2024 12:16:34 -0600 Subject: [PATCH] Fix build errors with clang-18 (#1875) --- programming_examples/basic/vector_exp/test.cpp | 5 +++-- programming_examples/ml/relu/test.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/programming_examples/basic/vector_exp/test.cpp b/programming_examples/basic/vector_exp/test.cpp index 9e39a4cc39..ecb63df069 100644 --- a/programming_examples/basic/vector_exp/test.cpp +++ b/programming_examples/basic/vector_exp/test.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -42,9 +43,9 @@ int verify(int CSize, std::vector A, std::vector C, int verbosity) { std::bfloat16_t ref = exp(A[i]); // Let's check if they are inf or nan, and if so just pass because // comparisions will then fail, even for matches - if (isinf(ref) || isinf(C[i])) + if (std::isinf(ref) || std::isinf(C[i])) break; - if (isnan(ref) || isnan(C[i])) + if (std::isnan(ref) || std::isnan(C[i])) break; if (!test_utils::nearly_equal(ref, C[i], 0.0078125)) { std::cout << "Error in output " << C[i] << " != " << ref << std::endl; diff --git a/programming_examples/ml/relu/test.cpp b/programming_examples/ml/relu/test.cpp index 361ed7da10..02aa157030 100644 --- a/programming_examples/ml/relu/test.cpp +++ b/programming_examples/ml/relu/test.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -42,7 +43,7 @@ int verify(int size, std::vector A, std::vector B, int verbosity) { int errors = 0; for (uint32_t i = 0; i < size; i++) { // If the input is nan, lets just say its good - if (isnan(A[i])) + if (std::isnan(A[i])) continue; T ref = (T)0;