Skip to content

Commit 2277e52

Browse files
committed
Remove unnecessary changes
Signed-off-by: Mikhail Lychkov <[email protected]>
1 parent f0d3556 commit 2277e52

File tree

3 files changed

+10
-71
lines changed

3 files changed

+10
-71
lines changed

clang/test/CodeGenSYCL/Inputs/sycl.hpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
#pragma once
22

3-
typedef __UINT8_TYPE__ uint8_t;
4-
typedef __SIZE_TYPE__ size_t;
5-
63
#define ATTR_SYCL_KERNEL __attribute__((sycl_kernel))
74

8-
#ifndef __SYCL_ALWAYS_INLINE
9-
#if __has_attribute(always_inline)
10-
#define __SYCL_ALWAYS_INLINE __attribute__((always_inline))
11-
#else
12-
#define __SYCL_ALWAYS_INLINE
13-
#endif
14-
#endif // __SYCL_ALWAYS_INLINE
15-
165
// Dummy runtime classes to model SYCL API.
176
namespace cl {
187
namespace sycl {
@@ -505,19 +494,5 @@ class image {
505494
}
506495
};
507496

508-
extern "C" SYCL_EXTERNAL __attribute__((opencl_local)) uint8_t *
509-
__sycl_allocateLocalMemory(size_t Size, size_t Alignment);
510-
511-
template <typename T>
512-
__attribute__((opencl_local)) T *
513-
__SYCL_ALWAYS_INLINE
514-
group_local_memory() {
515-
#ifdef __SYCL_DEVICE_ONLY__
516-
__attribute__((opencl_local)) uint8_t *AllocatedMem =
517-
__sycl_allocateLocalMemory(sizeof(T), alignof(T));
518-
return (__attribute__((opencl_local)) T *)AllocatedMem;
519-
#endif
520-
}
521-
522497
} // namespace sycl
523498
} // namespace cl
Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,8 @@
1-
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -disable-llvm-passes -S -emit-llvm %s -o - | FileCheck --check-prefixes=CHECK,CHECK-UNOPT %s
2-
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -S -emit-llvm %s -o - | FileCheck %s
3-
4-
// CHECK: [[WGLOCALMEM_1:@WGLocalMem.*]] = internal addrspace(3) global [8 x i8] undef, align 8
5-
// CHECK: [[WGLOCALMEM_2:@WGLocalMem.*]] = internal addrspace(3) global [4 x i8] undef, align 4
6-
// CHECK: [[WGLOCALMEM_3:@WGLocalMem.*]] = internal addrspace(3) global [128 x i8] undef, align 4
7-
8-
// CHECK-NOT: __sycl_allocateLocalMemory
9-
10-
#include "Inputs/sycl.hpp"
11-
12-
constexpr size_t WgSize = 32;
13-
constexpr size_t WgCount = 4;
14-
constexpr size_t Size = WgSize * WgCount;
15-
16-
class KernelA;
17-
class KernelB;
18-
19-
using namespace cl::sycl;
20-
21-
int main() {
22-
queue Q;
23-
{
24-
Q.submit([&](handler &cgh) {
25-
cgh.parallel_for<KernelA>(
26-
range<1>(Size), [=](item<1> Item) {
27-
auto *Ptr1 = group_local_memory<long>();
28-
// CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([8 x i8], [8 x i8] addrspace(3)* [[WGLOCALMEM_1]], i32 0, i32 0)
29-
auto *Ptr2 = group_local_memory<float>();
30-
// CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([4 x i8], [4 x i8] addrspace(3)* [[WGLOCALMEM_2]], i32 0, i32 0)
31-
});
32-
});
33-
}
34-
35-
{
36-
Q.submit([&](handler &cgh) {
37-
cgh.parallel_for<KernelB>(
38-
range<1>(Size), [=](item<1> Item) {
39-
auto *Ptr3 = group_local_memory<int[WgSize]>();
40-
// CHECK-UNOPT: i8 addrspace(3)* getelementptr inbounds ([128 x i8], [128 x i8] addrspace(3)* [[WGLOCALMEM_3]], i32 0, i32 0)
41-
});
42-
});
43-
}
44-
}
1+
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice \
2+
// RUN: -S -emit-llvm -mllvm -debug-pass=Structure -disable-llvm-passes \
3+
// RUN: -o - %s 2>&1 | FileCheck %s
4+
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice \
5+
// RUN: -S -emit-llvm -mllvm -debug-pass=Structure -o - %s 2>&1 \
6+
// RUN: | FileCheck %s
7+
8+
// CHECK: Replace __sycl_allocateLocalMemory with allocation of memory in local address space

clang/test/CodeGenSYCL/kernel-by-reference.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ int simple_add(int i) {
1515
int main() {
1616
queue q;
1717
#if defined(SYCL2020)
18-
// expected-warning@Inputs/sycl.hpp:{{[0-9]+}} {{Passing kernel functions by value is deprecated in SYCL 2020}}
18+
// expected-warning@Inputs/sycl.hpp:301 {{Passing kernel functions by value is deprecated in SYCL 2020}}
1919
// expected-note@+3 {{in instantiation of function template specialization}}
2020
#endif
2121
q.submit([&](handler &h) {
2222
h.single_task_2017<class sycl2017>([]() { simple_add(10); });
2323
});
2424

2525
#if defined(SYCL2017)
26-
// expected-warning@Inputs/sycl.hpp:{{[0-9]+}} {{Passing of kernel functions by reference is a SYCL 2020 extension}}
26+
// expected-warning@Inputs/sycl.hpp:296 {{Passing of kernel functions by reference is a SYCL 2020 extension}}
2727
// expected-note@+3 {{in instantiation of function template specialization}}
2828
#endif
2929
q.submit([&](handler &h) {

0 commit comments

Comments
 (0)