Skip to content

Commit 6a95367

Browse files
authored
[SYCL] Remove kernel_signature_start from int header (#2537)
Some time ago, the `kernel_signatures` array used `kind_none` as a delimiter between signatures of different kernels. The `kernel_signature_start` array's values were computed with a `+ 1` to account for this. Then one day the delimiter was removed but the `+ 1` remained. It wasn't noticed that the values were off by 1 because `kernel_signature_start` isn't being used anymore anyway. Therefore in this change, we simply remove it. GH issue #2490
1 parent 704afa2 commit 6a95367

File tree

7 files changed

+1
-56
lines changed

7 files changed

+1
-56
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,30 +3747,8 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
37473747
}
37483748
O << "};\n\n";
37493749

3750-
O << "// indices into the kernel_signatures array, each representing a "
3751-
"start"
3752-
" of\n";
3753-
O << "// kernel signature descriptor subarray of the kernel_signatures"
3754-
" array;\n";
3755-
O << "// the index order in this array corresponds to the kernel name order"
3756-
" in the\n";
3757-
O << "// kernel_names array\n";
3758-
O << "static constexpr\n";
3759-
O << "const unsigned kernel_signature_start[] = {\n";
3760-
unsigned CurStart = 0;
3761-
3762-
for (unsigned I = 0; I < KernelDescs.size(); I++) {
3763-
auto &K = KernelDescs[I];
3764-
O << " " << CurStart;
3765-
if (I < KernelDescs.size() - 1)
3766-
O << ",";
3767-
O << " // " << K.Name << "\n";
3768-
CurStart += K.Params.size() + 1;
3769-
}
3770-
O << "};\n\n";
3771-
37723750
O << "// Specializations of KernelInfo for kernel function types:\n";
3773-
CurStart = 0;
3751+
unsigned CurStart = 0;
37743752

37753753
for (const KernelDesc &K : KernelDescs) {
37763754
const size_t N = K.Params.size();

clang/test/CodeGenSYCL/kernel-param-acc-array-ih.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
// CHECK-EMPTY:
2626
// CHECK-NEXT: };
2727

28-
// CHECK: static constexpr
29-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
30-
// CHECK-NEXT: 0 // _ZTSZ4mainE8kernel_A
31-
// CHECK-NEXT: };
32-
3328
// CHECK: template <> struct KernelInfo<class kernel_A> {
3429

3530
#include "Inputs/sycl.hpp"

clang/test/CodeGenSYCL/kernel-param-member-acc-array-ih.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
// CHECK-EMPTY:
2626
// CHECK-NEXT: };
2727

28-
// CHECK: static constexpr
29-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
30-
// CHECK-NEXT: 0 // _ZTSZ4mainE8kernel_C
31-
// CHECK-NEXT: };
32-
3328
// CHECK: template <> struct KernelInfo<class kernel_C> {
3429

3530
#include "Inputs/sycl.hpp"

clang/test/CodeGenSYCL/kernel-param-pod-array-ih.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131
// CHECK-EMPTY:
3232
// CHECK-NEXT: };
3333

34-
// CHECK: static constexpr
35-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
36-
// CHECK-NEXT: 0, // _ZTSZ4mainE8kernel_B
37-
// CHECK-NEXT: 2, // _ZTSZ4mainE8kernel_C
38-
// CHECK-NEXT: 4 // _ZTSZ4mainE8kernel_D
39-
// CHECK-NEXT: };
40-
4134
// CHECK: template <> struct KernelInfo<class kernel_B> {
4235
// CHECK: template <> struct KernelInfo<class kernel_C> {
4336
// CHECK: template <> struct KernelInfo<class kernel_D> {

clang/test/CodeGenSYCL/stdtypes_kernel_type.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
// CHECK-NEXT: //--- _ZTSl
1919
// CHECK-EMPTY:
2020
// CHECK-NEXT: };
21-
//
22-
// CHECK: static constexpr
23-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
24-
// CHECK-NEXT: 0, // _ZTSm
25-
// CHECK-NEXT: 1 // _ZTSl
26-
// CHECK-NEXT: };
2721

2822
// CHECK: template <> struct KernelInfo<unsigned long> {
2923
// CHECK: template <> struct KernelInfo<long> {

clang/test/CodeGenSYCL/union-kernel-param-ih.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
// CHECK-EMPTY:
2525
// CHECK-NEXT:};
2626

27-
// CHECK: static constexpr
28-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
29-
// CHECK-NEXT: 0 // _ZTSZ4mainE8kernel_A
30-
// CHECK-NEXT: };
31-
3227
// CHECK: template <> struct KernelInfo<class kernel_A> {
3328

3429
union MyUnion {

clang/test/CodeGenSYCL/wrapped-accessor.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
// CHECK-EMPTY:
2222
// CHECK-NEXT: };
2323

24-
// CHECK: static constexpr
25-
// CHECK-NEXT: const unsigned kernel_signature_start[] = {
26-
// CHECK-NEXT: 0 // _ZTSZ4mainE14wrapped_access
27-
// CHECK-NEXT: };
28-
2924
// CHECK: template <> struct KernelInfo<class wrapped_access> {
3025

3126
#include "Inputs/sycl.hpp"

0 commit comments

Comments
 (0)