Skip to content

Commit

Permalink
TTG needs get_world() too ... introduce by making a virtual TTBase::g…
Browse files Browse the repository at this point in the history
…et_world() stub
  • Loading branch information
evaleev committed Oct 27, 2023
1 parent 3f9087c commit b77c599
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ttg/ttg/base/tt.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ namespace ttg {
/// Returns this thread's pointer to the vector of output terminals
static const std::vector<TerminalBase *> *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";
Expand Down
2 changes: 1 addition & 1 deletion ttg/ttg/madness/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ namespace ttg_madness {
std::array<std::size_t, std::tuple_size_v<actual_input_tuple_type>> static_streamsize;

public:
ttg::World get_world() const { return world; }
ttg::World get_world() const override final { return world; }

protected:
using worldobjT = ::madness::WorldObject<ttT>;
Expand Down
2 changes: 1 addition & 1 deletion ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ttg/ttg/tt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b77c599

Please sign in to comment.