Skip to content

Commit

Permalink
Fix windows warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Apr 19, 2024
1 parent 5e78fff commit f4d3697
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/celeritas/optical/OpticalGenData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct OpticalGenParamsData

bool cerenkov{false}; //!< Whether Cerenkov is enabled
bool scintillation{false}; //!< Whether scintillation is enabled
real_type capacity{0}; //!< Distribution data buffer capacity
size_type capacity{0}; //!< Distribution data buffer capacity

//// METHODS ////

Expand Down
2 changes: 2 additions & 0 deletions src/corecel/sys/ScopedSignalHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ sig_atomic_t volatile g_celer_signal_bits_ = 0;
//! Set the bit corresponding to a signal
extern "C" void celer_set_signal(int signal)
{
#ifndef _WIN32
CELER_ASSERT(signal >= 0 && signal < static_cast<int>(sizeof(int) * 8 - 1));
#endif
g_celer_signal_bits_ |= (1 << signal);
}

Expand Down
22 changes: 21 additions & 1 deletion src/orange/MatrixUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ using Mat3 = celeritas::SquareMatrixReal3;

namespace celeritas
{
namespace
{
//---------------------------------------------------------------------------//
//! Use fused multiply-add for floating point calculations
template<class T, std::enable_if_t<std::is_floating_point<T>::value, bool> = true>
T generic_fma(T a, T b, T y)
{
return std::fma(a, b, y);
}

//! Don't use FMA for integers
template<class T, std::enable_if_t<std::is_floating_point<T>::value, bool> = false>
T generic_fma(T a, T b, T y)
{
return a * b + y;
}

//---------------------------------------------------------------------------//
} // namespace

//---------------------------------------------------------------------------//
/*!
* Calculate the determiniant of a 3x3 matrix.
Expand Down Expand Up @@ -73,7 +93,7 @@ gemm(SquareMatrix<T, N> const& a, SquareMatrix<T, N> const& b)
// Accumulate dot products
for (size_type k = 0; k != N; ++k)
{
result[i][j] = std::fma(b[k][j], a[i][k], result[i][j]);
result[i][j] = generic_fma(b[k][j], a[i][k], result[i][j]);
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/orange/orangeinp/detail/PostfixLogicBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//---------------------------------------------------------------------------//
#include "PostfixLogicBuilder.hh"

#include <algorithm>
#include <vector>

#include "corecel/cont/VariantUtils.hh"
#include "corecel/math/Algorithms.hh"
#include "orange/OrangeTypes.hh"
Expand Down

0 comments on commit f4d3697

Please sign in to comment.