Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion hist/hist/inc/TH3.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
class TH2D;
class TProfile2D;

#if defined R__B64 && defined __cpp_lib_atomic_ref
// ROOT-20834 Atomic_ref on 32 bit can fail because of alignment problems
#define TH3D_FILL_THREADSAFE
#endif

namespace ROOT::Internal {
/// Entrypoint for thread-safe filling from RDataFrame.
template <typename T, typename... Args>
Expand Down Expand Up @@ -455,7 +460,7 @@ class TH3D : public TH3, public TArrayD {
Double_t RetrieveBinContent(Int_t bin) const override { return fArray[bin]; }
void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = content; }
private:
#ifdef __cpp_lib_atomic_ref
#ifdef TH3D_FILL_THREADSAFE
void FillThreadSafe(Double_t x, Double_t y, Double_t z, Double_t w = 1.);
template <typename T, typename... Args>
friend auto ROOT::Internal::FillThreadSafe(T &histo, Args... args)
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/src/TH3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ Int_t TH3::Fill(Double_t x, Double_t y, Double_t z, Double_t w)
return bin;
}

#ifdef __cpp_lib_atomic_ref
#ifdef TH3D_FILL_THREADSAFE
////////////////////////////////////////////////////////////////////////////////
/// Atomically increment cell defined by x,y,z by a weight w.
///
Expand Down
2 changes: 1 addition & 1 deletion hist/hist/test/test_TH3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEST(TH3L, SetBinContent)
EXPECT_EQ(h.GetBinContent(1, 1, 1), Large);
}

#ifdef __cpp_lib_atomic_ref
#ifdef TH3D_FILL_THREADSAFE

TEST(TH3D, FillThreadSafe)
{
Expand Down
Loading