Skip to content

Commit

Permalink
Add missing device functions in the madness backend
Browse files Browse the repository at this point in the history
Missing register_device_memory on span and Buffer::empty

Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Nov 12, 2024
1 parent 6061bc5 commit 441e9a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ttg/ttg/madness/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ struct Buffer : private Allocator {
throw std::runtime_error("not implemented yet");
}

bool empty() const {
return (m_host_data == nullptr);
}

/* TODO: can we do this automatically?
* Pin the memory on all devices we currently track.
* Pinned memory won't be released by PaRSEC and can be used
Expand Down
4 changes: 4 additions & 0 deletions ttg/ttg/madness/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "ttg/fwd.h"
#include "ttg/util/typelist.h"
#include "ttg/util/span.h"

#include <future>

Expand Down Expand Up @@ -71,6 +72,9 @@ namespace ttg_madness {
template<typename... Views>
inline bool register_device_memory(std::tuple<Views&...> &views);

template<typename T, std::size_t N>
inline bool register_device_memory(const ttg::span<T, N>& span);

template<typename... Buffer>
inline void post_device_out(std::tuple<Buffer&...> &b);

Expand Down
1 change: 1 addition & 0 deletions ttg/ttg/madness/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "ttg/base/tt.h"
#include "ttg/func.h"
#include "ttg/madness/device.h"
#include "ttg/madness/devicefunc.h"
#include "ttg/runtimes.h"
#include "ttg/tt.h"
#include "ttg/util/bug.h"
Expand Down

0 comments on commit 441e9a2

Please sign in to comment.