Skip to content

Commit 3edb2ec

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (#4)
2 parents c2c98c9 + f51030c commit 3edb2ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+126
-61
lines changed

clang/lib/CodeGen/CGClass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,8 @@ void CodeGenFunction::InitializeVTablePointer(const VPtr &Vptr) {
24912491
llvm::FunctionType::get(CGM.Int32Ty, /*isVarArg=*/true)
24922492
->getPointerTo()
24932493
->getPointerTo();
2494-
VTableField = Builder.CreateBitCast(VTableField, VTablePtrTy->getPointerTo());
2494+
VTableField = Builder.CreateBitCast(VTableField, VTablePtrTy->getPointerTo(
2495+
VTableField.getType()->getAddressSpace()));
24952496
VTableAddressPoint = Builder.CreateBitCast(VTableAddressPoint, VTablePtrTy);
24962497

24972498
llvm::StoreInst *Store = Builder.CreateStore(VTableAddressPoint, VTableField);

clang/lib/CodeGen/CodeGenTypes.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,6 @@ llvm::StructType *CodeGenTypes::ConvertRecordDeclType(const RecordDecl *RD) {
749749
return Ty;
750750
}
751751

752-
assert((!Context.getLangOpts().SYCLIsDevice || !isa<CXXRecordDecl>(RD) ||
753-
!dyn_cast<CXXRecordDecl>(RD)->isPolymorphic()) &&
754-
"Types with virtual functions not allowed in SYCL");
755-
756752
// Okay, this is a definition of a type. Compile the implementation now.
757753
bool InsertResult = RecordsBeingLaidOut.insert(Key).second;
758754
(void)InsertResult;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %clang_cc1 -triple spir64-unknown-linux-sycldevice -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
2+
template <typename name, typename Func>
3+
__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
4+
kernelFunc();
5+
}
6+
7+
struct Struct {
8+
virtual void foo() {}
9+
void bar() {}
10+
};
11+
12+
int main() {
13+
kernel_single_task<class kernel_function>([]() {
14+
Struct S;
15+
S.bar(); });
16+
return 0;
17+
}
18+
19+
20+
// Struct layout big enough for vtable.
21+
// CHECK: %struct._ZTS6Struct.Struct = type { i32 (...)** }
22+
// VTable:
23+
// CHECK: @_ZTV6Struct = linkonce_odr unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI6Struct to i8*), i8* bitcast (void (%struct._ZTS6Struct.Struct addrspace(4)*)* @_ZN6Struct3fooEv to i8*)] }, comdat, align 8
24+
// CHECK: @[[TYPEINFO:.+]] = external global i8*
25+
// TypeInfo Name:
26+
// CHECK: @_ZTS6Struct = linkonce_odr constant [8 x i8] c"6Struct\00", comdat, align 1
27+
// TypeInfo:
28+
// CHECK: @_ZTI6Struct = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @[[TYPEINFO]], i64 2) to i8*), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_ZTS6Struct, i32 0, i32 0) }, comdat, align 8

sycl/source/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// 4.6.2 Context class
2323

24-
namespace cl {
24+
__SYCL_INLINE namespace cl {
2525
namespace sycl {
2626
context::context(const async_handler &AsyncHandler)
2727
: context(default_selector().select_device(), AsyncHandler) {}

sycl/source/detail/accessor_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CL/sycl/detail/accessor_impl.hpp>
1010
#include <CL/sycl/detail/scheduler/scheduler.hpp>
1111

12-
namespace cl {
12+
__SYCL_INLINE namespace cl {
1313
namespace sycl {
1414
namespace detail {
1515

sycl/source/detail/builtins_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace s = cl::sycl;
2323
namespace d = s::detail;
2424

25-
namespace cl {
25+
__SYCL_INLINE namespace cl {
2626
namespace __host_std {
2727
namespace {
2828

sycl/source/detail/builtins_geometric.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace s = cl::sycl;
1717
namespace d = s::detail;
1818

19-
namespace cl {
19+
__SYCL_INLINE namespace cl {
2020
namespace __host_std {
2121

2222
s::cl_float Dot(s::cl_float2, s::cl_float2);

sycl/source/detail/builtins_integer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace s = cl::sycl;
1818
namespace d = s::detail;
1919

20-
namespace cl {
20+
__SYCL_INLINE namespace cl {
2121
namespace __host_std {
2222
namespace {
2323

sycl/source/detail/builtins_math.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace s = cl::sycl;
2323
namespace d = s::detail;
2424

25-
namespace cl {
25+
__SYCL_INLINE namespace cl {
2626
namespace __host_std {
2727

2828
namespace {

sycl/source/detail/builtins_relational.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace s = cl::sycl;
1717
namespace d = s::detail;
1818

19-
namespace cl {
19+
__SYCL_INLINE namespace cl {
2020
namespace __host_std {
2121
namespace {
2222

sycl/source/detail/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CL/sycl/detail/common.hpp>
1010
#include <CL/sycl/detail/common_info.hpp>
1111

12-
namespace cl {
12+
__SYCL_INLINE namespace cl {
1313
namespace sycl {
1414
namespace detail {
1515

sycl/source/detail/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define STRINGIFY_LINE_HELP(s) #s
1818
#define STRINGIFY_LINE(s) STRINGIFY_LINE_HELP(s)
1919

20-
namespace cl {
20+
__SYCL_INLINE namespace cl {
2121
namespace sycl {
2222
namespace detail {
2323

sycl/source/detail/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <cstdlib>
1212

13-
namespace cl {
13+
__SYCL_INLINE namespace cl {
1414
namespace sycl {
1515
namespace detail {
1616

sycl/source/detail/context_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <CL/sycl/platform.hpp>
1818
#include <CL/sycl/stl.hpp>
1919

20-
namespace cl {
20+
__SYCL_INLINE namespace cl {
2121
namespace sycl {
2222
namespace detail {
2323

sycl/source/detail/device_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <algorithm>
1313

14-
namespace cl {
14+
__SYCL_INLINE namespace cl {
1515
namespace sycl {
1616
namespace detail {
1717

sycl/source/detail/device_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
2020
#endif
2121

22-
namespace cl {
22+
__SYCL_INLINE namespace cl {
2323
namespace sycl {
2424
namespace detail {
2525

sycl/source/detail/error_handling/enqueue_kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <CL/sycl/detail/pi.hpp>
1616

17-
namespace cl {
17+
__SYCL_INLINE namespace cl {
1818
namespace sycl {
1919
namespace detail {
2020

sycl/source/detail/error_handling/error_handling.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <CL/sycl/detail/pi.h>
1212
#include <CL/sycl/detail/cg.hpp>
1313

14-
namespace cl {
14+
__SYCL_INLINE namespace cl {
1515
namespace sycl {
1616
namespace detail {
1717

sycl/source/detail/event_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <chrono>
1515

16-
namespace cl {
16+
__SYCL_INLINE namespace cl {
1717
namespace sycl {
1818
namespace detail {
1919

sycl/source/detail/force_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <CL/sycl/stl.hpp>
1212
#include <cstdlib>
1313

14-
namespace cl {
14+
__SYCL_INLINE namespace cl {
1515
namespace sycl {
1616
namespace detail {
1717

sycl/source/detail/helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <memory>
1616

17-
namespace cl {
17+
__SYCL_INLINE namespace cl {
1818
namespace sycl {
1919
using ContextImplPtr = std::shared_ptr<cl::sycl::detail::context_impl>;
2020
namespace detail {

sycl/source/detail/image_accessor_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CL/sycl/accessor.hpp>
1010
#include <CL/sycl/builtins.hpp>
1111

12-
namespace cl {
12+
__SYCL_INLINE namespace cl {
1313
namespace sycl {
1414
namespace detail {
1515

sycl/source/detail/image_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <CL/sycl/image.hpp>
1010

11-
namespace cl {
11+
__SYCL_INLINE namespace cl {
1212
namespace sycl {
1313
namespace detail {
1414

sycl/source/detail/kernel_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <memory>
1717

18-
namespace cl {
18+
__SYCL_INLINE namespace cl {
1919
namespace sycl {
2020
namespace detail {
2121

sycl/source/detail/kernel_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CL/sycl/detail/kernel_info.hpp>
1010
#include <CL/sycl/device.hpp>
1111

12-
namespace cl {
12+
__SYCL_INLINE namespace cl {
1313
namespace sycl {
1414
namespace detail {
1515
template <>

sycl/source/detail/kernel_program_cache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <CL/sycl/detail/kernel_program_cache.hpp>
1010

11-
namespace cl {
11+
__SYCL_INLINE namespace cl {
1212
namespace sycl {
1313
namespace detail {
1414
KernelProgramCache::~KernelProgramCache() {

sycl/source/detail/memory_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <cstring>
1818
#include <vector>
1919

20-
namespace cl {
20+
__SYCL_INLINE namespace cl {
2121
namespace sycl {
2222
namespace detail {
2323

sycl/source/detail/os_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
#endif // SYCL_RT_OS
4646

47-
namespace cl {
47+
__SYCL_INLINE namespace cl {
4848
namespace sycl {
4949
namespace detail {
5050

sycl/source/detail/pi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <stddef.h>
1616
#include <string>
1717

18-
namespace cl {
18+
__SYCL_INLINE namespace cl {
1919
namespace sycl {
2020
namespace detail {
2121
namespace pi {

sycl/source/detail/platform_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <cstring>
1616
#include <regex>
1717

18-
namespace cl {
18+
__SYCL_INLINE namespace cl {
1919
namespace sycl {
2020
namespace detail {
2121

sycl/source/detail/platform_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <CL/sycl/detail/platform_info.hpp>
1010

11-
namespace cl {
11+
__SYCL_INLINE namespace cl {
1212
namespace sycl {
1313
namespace detail {
1414

sycl/source/detail/platform_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <intrin.h>
1717
#endif
1818

19-
namespace cl {
19+
__SYCL_INLINE namespace cl {
2020
namespace sycl {
2121
namespace detail {
2222

sycl/source/detail/posix_pi.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
//==---------------- posix_pi.cpp ------------------------------------------==//
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 <CL/sycl/detail/defines.hpp>
10+
111
#include <dlfcn.h>
212
#include <string>
313

4-
namespace cl {
14+
__SYCL_INLINE namespace cl {
515
namespace sycl {
616
namespace detail {
717
namespace pi {

sycl/source/detail/program_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <fstream>
1616
#include <memory>
1717

18-
namespace cl {
18+
__SYCL_INLINE namespace cl {
1919
namespace sycl {
2020
namespace detail {
2121

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <mutex>
2828
#include <sstream>
2929

30-
namespace cl {
30+
__SYCL_INLINE namespace cl {
3131
namespace sycl {
3232
namespace detail {
3333

sycl/source/detail/queue_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <cstring>
1818

19-
namespace cl {
19+
__SYCL_INLINE namespace cl {
2020
namespace sycl {
2121
namespace detail {
2222
template <> cl_uint queue_impl::get_info<info::queue::reference_count>() const {

sycl/source/detail/sampler_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <CL/sycl/detail/context_impl.hpp>
1010
#include <CL/sycl/detail/sampler_impl.hpp>
1111

12-
namespace cl {
12+
__SYCL_INLINE namespace cl {
1313
namespace sycl {
1414
namespace detail {
1515

sycl/source/detail/scheduler/commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <memory>
3333
#endif
3434

35-
namespace cl {
35+
__SYCL_INLINE namespace cl {
3636
namespace sycl {
3737
namespace detail {
3838

sycl/source/detail/scheduler/graph_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <set>
2323
#include <vector>
2424

25-
namespace cl {
25+
__SYCL_INLINE namespace cl {
2626
namespace sycl {
2727
namespace detail {
2828

sycl/source/detail/scheduler/graph_processor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <memory>
1414
#include <vector>
1515

16-
namespace cl {
16+
__SYCL_INLINE namespace cl {
1717
namespace sycl {
1818
namespace detail {
1919

0 commit comments

Comments
 (0)