Skip to content

Commit 72f683c

Browse files
[SYCL] Stop using non-standard vec aliases in tests (intel#1477) (intel#1501)
According to 4.14.2.2. Aliases of SYCL 2020 specification, revision 6, `longlong{N}` aliases do not exists. There is corresponding PR to remove them from the implementation: intel/llvm#7889
1 parent ec3e761 commit 72f683c

File tree

3 files changed

+58
-49
lines changed

3 files changed

+58
-49
lines changed

SYCL/DeviceLib/built-ins/nan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int main() {
4545
test_nan_call<s::ushort2, s::half2>();
4646
test_nan_call<s::uint2, s::float2>();
4747
test_nan_call<s::ulong2, s::double2>();
48-
test_nan_call<s::ulonglong2, s::double2>();
48+
test_nan_call<s::vec<unsigned long long, 2>, s::double2>();
4949

5050
s::queue Queue([](sycl::exception_list ExceptionList) {
5151
for (std::exception_ptr ExceptionPtr : ExceptionList) {

SYCL/DeviceLib/built-ins/vector_integer.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ int main() {
7070

7171
// max (longlong2)
7272
{
73-
s::longlong2 r{0};
73+
using longlong2 = s::vec<long long, 2>;
74+
longlong2 r{0};
7475
{
75-
s::buffer<s::longlong2, 1> BufR(&r, s::range<1>(1));
76+
s::buffer<longlong2, 1> BufR(&r, s::range<1>(1));
7677
s::queue myQueue;
7778
myQueue.submit([&](s::handler &cgh) {
7879
auto AccR = BufR.get_access<s::access::mode::write>(cgh);
7980
cgh.single_task<class maxSLL2SLL1>([=]() {
80-
AccR[0] = s::max(s::longlong2{5, 3}, s::longlong{2});
81+
AccR[0] = s::max(longlong2{5, 3}, s::longlong{2});
8182
});
8283
});
8384
}
@@ -108,14 +109,15 @@ int main() {
108109

109110
// max (ulonglong2)
110111
{
111-
s::ulonglong2 r{0};
112+
using ulonglong2 = s::vec<unsigned long long, 2>;
113+
ulonglong2 r{0};
112114
{
113-
s::buffer<s::ulonglong2, 1> BufR(&r, s::range<1>(1));
115+
s::buffer<ulonglong2, 1> BufR(&r, s::range<1>(1));
114116
s::queue myQueue;
115117
myQueue.submit([&](s::handler &cgh) {
116118
auto AccR = BufR.get_access<s::access::mode::write>(cgh);
117119
cgh.single_task<class maxULL2ULL1>([=]() {
118-
AccR[0] = s::max(s::ulonglong2{5, 3}, s::ulonglong{2});
120+
AccR[0] = s::max(ulonglong2{5, 3}, s::ulonglong{2});
119121
});
120122
});
121123
}
@@ -222,14 +224,16 @@ int main() {
222224

223225
// abs (longlong)
224226
{
225-
s::ulonglong2 r{0};
227+
using ulonglong2 = s::vec<unsigned long long, 2>;
228+
using longlong2 = s::vec<long long, 2>;
229+
ulonglong2 r{0};
226230
{
227-
s::buffer<s::ulonglong2, 1> BufR(&r, s::range<1>(1));
231+
s::buffer<ulonglong2, 1> BufR(&r, s::range<1>(1));
228232
s::queue myQueue;
229233
myQueue.submit([&](s::handler &cgh) {
230234
auto AccR = BufR.get_access<s::access::mode::write>(cgh);
231235
cgh.single_task<class absSL2>([=]() {
232-
AccR[0] = s::abs(s::longlong2{-5, -2});
236+
AccR[0] = s::abs(longlong2{-5, -2});
233237
});
234238
});
235239
}

SYCL/Regression/mad_sat.cpp

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@
88
int main() {
99
sycl::queue testQueue;
1010

11+
using longlong3 = sycl::vec<long long, 3>;
12+
using longlong4 = sycl::vec<long long, 4>;
13+
using longlong8 = sycl::vec<long long, 8>;
14+
using longlong16 = sycl::vec<long long, 16>;
15+
1116
{
12-
const sycl::longlong3 verification3(
13-
9223372036854775807LL, 9223372036854775807LL, -9223372036854775808LL);
17+
const longlong3 verification3(9223372036854775807LL, 9223372036854775807LL,
18+
-9223372036854775808LL);
1419

15-
sycl::longlong3 inputData_0(1152105081885725616LL, 8383539663869980295LL,
16-
-3013159033463244495LL);
17-
sycl::longlong3 inputData_1(9169239286331099647LL, 8545168655265359544LL,
18-
69290337040907021LL);
19-
sycl::longlong3 inputData_2(-5670250901301018333LL, 216462155376518854LL,
20-
-7910909987096217335LL);
20+
longlong3 inputData_0(1152105081885725616LL, 8383539663869980295LL,
21+
-3013159033463244495LL);
22+
longlong3 inputData_1(9169239286331099647LL, 8545168655265359544LL,
23+
69290337040907021LL);
24+
longlong3 inputData_2(-5670250901301018333LL, 216462155376518854LL,
25+
-7910909987096217335LL);
2126

22-
sycl::buffer<sycl::longlong3, 1> buffer(1);
27+
sycl::buffer<longlong3, 1> buffer(1);
2328

2429
testQueue.submit([&](sycl::handler &h) {
2530
auto resultPtr = buffer.template get_access<sycl::access::mode::write>(h);
@@ -32,18 +37,18 @@ int main() {
3237
assert((HostAccessor[0][i] == verification3[i]) && "Incorrect result");
3338
}
3439
{
35-
const sycl::longlong4 verification4(
36-
9223372036854775807LL, 9223372036854775807LL, -9223372036854775808LL,
37-
9223372036854775807LL);
40+
const longlong4 verification4(9223372036854775807LL, 9223372036854775807LL,
41+
-9223372036854775808LL,
42+
9223372036854775807LL);
3843

39-
sycl::longlong4 inputData_0(-4713774672458165250LL, 7161321293740295698LL,
40-
-7560042360032818022LL, 1712118953348815386LL);
41-
sycl::longlong4 inputData_1(-5256951628950351348LL, 3094294642897896981LL,
42-
4183324171724765944LL, 1726930751531248453LL);
43-
sycl::longlong4 inputData_2(-614349234816759997LL, -7793620271163345724LL,
44-
5480991826433743823LL, -3977840325478979484LL);
44+
longlong4 inputData_0(-4713774672458165250LL, 7161321293740295698LL,
45+
-7560042360032818022LL, 1712118953348815386LL);
46+
longlong4 inputData_1(-5256951628950351348LL, 3094294642897896981LL,
47+
4183324171724765944LL, 1726930751531248453LL);
48+
longlong4 inputData_2(-614349234816759997LL, -7793620271163345724LL,
49+
5480991826433743823LL, -3977840325478979484LL);
4550

46-
sycl::buffer<sycl::longlong4, 1> buffer(1);
51+
sycl::buffer<longlong4, 1> buffer(1);
4752

4853
testQueue.submit([&](sycl::handler &h) {
4954
auto resultPtr = buffer.template get_access<sycl::access::mode::write>(h);
@@ -56,25 +61,25 @@ int main() {
5661
assert((HostAccessor[0][i] == verification4[i]) && "Incorrect result");
5762
}
5863
{
59-
const sycl::longlong8 verification8(
64+
const longlong8 verification8(
6065
9223372036854775807LL, 9223372036854775807LL, -9223372036854775808LL,
6166
-9223372036854775808LL, 9223372036854775807LL, 9223372036854775807LL,
6267
-9223372036854775808LL, -9223372036854775808LL);
6368

64-
sycl::longlong8 inputData_0(3002837817109371705LL, -6132505093056073745LL,
65-
-2677806413031023542LL, -3906932152445696896LL,
66-
-5966911996430888011LL, 487233493241732294LL,
67-
8234534527416862935LL, 8302379558520488989LL);
68-
sycl::longlong8 inputData_1(3895748400226584336LL, -3171989754828069475LL,
69-
6135091761884568657LL, 3449810579449494485LL,
70-
-5153085649597103327LL, 2036067225828737775LL,
71-
-2456339276147680058LL, -2321401317481120691LL);
72-
sycl::longlong8 inputData_2(5847800471474896191LL, 6421268696360310080LL,
73-
426131359031594004LL, 3388848179800138438LL,
74-
9095634920776267157LL, 3909069092545608647LL,
75-
-6551917618131929798LL, -5283018165188606431LL);
76-
77-
sycl::buffer<sycl::longlong8, 1> buffer(1);
69+
longlong8 inputData_0(3002837817109371705LL, -6132505093056073745LL,
70+
-2677806413031023542LL, -3906932152445696896LL,
71+
-5966911996430888011LL, 487233493241732294LL,
72+
8234534527416862935LL, 8302379558520488989LL);
73+
longlong8 inputData_1(3895748400226584336LL, -3171989754828069475LL,
74+
6135091761884568657LL, 3449810579449494485LL,
75+
-5153085649597103327LL, 2036067225828737775LL,
76+
-2456339276147680058LL, -2321401317481120691LL);
77+
longlong8 inputData_2(5847800471474896191LL, 6421268696360310080LL,
78+
426131359031594004LL, 3388848179800138438LL,
79+
9095634920776267157LL, 3909069092545608647LL,
80+
-6551917618131929798LL, -5283018165188606431LL);
81+
82+
sycl::buffer<longlong8, 1> buffer(1);
7883

7984
testQueue.submit([&](sycl::handler &h) {
8085
auto resultPtr = buffer.template get_access<sycl::access::mode::write>(h);
@@ -87,37 +92,37 @@ int main() {
8792
assert((HostAccessor[0][i] == verification8[i]) && "Incorrect result");
8893
}
8994
{
90-
const sycl::longlong16 verification16(
95+
const longlong16 verification16(
9196
-9223372036854775808LL, 9223372036854775807LL, 9223372036854775807LL,
9297
-9223372036854775808LL, 9223372036854775807LL, 9223372036854775807LL,
9398
9223372036854775807LL, 9223372036854775807LL, 9223372036854775807LL,
9499
9223372036854775807LL, -9223372036854775808LL, 9223372036854775807LL,
95100
-9223372036854775808LL, 9223372036854775807LL, -9223372036854775808LL,
96101
-9223372036854775808LL);
97102

98-
sycl::longlong16 inputData_0(
103+
longlong16 inputData_0(
99104
4711072418277000515LL, -8205098172692021203LL, -7385016145788992368LL,
100105
5953521028589173909LL, -5219240995491769312LL, 8710496141913755416LL,
101106
-6685846261491268433LL, 4193173269411595542LL, -8540195959022520771LL,
102107
-4715465363106336895LL, -1020086937442724783LL, 4496316677230042947LL,
103108
1321442475247578017LL, -7374746170855359764LL, -3206370806055241163LL,
104109
-2175226063524462053LL);
105-
sycl::longlong16 inputData_1(
110+
longlong16 inputData_1(
106111
-9126728881985856159LL, -8235441378758843293LL, -3529617622861997052LL,
107112
-4696495345590499183LL, -2446014787831249326LL, 3966377959819902357LL,
108113
-8707315735766590681LL, 4940281453308003965LL, -4008494233289413829LL,
109114
-1007875458987895243LL, 8007184939842565626LL, 7006363475270750393LL,
110115
-3126435375497361798LL, -2666957213164527889LL, 3425215156535282625LL,
111116
5057359883753713949LL);
112-
sycl::longlong16 inputData_2(
117+
longlong16 inputData_2(
113118
-5792361016316836568LL, 1155364222481085809LL, 7552404711758320408LL,
114119
-9123476257323872288LL, -924920183965907175LL, 1921314238201973170LL,
115120
3462681782260196063LL, 7822120358287768333LL, -3130033938219713817LL,
116121
-3165995450630991604LL, -7647706888277832178LL, -8427901934971949821LL,
117122
4207763935319579681LL, 1564279736903158695LL, 3722632463806041635LL,
118123
939009161285897285LL);
119124

120-
sycl::buffer<sycl::longlong16, 1> buffer(1);
125+
sycl::buffer<longlong16, 1> buffer(1);
121126

122127
testQueue.submit([&](sycl::handler &h) {
123128
auto resultPtr = buffer.template get_access<sycl::access::mode::write>(h);

0 commit comments

Comments
 (0)