ttg 1.0.0
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// SPDX-License-Identifier: BSD-3-Clause
2#ifndef TTG_DEVICESCRATCH_H
3#define TTG_DEVICESCRATCH_H
4
5#include "ttg/devicescope.h"
6#include "ttg/fwd.h"
7#include "ttg/util/meta.h"
8
9namespace ttg {
10
11template<typename T>
12using devicescratch = TTG_IMPL_NS::devicescratch<T>;
13
14template<typename T>
15auto make_scratch(T* val, ttg::scope scope, std::size_t count = 1) {
16 return devicescratch<T>(val, scope, count);
17}
18
19namespace meta {
20
21 /* Specialize some traits */
22
23 template<typename T>
24 struct is_devicescratch<ttg::devicescratch<T>> : std::true_type
25 { };
26
27 template<typename T>
28 struct is_devicescratch<const ttg::devicescratch<T>> : std::true_type
29 { };
30
31 template<typename T>
32 struct is_const<ttg::devicescratch<T>> : std::is_const<T>
33 { };
34
35} // namespace meta
36
37} // namespace ttg
38
39#endif // TTG_DEVICESCRATCH_H
constexpr auto get(typelist< T, RestOfTs... >)
Definition typelist.h:102
top-level TTG namespace contains runtime-neutral functionality
Definition keymap.h:9
auto make_scratch(T *val, ttg::scope scope, std::size_t count=1)