Skip to content

Commit 843283f

Browse files
committed
ROCM-1254 - fix std::void_t, std::true_type and std::false_type not available when on RTC
1 parent 617349a commit 843283f

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

projects/clr/hipamd/include/hip/amd_detail/amd_hip_cooperative_groups_reduce.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,58 +23,58 @@ namespace impl {
2323
typename __hip_internal::remove_cvref<U>>;
2424

2525
template <typename T, typename = void>
26-
struct has_add : std::false_type {
26+
struct has_add : __hip_internal::false_type {
2727
};
2828

2929
template <typename T>
3030
struct has_add<T,
31-
std::void_t<decltype(__reduce_add_sync<unsigned long long>(0ull, T {}))>
32-
> : std::true_type {};
31+
__hip_internal::void_t<decltype(__reduce_add_sync<unsigned long long>(0ull, T {}))>
32+
> : __hip_internal::true_type {};
3333

3434
template <typename T, typename = void>
35-
struct has_min : std::false_type {
35+
struct has_min : __hip_internal::false_type {
3636
};
3737

3838
template <typename T>
3939
struct has_min<T,
40-
std::void_t<decltype(__reduce_min_sync<unsigned long long>(0ull, T {}))>
41-
> : std::true_type {};
40+
__hip_internal::void_t<decltype(__reduce_min_sync<unsigned long long>(0ull, T {}))>
41+
> : __hip_internal::true_type {};
4242

4343
template <typename T, typename = void>
44-
struct has_max : std::false_type {
44+
struct has_max : __hip_internal::false_type {
4545
};
4646

4747
template <typename T>
4848
struct has_max<T,
49-
std::void_t<decltype(__reduce_max_sync<unsigned long long>(0ull, T {}))>
50-
> : std::true_type {};
49+
__hip_internal::void_t<decltype(__reduce_max_sync<unsigned long long>(0ull, T {}))>
50+
> : __hip_internal::true_type {};
5151

5252
template <typename T, typename = void>
53-
struct has_and : std::false_type {
53+
struct has_and : __hip_internal::false_type {
5454
};
5555

5656
template <typename T>
5757
struct has_and<T,
58-
std::void_t<decltype(__reduce_and_sync<unsigned long long>(0ull, T {}))>
59-
> : std::true_type {};
58+
__hip_internal::void_t<decltype(__reduce_and_sync<unsigned long long>(0ull, T {}))>
59+
> : __hip_internal::true_type {};
6060

6161
template <typename T, typename = void>
62-
struct has_or : std::false_type {
62+
struct has_or : __hip_internal::false_type {
6363
};
6464

6565
template <typename T>
6666
struct has_or<T,
67-
std::void_t<decltype(__reduce_or_sync<unsigned long long>(0ull, T {}))>
68-
> : std::true_type {};
67+
__hip_internal::void_t<decltype(__reduce_or_sync<unsigned long long>(0ull, T {}))>
68+
> : __hip_internal::true_type {};
6969

7070
template <typename T, typename = void>
71-
struct has_xor : std::false_type {
71+
struct has_xor : __hip_internal::false_type {
7272
};
7373

7474
template <typename T>
7575
struct has_xor<T,
76-
std::void_t<decltype(__reduce_xor_sync<unsigned long long>(0ull, T {}))>
77-
> : std::true_type {};
76+
__hip_internal::void_t<decltype(__reduce_xor_sync<unsigned long long>(0ull, T {}))>
77+
> : __hip_internal::true_type {};
7878

7979
// we can call reduce() only the block tiles that have a compile-time size
8080
template <class TyGroup>

projects/clr/hipamd/include/hip/amd_detail/host_defines.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ template <typename _Tp, bool = is_arithmetic<_Tp>::value> struct is_signed : pub
101101
template <typename _Tp> struct is_signed<_Tp, true> : public true_or_false_type<_Tp(-1) < _Tp(0)> {
102102
};
103103

104+
template< class... >
105+
using void_t = void;
106+
104107
template <class T> auto test_returnable(int)
105108
-> decltype(void(static_cast<T (*)()>(nullptr)), true_type{});
106109
template <class> auto test_returnable(...) -> false_type;

0 commit comments

Comments
 (0)