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" 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..435fba11e 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() { @@ -147,9 +149,11 @@ namespace ttg { virtual ~SinkTT() {} - void fence() {} + void fence() override final {} + + void make_executable() override final { TTBase::make_executable(); } - 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