From b77c5990d45a6b24a3ab566e99c14301cc08a585 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 27 Oct 2023 14:25:33 -0400 Subject: [PATCH 1/4] TTG needs get_world() too ... introduce by making a virtual TTBase::get_world() stub --- ttg/ttg/base/tt.h | 3 +++ ttg/ttg/madness/ttg.h | 2 +- ttg/ttg/parsec/ttg.h | 2 +- ttg/ttg/tt.h | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ttg/ttg/base/tt.h b/ttg/ttg/base/tt.h index e59db15e6..660eaf70a 100644 --- a/ttg/ttg/base/tt.h +++ b/ttg/ttg/base/tt.h @@ -228,6 +228,9 @@ namespace ttg { /// Returns this thread's pointer to the vector of output terminals static const std::vector *get_outputs_tls_ptr() { return outputs_tls_ptr_accessor(); } + /// @return World in which this lives + virtual ttg::World get_world() const = 0; + /// Returns a pointer to the i'th input terminal ttg::TerminalBase *in(size_t i) { if (i >= inputs.size()) throw name + ":TTBase: you are requesting an input terminal that does not exist"; diff --git a/ttg/ttg/madness/ttg.h b/ttg/ttg/madness/ttg.h index 383d33c1b..f483a3bc9 100644 --- a/ttg/ttg/madness/ttg.h +++ b/ttg/ttg/madness/ttg.h @@ -205,7 +205,7 @@ namespace ttg_madness { std::array> static_streamsize; public: - ttg::World get_world() const { return world; } + ttg::World get_world() const override final { return world; } protected: using worldobjT = ::madness::WorldObject; diff --git a/ttg/ttg/parsec/ttg.h b/ttg/ttg/parsec/ttg.h index b88874b0e..aa624e106 100644 --- a/ttg/ttg/parsec/ttg.h +++ b/ttg/ttg/parsec/ttg.h @@ -1205,7 +1205,7 @@ namespace ttg_parsec { bool m_defer_writer = TTG_PARSEC_DEFER_WRITER; public: - ttg::World get_world() const { return world; } + ttg::World get_world() const override final { return world; } private: /// dispatches a call to derivedT::op if Space == Host, otherwise to derivedT::op_cuda if Space == CUDA diff --git a/ttg/ttg/tt.h b/ttg/ttg/tt.h index 66048906a..a9a7a6e29 100644 --- a/ttg/ttg/tt.h +++ b/ttg/ttg/tt.h @@ -81,6 +81,8 @@ namespace ttg { TTBase *get_op(std::size_t i) { return tts.at(i).get(); } + ttg::World get_world() const override final { return tts[0]->get_world(); } + void fence() { tts[0]->fence(); } void make_executable() { From ee8df777e8a4162aa4e07ea160a42d3a94f654d1 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Wed, 11 Oct 2023 08:12:43 -0400 Subject: [PATCH 2/4] [cmake] FindTBB can handle OneTBB --- cmake/modules/FindTBB.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index d9676221f..6fe1969d4 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -354,11 +354,17 @@ findpkg_finish(TBB_MALLOC_PROXY) #parse all the version numbers from tbb if(NOT TBB_VERSION) - #only read the start of the file - file(READ - "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" - TBB_VERSION_CONTENTS - LIMIT 2048) + if (EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h") + file(STRINGS + "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" + TBB_VERSION_CONTENTS + REGEX "VERSION") + else() + file(STRINGS + "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" + TBB_VERSION_CONTENTS + REGEX "VERSION") + endif() string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" From 4f9a4d963d8c7854bf1fcbf8ef213194b4238a18 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 27 Oct 2023 15:20:32 -0400 Subject: [PATCH 3/4] SinkTT::get_world() implemented --- ttg/ttg/tt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ttg/ttg/tt.h b/ttg/ttg/tt.h index a9a7a6e29..25b2508fa 100644 --- a/ttg/ttg/tt.h +++ b/ttg/ttg/tt.h @@ -153,6 +153,8 @@ namespace ttg { void make_executable() { TTBase::make_executable(); } + World get_world() const override final { return get_default_world(); } + /// Returns pointer to input terminal i to facilitate connection --- terminal cannot be copied, moved or assigned template std::tuple_element_t *in() { From c46de71729529bcd27432335f8ef8d7084ad5e06 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Fri, 27 Oct 2023 15:57:54 -0400 Subject: [PATCH 4/4] [denoise] hush warnings re: SinkTT::{fence,make_executable}() not being marked `override` --- ttg/ttg/tt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ttg/ttg/tt.h b/ttg/ttg/tt.h index 25b2508fa..435fba11e 100644 --- a/ttg/ttg/tt.h +++ b/ttg/ttg/tt.h @@ -149,9 +149,9 @@ namespace ttg { virtual ~SinkTT() {} - void fence() {} + void fence() override final {} - void make_executable() { TTBase::make_executable(); } + void make_executable() override final { TTBase::make_executable(); } World get_world() const override final { return get_default_world(); }