@@ -27,12 +27,11 @@ struct test_struct {
27
27
long long d;
28
28
half e;
29
29
float f;
30
- double g;
31
30
};
32
31
33
32
bool operator ==(const test_struct &lhs, const test_struct &rhs) {
34
33
return lhs.a == rhs.a && lhs.b == rhs.b && lhs.c == rhs.c && lhs.d == rhs.d &&
35
- lhs.e == rhs.e && lhs.f == rhs.f && lhs. g == rhs. g ;
34
+ lhs.e == rhs.e && lhs.f == rhs.f ;
36
35
}
37
36
38
37
template <typename T> T *regular (queue q, alloc kind) {
@@ -44,6 +43,9 @@ template <typename T> T *aligned(queue q, alloc kind) {
44
43
}
45
44
46
45
template <typename T> void test (queue q, T val, T *src, T *dst, bool dev_dst) {
46
+ if (std::is_same_v<T, double > && !q.get_device ().has (aspect::fp64))
47
+ return ;
48
+
47
49
q.fill (src, val, N).wait ();
48
50
49
51
// Use queue::copy for the first half and handler::copy for the second
@@ -87,7 +89,7 @@ int main() {
87
89
queue q;
88
90
auto dev = q.get_device ();
89
91
90
- test_struct test_obj{4 , 42 , 424 , 4242 , 4 .2f , 4 .242f , 4.24242 };
92
+ test_struct test_obj{4 , 42 , 424 , 4242 , 4 .2f , 4 .242f };
91
93
92
94
if (dev.has (aspect::usm_host_allocations)) {
93
95
runTests<short >(q, 4 , alloc::host, alloc::host);
@@ -96,10 +98,8 @@ int main() {
96
98
runTests<long long >(q, 4242 , alloc::host, alloc::host);
97
99
runTests<half>(q, half (4 .2f ), alloc::host, alloc::host);
98
100
runTests<float >(q, 4 .242f , alloc::host, alloc::host);
99
- if (dev.has (aspect::fp64)) {
100
- runTests<double >(q, 4.24242 , alloc::host, alloc::host);
101
- runTests<test_struct>(q, test_obj, alloc::host, alloc::host);
102
- }
101
+ runTests<double >(q, 4.24242 , alloc::host, alloc::host);
102
+ runTests<test_struct>(q, test_obj, alloc::host, alloc::host);
103
103
}
104
104
105
105
if (dev.has (aspect::usm_shared_allocations)) {
@@ -109,10 +109,8 @@ int main() {
109
109
runTests<long long >(q, 4242 , alloc::shared, alloc::shared);
110
110
runTests<half>(q, half (4 .2f ), alloc::shared, alloc::shared);
111
111
runTests<float >(q, 4 .242f , alloc::shared, alloc::shared);
112
- if (dev.has (aspect::fp64)) {
113
- runTests<double >(q, 4.24242 , alloc::shared, alloc::shared);
114
- runTests<test_struct>(q, test_obj, alloc::shared, alloc::shared);
115
- }
112
+ runTests<double >(q, 4.24242 , alloc::shared, alloc::shared);
113
+ runTests<test_struct>(q, test_obj, alloc::shared, alloc::shared);
116
114
}
117
115
118
116
if (dev.has (aspect::usm_device_allocations)) {
@@ -122,10 +120,8 @@ int main() {
122
120
runTests<long long >(q, 4242 , alloc::device, alloc::device);
123
121
runTests<half>(q, half (4 .2f ), alloc::device, alloc::device);
124
122
runTests<float >(q, 4 .242f , alloc::device, alloc::device);
125
- if (dev.has (aspect::fp64)) {
126
- runTests<double >(q, 4.24242 , alloc::device, alloc::device);
127
- runTests<test_struct>(q, test_obj, alloc::device, alloc::device);
128
- }
123
+ runTests<double >(q, 4.24242 , alloc::device, alloc::device);
124
+ runTests<test_struct>(q, test_obj, alloc::device, alloc::device);
129
125
}
130
126
131
127
if (dev.has (aspect::usm_host_allocations) &&
@@ -136,10 +132,8 @@ int main() {
136
132
runTests<long long >(q, 4242 , alloc::host, alloc::shared);
137
133
runTests<half>(q, half (4 .2f ), alloc::host, alloc::shared);
138
134
runTests<float >(q, 4 .242f , alloc::host, alloc::shared);
139
- if (dev.has (aspect::fp64)) {
140
- runTests<double >(q, 4.24242 , alloc::host, alloc::shared);
141
- runTests<test_struct>(q, test_obj, alloc::host, alloc::shared);
142
- }
135
+ runTests<double >(q, 4.24242 , alloc::host, alloc::shared);
136
+ runTests<test_struct>(q, test_obj, alloc::host, alloc::shared);
143
137
}
144
138
145
139
if (dev.has (aspect::usm_host_allocations) &&
@@ -150,10 +144,8 @@ int main() {
150
144
runTests<long long >(q, 4242 , alloc::host, alloc::device);
151
145
runTests<half>(q, half (4 .2f ), alloc::host, alloc::device);
152
146
runTests<float >(q, 4 .242f , alloc::host, alloc::device);
153
- if (dev.has (aspect::fp64)) {
154
- runTests<double >(q, 4.24242 , alloc::host, alloc::device);
155
- runTests<test_struct>(q, test_obj, alloc::host, alloc::device);
156
- }
147
+ runTests<double >(q, 4.24242 , alloc::host, alloc::device);
148
+ runTests<test_struct>(q, test_obj, alloc::host, alloc::device);
157
149
}
158
150
159
151
if (dev.has (aspect::usm_shared_allocations) &&
@@ -164,10 +156,8 @@ int main() {
164
156
runTests<long long >(q, 4242 , alloc::shared, alloc::device);
165
157
runTests<half>(q, half (4 .2f ), alloc::shared, alloc::device);
166
158
runTests<float >(q, 4 .242f , alloc::shared, alloc::device);
167
- if (dev.has (aspect::fp64)) {
168
- runTests<double >(q, 4.24242 , alloc::shared, alloc::device);
169
- runTests<test_struct>(q, test_obj, alloc::shared, alloc::device);
170
- }
159
+ runTests<double >(q, 4.24242 , alloc::shared, alloc::device);
160
+ runTests<test_struct>(q, test_obj, alloc::shared, alloc::device);
171
161
}
172
162
173
163
return 0 ;
0 commit comments