|
14 | 14 | #include "bind.h"
|
15 | 15 |
|
16 | 16 | namespace bc {
|
17 |
| - |
18 |
| -namespace streams { |
19 |
| - |
20 |
| - //forward declare stream for common_traits |
21 |
| - template<class SystemTag> |
22 |
| - class Stream; |
23 |
| -} |
24 |
| - |
25 | 17 | namespace traits {
|
26 | 18 |
|
27 | 19 | using namespace bc::traits::common;
|
@@ -55,7 +47,6 @@ template<class...> using void_t = void;
|
55 | 47 | template<class...> using true_t = true_type;
|
56 | 48 | template<class...> using false_t = false_type;
|
57 | 49 |
|
58 |
| - |
59 | 50 | template<bool cond>
|
60 | 51 | using truth_type = conditional_t<cond, true_type, false_type>;
|
61 | 52 |
|
@@ -117,28 +108,6 @@ using conditional_detected_t =
|
117 | 108 |
|
118 | 109 | //----------------------------------
|
119 | 110 |
|
120 |
| -template<class Function, class voider=void> |
121 |
| -struct is_compileable : false_type {}; |
122 |
| - |
123 |
| -template<class Function> |
124 |
| -struct is_compileable<Function, |
125 |
| - enable_if_t< |
126 |
| - true_v< |
127 |
| - decltype(declval<Function>()())> |
128 |
| - > |
129 |
| - > : true_type {}; |
130 |
| - |
131 |
| -template<class Function> |
132 |
| -static constexpr bool compileable(Function&&) { |
133 |
| - return is_compileable<Function>::value; |
134 |
| -} |
135 |
| -template<class Function> |
136 |
| -static constexpr bool compileable() { |
137 |
| - return is_compileable<Function>::value; |
138 |
| -} |
139 |
| - |
140 |
| -//---------------------------------- |
141 |
| - |
142 | 111 |
|
143 | 112 | template<class T>
|
144 | 113 | BCINLINE static constexpr bc::size_t max(const T& x) { return x; }
|
@@ -179,8 +148,7 @@ template<template<class> class Function, class... Ts>
|
179 | 148 | static constexpr bool any_v = any<Function, Ts...>::value;
|
180 | 149 |
|
181 | 150 | template<template<class> class Function, class... Ts>
|
182 |
| -struct none: |
183 |
| - conditional_t<any<Function, Ts...>::value, false_type, true_type> {}; |
| 151 | +struct none: truth_type<any<Function, Ts...>::value> {}; |
184 | 152 |
|
185 | 153 | template<template<class> class Function, class... Ts>
|
186 | 154 | static constexpr bool none_v = none<Function, Ts...>::value;
|
@@ -313,23 +281,6 @@ struct common_traits {
|
313 | 281 | using system_tag =
|
314 | 282 | traits::conditional_detected_t<query_system_tag, T, host_tag>;
|
315 | 283 |
|
316 |
| - static auto select_on_get_stream(const T& type) |
317 |
| - { |
318 |
| - static_assert( |
319 |
| - std::is_same<system_tag, host_tag>::value || |
320 |
| - std::is_same<system_tag, device_tag>::value, |
321 |
| - "SystemTag Mismatch"); |
322 |
| - |
323 |
| - return traits::constexpr_ternary<defines_get_stream::value>( |
324 |
| - bc::traits::bind([](const auto& type) { |
325 |
| - return type.get_stream(); |
326 |
| - }, type), |
327 |
| - []() { |
328 |
| - return bc::streams::Stream<system_tag>(); |
329 |
| - } |
330 |
| - ); |
331 |
| - } |
332 |
| - |
333 | 284 | static auto select_on_get_allocator(const T& type)
|
334 | 285 | {
|
335 | 286 | static_assert(
|
|
0 commit comments