Skip to content

Commit

Permalink
Fix build errors with clang-18 (#1875)
Browse files Browse the repository at this point in the history
  • Loading branch information
fifield authored Oct 23, 2024
1 parent 93e6755 commit f19d9a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions programming_examples/basic/vector_exp/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <bits/stdc++.h>

#include <boost/program_options.hpp>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iostream>
Expand Down Expand Up @@ -42,9 +43,9 @@ int verify(int CSize, std::vector<T> A, std::vector<T> 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;
Expand Down
3 changes: 2 additions & 1 deletion programming_examples/ml/relu/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <bits/stdc++.h>
#include <boost/program_options.hpp>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iostream>
Expand Down Expand Up @@ -42,7 +43,7 @@ int verify(int size, std::vector<T> A, std::vector<T> 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;
Expand Down

0 comments on commit f19d9a3

Please sign in to comment.