ttg 1.0.0-alpha
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
devicescratch.h
Go to the documentation of this file.
1#ifndef TTG_DEVICESCRATCH_H
2#define TTG_DEVICESCRATCH_H
3
4#include "ttg/devicescope.h"
5#include "ttg/fwd.h"
6#include "ttg/util/meta.h"
7
8namespace ttg {
9
10template<typename T>
11using devicescratch = TTG_IMPL_NS::devicescratch<T>;
12
13template<typename T>
14auto make_scratch(T* val, ttg::scope scope, std::size_t count = 1) {
15 return devicescratch<T>(val, scope, count);
16}
17
18namespace meta {
19
20 /* Specialize some traits */
21
22 template<typename T>
23 struct is_devicescratch<ttg::devicescratch<T>> : std::true_type
24 { };
25
26 template<typename T>
27 struct is_devicescratch<const ttg::devicescratch<T>> : std::true_type
28 { };
29
30 template<typename T>
31 struct is_const<ttg::devicescratch<T>> : std::is_const<T>
32 { };
33
34} // namespace meta
35
36} // namespace ttg
37
38#endif // TTG_DEVICESCRATCH_H
constexpr auto get(typelist< T, RestOfTs... >)
Definition typelist.h:101
top-level TTG namespace contains runtime-neutral functionality
Definition keymap.h:8
auto make_scratch(T *val, ttg::scope scope, std::size_t count=1)