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 
8 namespace ttg {
9 
10 template<typename T>
11 using devicescratch = TTG_IMPL_NS::devicescratch<T>;
12 
13 template<typename T>
14 auto make_scratch(T* val, ttg::scope scope, std::size_t count = 1) {
15  return devicescratch<T>(val, scope, count);
16 }
17 
18 namespace 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>
32  { };
33 
34 } // namespace meta
35 
36 } // namespace ttg
37 
38 #endif // TTG_DEVICESCRATCH_H
std::integral_constant< bool,(Flags &const_) !=0 > is_const
top-level TTG namespace contains runtime-neutral functionality
Definition: keymap.h:8
scope
Definition: devicescope.h:5
auto make_scratch(T *val, ttg::scope scope, std::size_t count=1)
Definition: devicescratch.h:14