Skip to content

Commit

Permalink
Fix the end marker
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jan 2, 2025
1 parent 90f387f commit 33d92ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions numerics/osaca.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "base/macros.hpp"

#define PRINCIPIA_USE_OSACA 0
#define PRINCIPIA_USE_OSACA 1

// The macros OSACA_FUNCTION_BEGIN and OSACA_RETURN are used to analyse the
// latency of a double -> double function, as measured, e.g., by the
Expand Down Expand Up @@ -132,9 +132,11 @@ static bool volatile OSACA_loop_terminator = false;
#define OSACA_FUNCTION_BEGIN(arg, ...) \
double OSACA_LOOP_CARRY_QUALIFIER OSACA_loop_carry = arg; \
OSACA_outer_loop: \
constexpr auto* OSACA_analysed_function_with_current_parameters = \
&OSACA_ANALYSED_FUNCTION __VA_ARGS__; \
if constexpr (std::string_view(__func__) == \
STRINGIFY_EXPANSION(OSACA_ANALYSED_FUNCTION) && \
&OSACA_ANALYSED_FUNCTION __VA_ARGS__ == \
OSACA_analysed_function_with_current_parameters == \
&OSACA_QUALIFIED_ANALYSED_FUNCTION) { \
IACA_VC64_START; \
} \
Expand All @@ -146,8 +148,10 @@ static bool volatile OSACA_loop_terminator = false;

#define OSACA_RETURN(result) \
do { \
if constexpr (std::string_view(__FUNCSIG__) == \
STRINGIFY_EXPANSION(OSACA_ANALYSED_FUNCTION)) { \
if constexpr (std::string_view(__func__) == \
STRINGIFY_EXPANSION(OSACA_ANALYSED_FUNCTION) && \
OSACA_analysed_function_with_current_parameters == \
&OSACA_QUALIFIED_ANALYSED_FUNCTION) { \
OSACA_loop_carry = (result); \
if (!OSACA_loop_terminator) { \
goto OSACA_loop; \
Expand Down

0 comments on commit 33d92ff

Please sign in to comment.