-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SYCL free function namespace support #17585
base: sycl
Are you sure you want to change the base?
Changes from all commits
b305e94
5ff7b2c
12df05e
bd15ef7
65ef84f
117e97a
c53312a
190ac32
0858e70
32113db
2183658
5dd5894
2499963
a5edf00
2bb7c21
b3bd8ae
c755d26
64906f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,18 +86,20 @@ foo(Arg1<int> arg) { | |
// CHECK-NEXT: template <typename T, typename, int a, typename, typename ...TS> struct Arg; | ||
// CHECK-NEXT: } | ||
|
||
// CHECK: void ns::simple(ns::Arg<char, int, 12, ns::notatuple>); | ||
// CHECK-NEXT: static constexpr auto __sycl_shim1() { | ||
// CHECK-NEXT: return (void (*)(struct ns::Arg<char, int, 12, struct ns::notatuple>))simple; | ||
// CHECK: namespace ns { | ||
// CHECK-NEXT: void simple(ns::Arg<char, int, 12, ns::notatuple> ); | ||
// CHECK-NEXT: } // namespace ns | ||
// CHECK: static constexpr auto __sycl_shim1() { | ||
// CHECK-NEXT: return (void (*)(struct ns::Arg<char, int, 12, struct ns::notatuple>))ns::simple; | ||
// CHECK-NEXT: } | ||
|
||
// CHECK: Forward declarations of kernel and its argument types: | ||
// CHECK: namespace ns { | ||
// CHECK: namespace ns1 { | ||
// CHECK-NEXT: template <typename A> class hasDefaultArg; | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add more FE tests? Like with various combinations of namespaces around the free function kernel declaration? With inline namespace and not. Can we also test that codegen and semantic analysis is ok for free function kernels defined in a (maybe nested) namespace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added new e2e tests to check any possible namespaces: nested, anonymous, inline etc. Is it enough or add in these tests too? New tests do not check header directly but if something is emitted wrong, they will fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SYCL compiler is complicated and has a lot of components. If we only have a e2e test and it fails suddenly (for example after a pulldown), it may take a while to identify which component now has a problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I did not see that these tests are units. Added new checks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well they are "unit" because clang is enormous itself and has its own unit tests but in terms of SYCL compiler we can consider them as unit tests. |
||
|
||
// CHECK: void simple1(ns::Arg<ns::ns1::hasDefaultArg<ns::notatuple>, int, 12, ns::notatuple>); | ||
// CHECK: void simple1(ns::Arg<ns::ns1::hasDefaultArg<ns::notatuple>, int, 12, ns::notatuple> ); | ||
// CHECK-NEXT: static constexpr auto __sycl_shim2() { | ||
// CHECK-NEXT: return (void (*)(struct ns::Arg<class ns::ns1::hasDefaultArg<struct ns::notatuple>, int, 12, struct ns::notatuple>))simple1; | ||
// CHECK-NEXT: } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate what this particular addition is trying to achieve, why the previous code did not suffice and how does it relate to namespace printing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general,
ParamList
contains only parameter types, i.e. for the functionvoid some_func(float a, float* b)
ParamList
contains{float, float*}
It was added new list to have additional list of parameters with names to pass already existed tests for free function which checked generated header.
flag
Policy.SuppressTagKeyword = true;
forces printing without type tags, i.e. without words
class
andstruct
.