Skip to content

Commit

Permalink
could this be.... it?
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanwm committed Jul 27, 2024
1 parent 2d9d90c commit fa4fa42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion nuTens/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const static spdlog::level::level_enum runtimeLogLevel = spdlog::level::off;

namespace ntlogging
{
static std::once_flag logLevelOnceFlag;
static std::once_flag
logLevelOnceFlag; // NOLINT: Linter gets angry that this is globally accessible and non-const. Needs to be non-const
// so it can be flipped by the call to std::call_once. Could wrap it up so that it's not global
// but that feels like a bit much for what we're doing here

/// @brief Set up the logger at runtime, should only be invoked once the very
/// first time any of the logging macros below are called
Expand Down
2 changes: 1 addition & 1 deletion nuTens/tensors/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Tensor
*/

public:
typedef std::variant<int, std::string> indexType;
using indexType = std::variant<int, std::string>;

/// @name Initialisers
/// Use these methods to initialise the tensor
Expand Down
1 change: 1 addition & 0 deletions tests/test-utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ float relativeDiff(float f1, float f2)
// use when we want to check if a value is equal to some expectation
// threshold is fractional difference that is considdered "too different"
// will print out some useful information then fail the test
// NOLINTNEXTLINE: Wants me to make this a constexpr... but i prefer it like this so...
#define TEST_EXPECTED(value, expectation, varName, threshold) \
{ \
if (Testing::relativeDiff((value), (expectation)) > (threshold)) \
Expand Down

0 comments on commit fa4fa42

Please sign in to comment.