From bae14037b3914182741f5a57127b157151661c23 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Mon, 27 Apr 2026 19:35:48 +0200 Subject: [PATCH] Follow-up to #2402, should complete #2305 1) Put #ifndef OPENACC around atan in tinyexpr.c since atan is not directly available (should idealy be mapped to atan(x)=atan2(x,1.0), will write issue to put in mccode-r) 2) Use GPU-compatible str_comp rather than strcmp in TRACE of the instr (There is a define for this that seems to not cover (all of) TRACE, should also go in mccode-r or cogen) --- .../Test_inhomogenous_process/Test_inhomogenous_process.instr | 2 +- mcstas-comps/share/tinyexpr.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mcstas-comps/examples/Tests_union/Test_inhomogenous_process/Test_inhomogenous_process.instr b/mcstas-comps/examples/Tests_union/Test_inhomogenous_process/Test_inhomogenous_process.instr index d4e5af60e..cc075934c 100755 --- a/mcstas-comps/examples/Tests_union/Test_inhomogenous_process/Test_inhomogenous_process.instr +++ b/mcstas-comps/examples/Tests_union/Test_inhomogenous_process/Test_inhomogenous_process.instr @@ -180,7 +180,7 @@ COMPONENT box_sample = Incoherent( zdepth=thick, sigma_inc = 5.08, sigma_abs = 5.08 -) WHEN (!strcmp((const char*)"thin", (const char*)sample)) +) WHEN (!str_comp((const char*)"thin", (const char*)sample)) AT (0, 0, 0) RELATIVE arm_sample ROTATED (0, 0, 0) RELATIVE arm_sample diff --git a/mcstas-comps/share/tinyexpr.c b/mcstas-comps/share/tinyexpr.c index 2a0ddfc4f..30bc63caf 100644 --- a/mcstas-comps/share/tinyexpr.c +++ b/mcstas-comps/share/tinyexpr.c @@ -164,7 +164,9 @@ static const te_variable functions[] = { {"abs", fabs, TE_FUNCTION1 | TE_FLAG_PURE, 0}, {"acos", acos, TE_FUNCTION1 | TE_FLAG_PURE, 0}, {"asin", asin, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + #ifndef OPENACC {"atan", atan, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + #endif {"atan2", atan2, TE_FUNCTION2 | TE_FLAG_PURE, 0}, {"ceil", ceil, TE_FUNCTION1 | TE_FLAG_PURE, 0}, {"cos", cos, TE_FUNCTION1 | TE_FLAG_PURE, 0},