From 0350c63d685befdc836c1bde344fdbc71704ac0e Mon Sep 17 00:00:00 2001 From: cianciosa Date: Sat, 7 Feb 2026 14:08:32 -0500 Subject: [PATCH] Attempt to fix a CI test failure by removing std:: from erf in special functions. Add trig functions to jit test. This should fix the problem in metal_complex that was causing the macOS runner to fail. --- graph_framework.xcodeproj/project.pbxproj | 6 ++++++ graph_framework/special_functions.hpp | 4 ---- graph_tests/jit_test.cpp | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/graph_framework.xcodeproj/project.pbxproj b/graph_framework.xcodeproj/project.pbxproj index c69db12..57c3d13 100644 --- a/graph_framework.xcodeproj/project.pbxproj +++ b/graph_framework.xcodeproj/project.pbxproj @@ -1941,6 +1941,7 @@ "-lLLVMCGData", "-lLLVMSandboxIR", "-lLLVMObjectYAML", + "-lLLVMPlugins", "-lLLVMFrontendAtomic", "-lclangFrontend", "-lclangBasic", @@ -1950,11 +1951,13 @@ "-lclangSerialization", "-lclangAST", "-lclangSema", + "-lclangAnalysisLifetimeSafety", "-lclangAnalysis", "-lclangASTMatchers", "-lclangSupport", "-lclangParse", "-lclangAPINotes", + "-lclangOptions", "-lclangCodeGen", "-rpath", /usr/local/lib, @@ -2111,6 +2114,7 @@ "-lLLVMCGData", "-lLLVMSandboxIR", "-lLLVMObjectYAML", + "-lLLVMPlugins", "-lLLVMFrontendAtomic", "-lclangFrontend", "-lclangBasic", @@ -2120,11 +2124,13 @@ "-lclangSerialization", "-lclangAST", "-lclangSema", + "-lclangAnalysisLifetimeSafety", "-lclangAnalysis", "-lclangASTMatchers", "-lclangSupport", "-lclangParse", "-lclangAPINotes", + "-lclangOptions", "-lclangCodeGen", "-rpath", /usr/local/lib, diff --git a/graph_framework/special_functions.hpp b/graph_framework/special_functions.hpp index e2da069..e250b0a 100644 --- a/graph_framework/special_functions.hpp +++ b/graph_framework/special_functions.hpp @@ -1505,11 +1505,7 @@ namespace special { T y = imag(z); if (y == static_cast (0)) { -#ifdef CUDA_DEVICE_CODE return complex_type (erf(x), y); -#else - return complex_type (std::erf(x), y); -#endif } else if (x == static_cast (0)) { const T y2 = sq(y); return complex_type (x, y2 > static_cast (720) ? (y > static_cast (0) ? numeric_limits::max() : diff --git a/graph_tests/jit_test.cpp b/graph_tests/jit_test.cpp index c1111bb..71e8f82 100644 --- a/graph_tests/jit_test.cpp +++ b/graph_tests/jit_test.cpp @@ -322,6 +322,28 @@ template void run_math_tests() { graph::variable_cast(v4)}, {pow_non_int}, {}, pow_non_int->evaluate().at(0), 3.0E-8); + + if constexpr (jit::use_gpu ()) { + result = 9.0E-8; + } else { + result = 0.0; + } + + auto sin_node = graph::sin(v1); + compile ({graph::variable_cast(v1)}, + {sin_node}, {}, + sin_node->evaluate().at(0), 0.0); + + auto cos_node = graph::cos(v1); + compile ({graph::variable_cast(v1)}, + {cos_node}, {}, + cos_node->evaluate().at(0), result); + + auto atan_node = graph::atan(v1, v2); + compile ({ + graph::variable_cast(v1), + graph::variable_cast(v2) + }, {atan_node}, {}, atan_node->evaluate().at(0), result); } //------------------------------------------------------------------------------ -- GitLab