devicefunc.h
Go to the documentation of this file.
1 #ifndef TTG_MAD_DEVICEFUNC_H
2 #define TTG_MAD_DEVICEFUNC_H
3 
4 #include "ttg/devicescope.h"
5 
6 #include "ttg/madness/buffer.h"
7 
8 namespace ttg_madness {
9 
10  template<typename T, typename A>
11  auto buffer_data(const Buffer<T, A>& buffer) {
12  /* for now return the internal pointer, should be adapted if ever relevant for madness */
13  return buffer.current_device_ptr();
14  }
15 
16  template<typename... Views>
17  inline bool register_device_memory(std::tuple<Views&...> &views)
18  {
19  /* nothing to do here */
20  return true;
21  }
22 
23  template<typename T, std::size_t N>
24  inline bool register_device_memory(const ttg::span<T, N>& span)
25  {
26  /* nothing to do here */
27  return true;
28  }
29 
30 } // namespace ttg_madness
31 
32 #endif // TTG_MAD_DEVICEFUNC_H
this contains MADNESS-based TTG functionality
Definition: fwd.h:16
auto buffer_data(const Buffer< T, A > &buffer)
Definition: devicefunc.h:11
bool register_device_memory(std::tuple< Views &... > &views)
Definition: devicefunc.h:17
A runtime-managed buffer mirrored between host and device memory.
Definition: buffer.h:13
element_type * current_device_ptr()
Definition: buffer.h:143