15
15
16
16
#pragma once
17
17
18
+ <<<<<<< HEAD
18
19
<<<<<<< HEAD
19
20
#include " type_traits.hpp"
20
21
=======
21
22
>>>>>>> cfb578f75 ([SYCL][ESIMD] Add utility function for constructing conversion ref data (#696 ))
23
+ =======
24
+ #include " type_traits.hpp"
25
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
22
26
#include " value.hpp"
23
27
24
28
namespace esimd_test ::api::functional {
@@ -29,11 +33,15 @@ namespace esimd_test::api::functional {
29
33
// static_cast<int>(unsigned int).
30
34
template <typename SrcT, typename DstT> struct value_conv {
31
35
static inline SrcT denorm_min () {
36
+ <<<<<<< HEAD
32
37
<<<<<<< HEAD
33
38
if constexpr (!type_traits::is_sycl_floating_point_v<SrcT>) {
34
39
=======
35
40
if constexpr (!type_traits::is_sycl_floating_point_v<DataT>) {
36
41
>>>>>>> cfb578f75 ([SYCL][ESIMD] Add utility function for constructing conversion ref data (#696 ))
42
+ =======
43
+ if constexpr (!type_traits::is_sycl_floating_point_v<SrcT>) {
44
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
37
45
// Return zero for any integral type the same way std::denorm_min does
38
46
return 0 ;
39
47
} else if constexpr (sizeof (SrcT) > sizeof (DstT)) {
@@ -59,6 +67,7 @@ std::vector<SrcT> generate_ref_conv_data() {
59
67
60
68
// TODO: Implement functions for obtain lowest and max values without UB
61
69
// cases.
70
+ <<<<<<< HEAD
62
71
<<<<<<< HEAD
63
72
static const SrcT positive = static_cast <SrcT>(126.75 );
64
73
static const SrcT max = 10 ;
@@ -72,18 +81,32 @@ std::vector<SrcT> generate_ref_conv_data() {
72
81
static const SrcT denorm = value_conv<SrcT, DstT>::denorm_min ();
73
82
static const SrcT positive = static_cast <SrcT>(126.75 );
74
83
>>>>>>> cfb578f75 ([SYCL][ESIMD] Add utility function for constructing conversion ref data (#696 ))
84
+ =======
85
+ static const SrcT positive = static_cast <SrcT>(126.75 );
86
+ static const SrcT max = 10 ;
87
+ // Use zero for unsigned types
88
+ static const SrcT min = std::min<SrcT>(-max, 0 );
89
+ static const SrcT max_half = max / 2 ;
90
+ static const SrcT min_half = min / 2 ;
91
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
75
92
76
93
std::vector<SrcT> ref_data;
77
94
78
95
if constexpr (type_traits::is_sycl_floating_point_v<SrcT> &&
79
96
type_traits::is_sycl_floating_point_v<DstT>) {
80
97
<<<<<<< HEAD
98
+ <<<<<<< HEAD
99
+ =======
100
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
81
101
static const SrcT nan = value<SrcT>::nan ();
82
102
static const SrcT inf = value<SrcT>::inf ();
83
103
static const SrcT denorm = value_conv<SrcT, DstT>::denorm_min ();
84
104
105
+ <<<<<<< HEAD
85
106
=======
86
107
>>>>>>> cfb578f75 ([SYCL][ESIMD] Add utility function for constructing conversion ref data (#696 ))
108
+ =======
109
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
87
110
ref_data = details::construct_ref_data<SrcT, NumElems>(
88
111
{min, max, -0.0 , +0.0 , 0.1 , denorm, nan, -inf});
89
112
} else if constexpr (type_traits::is_sycl_floating_point_v<SrcT> &&
@@ -112,14 +135,20 @@ std::vector<SrcT> generate_ref_conv_data() {
112
135
ref_data = details::construct_ref_data<SrcT, NumElems>(
113
136
{-0.0 , max, max_half, -max_half});
114
137
} else if constexpr (type_traits::is_sycl_floating_point_v<SrcT> &&
115
- std::is_signed_v <DstT>) {
138
+ type_traits::is_sycl_signed_v <DstT>) {
116
139
ref_data = details::construct_ref_data<SrcT, NumElems>(
117
140
{-0.0 , max, max_half, min, min_half});
118
- } else if constexpr (std::is_signed_v<SrcT> && std::is_signed_v<DstT>) {
141
+ } else if constexpr (type_traits::is_sycl_signed_v<SrcT> &&
142
+ type_traits::is_sycl_signed_v<DstT>) {
119
143
ref_data = details::construct_ref_data<SrcT, NumElems>(
120
144
{min, min_half, 0 , max_half, max});
145
+ <<<<<<< HEAD
121
146
} else if constexpr (std::is_signed_v<SrcT> && std::is_unsigned_v<DstT>) {
122
147
>>>>>>> cfb578f75 ([SYCL][ESIMD] Add utility function for constructing conversion ref data (#696 ))
148
+ =======
149
+ } else if constexpr (type_traits::is_sycl_signed_v<SrcT> &&
150
+ std::is_unsigned_v<DstT>) {
151
+ >>>>>>> e737b795e ([SYCL][ESIMD] Add tests for simd broadcast constructor (#690 ))
123
152
static const SrcT src_min = value<SrcT>::lowest ();
124
153
static const SrcT src_min_half = src_min / 2 ;
125
154
0 commit comments