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/madness/buffer.h"
5 
6 namespace ttg_madness {
7 
8  template<typename T, typename A>
9  auto buffer_data(const Buffer<T, A>& buffer) {
10  /* for now return the internal pointer, should be adapted if ever relevant for madness */
11  return buffer.current_device_ptr();
12  }
13 
14  template<typename... Views>
15  inline bool register_device_memory(std::tuple<Views&...> &views)
16  {
17  /* nothing to do here */
18  return true;
19  }
20 
21  template<typename T, std::size_t N>
22  inline bool register_device_memory(const ttg::span<T, N>& span)
23  {
24  /* nothing to do here */
25  return true;
26  }
27 
28 } // namespace ttg_madness
29 
30 #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:9
bool register_device_memory(std::tuple< Views &... > &views)
Definition: devicefunc.h:15
A runtime-managed buffer mirrored between host and device memory.
Definition: buffer.h:12
element_type * current_device_ptr()
Definition: buffer.h:129