From eae0f80c6d900a4ad88ca682fe96d416a76b1144 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Sun, 30 Dec 2018 23:16:56 +0300 Subject: [PATCH] [SYCL] Add missing includes in SYCL stubs for C++ standard headers. Signed-off-by: Vladimir Lazarev --- clang/lib/Headers/sycl_wrappers/algorithm | 1 + clang/lib/Headers/sycl_wrappers/random | 3 +++ clang/test/CodeGenSYCL/inlining.cpp | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 clang/test/CodeGenSYCL/inlining.cpp diff --git a/clang/lib/Headers/sycl_wrappers/algorithm b/clang/lib/Headers/sycl_wrappers/algorithm index 35e9457ab1531..94375c9b3979c 100644 --- a/clang/lib/Headers/sycl_wrappers/algorithm +++ b/clang/lib/Headers/sycl_wrappers/algorithm @@ -9,6 +9,7 @@ //===----------------------------------------------------------------------===// #include +#include namespace std { diff --git a/clang/lib/Headers/sycl_wrappers/random b/clang/lib/Headers/sycl_wrappers/random index 373bcc07fe6e3..b03602c8a68ca 100644 --- a/clang/lib/Headers/sycl_wrappers/random +++ b/clang/lib/Headers/sycl_wrappers/random @@ -9,6 +9,9 @@ //===----------------------------------------------------------------------===// #include +#include +#include +#include namespace std { diff --git a/clang/test/CodeGenSYCL/inlining.cpp b/clang/test/CodeGenSYCL/inlining.cpp new file mode 100644 index 0000000000000..de4ac2d015ad0 --- /dev/null +++ b/clang/test/CodeGenSYCL/inlining.cpp @@ -0,0 +1,12 @@ +// RUN: %clang --sycl %s -S -emit-llvm -o - | FileCheck %s + +template +__attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) { + kernelFunc(); +} + +int main() { + // CHECK-NOT: noinline + kernel_single_task([]() {}); + return 0; +}