Skip to content

Commit 3d22f22

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents e9cae4f + bc8a00a commit 3d22f22

File tree

26 files changed

+1451
-445
lines changed

26 files changed

+1451
-445
lines changed

clang/test/SemaSYCL/deferred-diagnostics-emit.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ void setup_sycl_operation(const T VA[]) {
8383
trickyFloatType malFloatTrick = 41;
8484
// expected-error@+1 {{'__float128' is not supported on this target}}
8585
floatDef malFloatDef = 44;
86-
// expected-error@+2 {{'malFloat' requires 128 bit size '__float128' type support, but device 'spir64' does not support it}}
86+
// expected-error@+2 {{'malFloat' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
8787
// expected-error@+1 {{'__float128' is not supported on this target}}
8888
auto whatFloat = malFloat;
89-
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but device 'spir64' does not support it}}
89+
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
9090
// expected-error@+1 {{'__float128' is not supported on this target}}
9191
auto malAutoTemp5 = bar<__float128>();
92-
// expected-error@+2 {{'bar<const __float128>' requires 128 bit size 'const __float128' type support, but device 'spir64' does not support it}}
92+
// expected-error@+2 {{'bar<const __float128>' requires 128 bit size 'const __float128' type support, but target 'spir64' does not support it}}
9393
// expected-error@+1 {{'__float128' is not supported on this target}}
9494
auto malAutoTemp6 = bar<trickyFloatType>();
9595
// expected-error@+1 {{'__float128' is not supported on this target}}
@@ -106,13 +106,13 @@ void setup_sycl_operation(const T VA[]) {
106106
tricky128Type mal128Trick = 2;
107107
// expected-error@+1 {{'__int128' is not supported on this target}}
108108
int128Def malIntDef = 9;
109-
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
109+
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
110110
// expected-error@+1 {{'__int128' is not supported on this target}}
111111
auto whatInt128 = malIntent;
112-
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
112+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
113113
// expected-error@+1 {{'__int128' is not supported on this target}}
114114
auto malAutoTemp = bar<__int128>();
115-
// expected-error@+2 {{'bar<const __int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
115+
// expected-error@+2 {{'bar<const __int128>' requires 128 bit size 'const __int128' type support, but target 'spir64' does not support it}}
116116
// expected-error@+1 {{'__int128' is not supported on this target}}
117117
auto malAutoTemp2 = bar<tricky128Type>();
118118
// expected-error@+1 {{'__int128' is not supported on this target}}
@@ -127,13 +127,13 @@ void setup_sycl_operation(const T VA[]) {
127127
megeType malTypeDefTrick = 4;
128128
// expected-error@+1 {{'__int128' is not supported on this target}}
129129
int128tDef malInt2Def = 6;
130-
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but device 'spir64' does not support it}}
130+
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but target 'spir64' does not support it}}
131131
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
132132
auto whatUInt = malUInt128;
133-
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
133+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
134134
// expected-error@+1 {{'__int128' is not supported on this target}}
135135
auto malAutoTemp3 = bar<__int128_t>();
136-
// expected-error@+2 {{'bar<const unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but device 'spir64' does not support it}}
136+
// expected-error@+2 {{'bar<const unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but target 'spir64' does not support it}}
137137
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
138138
auto malAutoTemp4 = bar<megeType>();
139139
// expected-error@+1 {{'__int128' is not supported on this target}}

clang/test/SemaSYCL/long-double.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ int main() {
1515
//expected-note@+1 {{'CapturedToDevice' defined here}}
1616
long double CapturedToDevice = 1;
1717
kernel<class variables>([=]() {
18-
// expected-error@+2 {{'foo' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
19-
// expected-error@+1 {{'CapturedToDevice' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
18+
// expected-error@+2 {{'foo' requires 128 bit size 'long double' type support, but target 'spir64' does not support it}}
19+
// expected-error@+1 {{'CapturedToDevice' requires 128 bit size 'long double' type support, but target 'spir64' does not support it}}
2020
foo(CapturedToDevice);
2121
});
2222

clang/test/SemaSYCL/sycl-restrict.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,21 @@ void usage(myFuncDef functionPtr) {
237237
trickyFloatType malFloatTrick = 41;
238238
// expected-error@+1 {{'__float128' is not supported on this target}}
239239
floatDef malFloatDef = 44;
240-
// expected-error@+2 {{'malFloat' requires 128 bit size '__float128' type support, but device 'spir64' does not support it}}
240+
// expected-error@+2 {{'malFloat' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
241241
// expected-error@+1 {{'__float128' is not supported on this target}}
242242
auto whatFloat = malFloat;
243-
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but device 'spir64' does not support it}}
243+
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
244244
// expected-error@+1 {{'__float128' is not supported on this target}}
245245
auto malAutoTemp5 = bar<__float128>();
246-
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but device 'spir64' does not support it}}
246+
// expected-error@+2 {{'bar<__float128>' requires 128 bit size '__float128' type support, but target 'spir64' does not support it}}
247247
// expected-error@+1 {{'__float128' is not supported on this target}}
248248
auto malAutoTemp6 = bar<trickyFloatType>();
249249
// expected-error@+1 {{'__float128' is not supported on this target}}
250250
decltype(malFloat) malDeclFloat = 42;
251-
// expected-error@+2 {{'solutionToEverything<__float128>' requires 128 bit size 'const __float128' type support, but device 'spir64' does not support it}}
251+
// expected-error@+2 {{'solutionToEverything<__float128>' requires 128 bit size 'const __float128' type support, but target 'spir64' does not support it}}
252252
// expected-error@+1 {{'__float128' is not supported on this target}}
253253
auto malFloatTemplateVar = solutionToEverything<__float128>;
254-
// expected-error@+2 {{'solutionToEverything<__float128>' requires 128 bit size 'const __float128' type support, but device 'spir64' does not support it}}
254+
// expected-error@+2 {{'solutionToEverything<__float128>' requires 128 bit size 'const __float128' type support, but target 'spir64' does not support it}}
255255
// expected-error@+1 {{'__float128' is not supported on this target}}
256256
auto malTrifectaFloat = solutionToEverything<trickyFloatType>;
257257
// expected-error@+1 {{'__float128' is not supported on this target}}
@@ -269,21 +269,21 @@ void usage(myFuncDef functionPtr) {
269269
trickyLDType malLDTrick = 51;
270270
// expected-error@+1 {{'long double' is not supported on this target}}
271271
longdoubleDef malLDDef = 52;
272-
// expected-error@+2 {{'malLD' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
272+
// expected-error@+2 {{'malLD' requires 128 bit size 'long double' type support, but target 'spir64' does not support it}}
273273
// expected-error@+1 {{'long double' is not supported on this target}}
274274
auto whatLD = malLD;
275-
// expected-error@+2 {{'bar<long double>' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
275+
// expected-error@+2 {{'bar<long double>' requires 128 bit size 'long double' type support, but target 'spir64' does not support it}}
276276
// expected-error@+1 {{'long double' is not supported on this target}}
277277
auto malAutoLD = bar<long double>();
278-
// expected-error@+2{{'bar<long double>' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
278+
// expected-error@+2{{'bar<long double>' requires 128 bit size 'long double' type support, but target 'spir64' does not support it}}
279279
// expected-error@+1 {{'long double' is not supported on this target}}
280280
auto malAutoLD2 = bar<trickyLDType>();
281281
// expected-error@+1 {{'long double' is not supported on this target}}
282282
decltype(malLD) malDeclLD = 53;
283-
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but device 'spir64' does not support it}}
283+
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but target 'spir64' does not support it}}
284284
// expected-error@+1 {{'long double' is not supported on this target}}
285285
auto malLDTemplateVar = solutionToEverything<long double>;
286-
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but device 'spir64' does not support it}}
286+
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but target 'spir64' does not support it}}
287287
// expected-error@+1 {{'long double' is not supported on this target}}
288288
auto malTrifectaLD = solutionToEverything<trickyLDType>;
289289
// expected-error@+1 {{'long double' is not supported on this target}}
@@ -310,21 +310,21 @@ void usage(myFuncDef functionPtr) {
310310
tricky128Type mal128Trick = 2;
311311
// expected-error@+1 {{'__int128' is not supported on this target}}
312312
int128Def malIntDef = 9;
313-
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
313+
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
314314
// expected-error@+1 {{'__int128' is not supported on this target}}
315315
auto whatInt128 = malIntent;
316-
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
316+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
317317
// expected-error@+1 {{'__int128' is not supported on this target}}
318318
auto malAutoTemp = bar<__int128>();
319-
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
319+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
320320
// expected-error@+1 {{'__int128' is not supported on this target}}
321321
auto malAutoTemp2 = bar<tricky128Type>();
322322
// expected-error@+1 {{'__int128' is not supported on this target}}
323323
decltype(malIntent) malDeclInt = 2;
324-
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
324+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but target 'spir64' does not support it}}
325325
// expected-error@+1 {{'__int128' is not supported on this target}}
326326
auto mal128TemplateVar = solutionToEverything<__int128>;
327-
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
327+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but target 'spir64' does not support it}}
328328
// expected-error@+1 {{'__int128' is not supported on this target}}
329329
auto malTrifecta128 = solutionToEverything<tricky128Type>;
330330
// expected-error@+1 {{'__int128' is not supported on this target}}
@@ -339,21 +339,21 @@ void usage(myFuncDef functionPtr) {
339339
megeType malTypeDefTrick = 4;
340340
// expected-error@+1 {{'__int128' is not supported on this target}}
341341
int128tDef malInt2Def = 6;
342-
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but device 'spir64' does not support it}}
342+
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but target 'spir64' does not support it}}
343343
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
344344
auto whatUInt = malUInt128;
345-
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
345+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
346346
// expected-error@+1 {{'__int128' is not supported on this target}}
347347
auto malAutoTemp3 = bar<__int128_t>();
348-
// expected-error@+2 {{'bar<unsigned __int128>' requires 128 bit size 'unsigned __int128' type support, but device 'spir64' does not support it}}
348+
// expected-error@+2 {{'bar<unsigned __int128>' requires 128 bit size 'unsigned __int128' type support, but target 'spir64' does not support it}}
349349
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
350350
auto malAutoTemp4 = bar<megeType>();
351351
// expected-error@+1 {{'__int128' is not supported on this target}}
352352
decltype(malInt128) malDeclInt128 = 5;
353-
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
353+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but target 'spir64' does not support it}}
354354
// expected-error@+1 {{'__int128' is not supported on this target}}
355355
auto mal128TIntTemplateVar = solutionToEverything<__int128_t>;
356-
// expected-error@+2 {{'solutionToEverything<unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but device 'spir64' does not support it}}
356+
// expected-error@+2 {{'solutionToEverything<unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but target 'spir64' does not support it}}
357357
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
358358
auto malTrifectaInt128T = solutionToEverything<megeType>;
359359

@@ -362,7 +362,7 @@ void usage(myFuncDef functionPtr) {
362362
trickyStruct incitesPanic; // expected-note 3{{used here}}
363363

364364
// ======= Function Prototype Checked =======
365-
// expected-error@+2 2{{'commitInfraction' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
365+
// expected-error@+2 2{{'commitInfraction' requires 128 bit size '__int128' type support, but target 'spir64' does not support it}}
366366
// expected-error@+1 2{{'__int128' is not supported on this target}}
367367
auto notAllowed = &commitInfraction;
368368

libclc/amdgcn-amdhsa/libspirv/SOURCES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ workitem/get_num_groups.cl
1212
workitem/get_max_sub_group_size.cl
1313
workitem/get_num_sub_groups.cl
1414
workitem/get_sub_group_id.cl
15+
workitem/get_sub_group_local_id.cl
1516
workitem/get_sub_group_size.cl
1617
misc/sub_group_shuffle.cl

libclc/amdgcn-amdhsa/libspirv/workitem/get_sub_group_id.cl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ _CLC_DEF _CLC_OVERLOAD uint __spirv_SubgroupId() {
1414
size_t id_z = __spirv_LocalInvocationId_z();
1515
size_t size_x = __spirv_WorkgroupSize_x();
1616
size_t size_y = __spirv_WorkgroupSize_y();
17-
size_t size_z = __spirv_WorkgroupSize_z();
1817
uint sg_size = __spirv_SubgroupMaxSize();
1918
return (id_z * size_y * size_x + id_y * size_x + id_x) / sg_size;
2019
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include <spirv/spirv.h>
10+
11+
_CLC_DEF _CLC_OVERLOAD uint __spirv_SubgroupLocalInvocationId() {
12+
size_t id_x = __spirv_LocalInvocationId_x();
13+
size_t id_y = __spirv_LocalInvocationId_y();
14+
size_t id_z = __spirv_LocalInvocationId_z();
15+
size_t size_x = __spirv_WorkgroupSize_x();
16+
size_t size_y = __spirv_WorkgroupSize_y();
17+
uint sg_size = __spirv_SubgroupMaxSize();
18+
return (id_z * size_y * size_x + id_y * size_x + id_x) % sg_size;
19+
}

libclc/generic/include/lp64_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ typedef _Float16 __clc_vec8_float16_t __attribute__((ext_vector_type(8)));
120120
typedef _Float16 __clc_vec16_float16_t __attribute__((ext_vector_type(16)));
121121

122122
#endif
123-
typedef __clc_int64_t __clc_size_t;
123+
typedef __clc_uint64_t __clc_size_t;
124124

125125
typedef event_t __clc_event_t;
126126

libclc/ptx-nvidiacl/libspirv/math/frexp.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ __spirv_ocl_frexp(__CLC_GENTYPE_VEC x, __CLC_ADDRESS_SPACE int3 *ep) {
4747
int##HALF_VEC_LEN ep_lo; \
4848
int##HALF_VEC_LEN ep_hi; \
4949
GENTYPE res = (GENTYPE)(__spirv_ocl_frexp(x.lo, &ep_lo), \
50-
__spirv_ocl_frexp(x.hi, &ep_lo)); \
50+
__spirv_ocl_frexp(x.hi, &ep_hi)); \
5151
*ep = (int##VEC_LEN)(ep_lo, ep_hi); \
5252
return res; \
5353
}

0 commit comments

Comments
 (0)