Skip to content

Commit 72593b5

Browse files
alexeyvoronov-intelbader
authored andcommitted
[SYCL] Add a regression test for kernel names.
Added a regression test to confirm the lack of ambiguity in the integration header for kernel names declared within namespaces in case of namespaces with matching names. Signed-off-by: Alexey Voronov <[email protected]>
1 parent 5d22a8e commit 72593b5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %clangxx -fsycl %s -o %t.out
2+
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
//==------- kernel_name_inside_sycl_namespace.cpp - Regression test --------==//
8+
//
9+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
10+
// See https://llvm.org/LICENSE.txt for license information.
11+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include <CL/sycl.hpp>
16+
17+
struct A {};
18+
namespace sycl {
19+
struct B {};
20+
using b_t = B;
21+
using a_t = A;
22+
} // namespace sycl
23+
24+
int main() {
25+
cl::sycl::queue Queue;
26+
Queue.submit(
27+
[&](cl::sycl::handler &CGH) { CGH.single_task<sycl::b_t>([=]() {}); });
28+
Queue.submit(
29+
[&](cl::sycl::handler &CGH) { CGH.single_task<sycl::a_t>([=]() {}); });
30+
return 0;
31+
}

0 commit comments

Comments
 (0)